fork(1) download
  1. #include <limits>
  2.  
  3. class Foo {
  4. public:
  5. constexpr Foo(const int value) : value(value) {}
  6.  
  7. constexpr static Foo UNKNOWN = std::numeric_limits<int>::max();
  8. constexpr static Foo ANY = UNKNOWN - 1;
  9.  
  10. constexpr operator int () const { return value; }
  11.  
  12. private:
  13. int value;
  14. };
  15.  
  16. int main() {
  17. return Foo(0);
  18. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:7:66: error: 'constexpr const Foo Foo::UNKNOWN' has incomplete type
     constexpr static Foo UNKNOWN = std::numeric_limits<int>::max();
                                                                  ^
prog.cpp:8:46: error: 'constexpr const Foo Foo::ANY' has incomplete type
     constexpr static Foo ANY     = UNKNOWN - 1;
                                              ^
stdout
Standard output is empty