fork(3) download
  1. #include <type_traits>
  2.  
  3. struct chameleon
  4. {
  5. template<typename T>
  6. constexpr operator T() const
  7. {
  8. return T{};
  9. }
  10.  
  11. constexpr chameleon() = default;
  12. };
  13.  
  14. template<int foo>
  15. struct bar
  16. {
  17.  
  18. };
  19.  
  20. using mytype = std::integral_constant<int,chameleon{}>;
  21.  
  22. static_assert( mytype::value == 0 , "Mmmmm...." );
  23.  
  24. int main()
  25. {
  26. mytype f;
  27. }
Success #stdin #stdout 0s 3336KB
stdin
Standard input is empty
stdout
Standard output is empty