Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
amusing overload choice
//Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23506 for x86 #include <iostream> struct MyClass { MyClass() : mStr("I'm a string") {} inline operator int() const { return 5; } inline operator const char*() const { return mStr.c_str(); } protected: std::string mStr; }; void myfunc() { MyClass c; std::cout << c << std::endl; } int main() { std::cout << "Hello, world!\n"; myfunc(); }
run
|
edit
|
history
|
help
0
Shadow pointer member variable
cv5
define_xml_tags
Fast sine to fill array (sin/cos pair)
VS struct name enumerate
hyy
MSVCStatic
error_check
ExtThes_Uniquify
Postfix side effect returning 2