1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | #include <cassert> /** Determine whether the 'foo' attribute of an object is negative. */ template <class T> bool foo_negative(T& v) { return v.foo < 0; } struct X { int foo; }; int main() { X x; x.foo = 5; assert(!foo_negative(x)); return 0; } |
I2luY2x1ZGUgPGNhc3NlcnQ+CgovKiogRGV0ZXJtaW5lIHdoZXRoZXIgdGhlICdmb28nIGF0dHJpYnV0ZSBvZiBhbiBvYmplY3QgaXMgbmVnYXRpdmUuICovCnRlbXBsYXRlIDxjbGFzcyBUPgpib29sIGZvb19uZWdhdGl2ZShUJiB2KQp7CiAgICByZXR1cm4gdi5mb28gPCAwOwp9CgpzdHJ1Y3QgWAp7CiAgICBpbnQgZm9vOwp9OwoKaW50IG1haW4oKQp7CiAgICBYIHg7CiAgICB4LmZvbyA9IDU7CiAgICBhc3NlcnQoIWZvb19uZWdhdGl2ZSh4KSk7CiAgICByZXR1cm4gMDsKfQ==
-
upload with new input
-
result: Success time: 0.02s memory: 2720 kB returned value: 0


