convertable.hpp 278 B

12345678910111213141516
  1. #pragma once
  2. namespace types {
  3. template <typename To>
  4. struct Convertable {
  5. template <typename Self>
  6. class type {
  7. private:
  8. Self const & self() const { return *(Self const *)(void const *)(this); }
  9. public:
  10. operator To() const;
  11. };
  12. };
  13. }