overload12.c
来自「this is a gcc file, you can download it 」· C语言 代码 · 共 31 行
C
31 行
// Build don't link:// Origin: Neil Booth <neilb@earthling.net> from bug #27.struct A{};struct B:A{};struct C:B{};struct CX{ C c; operator C&(){return c;}};// viable functions for call belowvoid f(A&);void f(B&);int main(){ CX cx; C c; f(c); // the standard conversion to B& is better than to A& f(cx); // after user defined conversion to C& // the standard conversion to B& is better than to A& }
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?