fork download
  1. #include <limits>
  2.  
  3. class Foo {
  4. public:
  5. constexpr Foo(const int value) : value(value) {}
  6. constexpr operator int () const { return value; }
  7.  
  8. private:
  9. int value;
  10. };
  11.  
  12. class Bar : public Foo {
  13. public:
  14. using Foo::Foo;
  15. constexpr static Foo UNKNOWN = std::numeric_limits<int>::max();
  16. constexpr static Foo ANY = UNKNOWN - 1;
  17. };
  18.  
  19. int main() {
  20. return Bar(0);
  21. }
  22.  
Success #stdin #stdout 0s 3464KB
stdin
Standard input is empty
stdout
Standard output is empty