Template friend function and return type deduction

后端 未结 1 942
挽巷
挽巷 2021-02-15 04:12

Note: This question is really close to Return type deduction for in-class friend functions, but I did not find the answer to my problem there.

Tested with clang 3.4 with

1条回答
  •  心在旅途
    2021-02-15 04:55

    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; ^

    0 讨论(0)
提交回复
热议问题