以下のコードで、main関数の c(); でエラーになります。
C::operator()() constをインラインにすると、エラーは消えます。
なぜ、エラーになるのでしょうか。
コンパイラ: MSVC
C++
1#ifndef SUB_H 2#define SUB_H 3 4class C { 5public: 6 auto operator()() const; 7}; 8 9#endif
C++
1#include "sub.h" 2 3auto C::operator()() const { 4 return 0; 5}
C++
1#include "sub.h" 2 3int main() { 4 C c; 5 c(); 6}
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/04/29 07:48
2016/04/30 10:32
2016/04/30 13:26
2016/05/01 04:59
2016/05/01 09:15
2016/05/03 09:50