Is this valid C++ code?

后端 未结 4 847
迷失自我
迷失自我 2021-02-04 00:37

I had the following code, which was basically,

class foo {
  public:
    void method();
};

void foo::foo::method() { }

I had accidentally adde

4条回答
  •  星月不相逢
    2021-02-04 01:08

    Is there a namespace foo in some other module that you include (and you were just ignorant of it)? Otherwise, it is not correct. I am not sure why g++ allowed this.

提交回复
热议问题