codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
#include <cstdio> struct custom { custom(int i): i(i) { } friend inline custom operator + (const custom &lhs, const custom &rhs) { return lhs.i + rhs.i; } private: int i; }; struct converted { inline operator custom () { return custom(2); } }; int main() { converted c; printf("%d\n", c + c); return 0; }
Private
[
?
]
Run code
Submit