Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
A string-integer comparison trick
//g++ 5.4.0 #include <iostream> #include <string> bool operator==(const std::string& a, int b) { return a == std::to_string(b); } struct { int value = 2; operator std::string() { return std::to_string(++value); } } a; int main() { if (a == 3 && a == 4) std::cout << "Я тоже так могу\n"; }
run
|
edit
|
history
|
help
0
Dij. Algo
Policy based smart pointer
CPP - Pointers - Ex.3
Count of factors
Precendence of Pointer Indirection Example
cppPyProperty
gal
D three integers
Default_Template
linkage