Template friend function and return type deduction

不羁的心 提交于 2019-12-03 12:41:45

edit: look at the comments section, it's a bug in gcc 4.8.2 and 4.9

Gcc error code:

prog.cpp:10:61: error: non-static data member declared 'auto' operator+(MyClass const& a, MyClass const& b) ^ prog.cpp: In function 'int main()': prog.cpp:25:15: error: no match for 'operator+' (operand types are 'MyClass' and 'MyClass') auto z = x+y; ^

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!