identity.hpp 296 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> class identity {
  10. public:
  11. ID const id;
  12. private:
  13. friend T;
  14. identity(ID _id) : id(std::move(_id)) {}
  15. identity() = delete;
  16. };