identity.hpp 302 B

1234567891011121314151617181920
  1. //
  2. // identity.hpp
  3. // gameutils
  4. //
  5. // Created by Sam Jaffe on 7/5/16.
  6. //
  7. #pragma once
  8. #include <type_traits>
  9. template <typename T, typename ID = unsigned int>
  10. class identity {
  11. public:
  12. ID const id;
  13. private:
  14. friend T;
  15. identity( ID _id ) : id( std::move( _id ) ) {}
  16. identity( ) = delete;
  17. };