boxed_type.h 438 B

123456789101112131415161718192021222324
  1. #ifndef ENTT_COMMON_BOXED_TYPE_H
  2. #define ENTT_COMMON_BOXED_TYPE_H
  3. namespace test {
  4. template<typename Type>
  5. struct boxed_type {
  6. Type value{};
  7. operator Type() const noexcept {
  8. return value;
  9. }
  10. [[nodiscard]] bool operator==(const boxed_type &other) const noexcept {
  11. return value == other.value;
  12. }
  13. };
  14. using boxed_int = boxed_type<int>;
  15. using boxed_char = boxed_type<char>;
  16. } // namespace test
  17. #endif