fork download
  1. #include <iostream>
  2. #include <assert.h>
  3.  
  4. struct S
  5. {
  6. S(int x) : x(x) {}
  7.  
  8. bool operator==(const S& other) const
  9. {
  10. return x == other.x;
  11. }
  12. int x;
  13. };
  14.  
  15. int main() {
  16. S s1{5};
  17. S s2{5};
  18.  
  19. assert(s1 == s2);
  20.  
  21. assert(!(s1 == 5));
  22.  
  23. return 0;
  24. }
Runtime error #stdin #stdout #stderr 0s 16064KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
prog: prog.cpp:21: int main(): Assertion `!(s1 == 5)' failed.