declaration does not declare anything : warning?

前端 未结 4 2161
暖寄归人
暖寄归人 2021-02-07 09:25
#include 
#include 
#include 

int main()
{
    struct emp
    {
        struct address
        {
              int a;
             


        
4条回答
  •  余生分开走
    2021-02-07 09:41

    Going to also throw this out there that this error may also show up if you don't properly forward declare types found in other namespaces.

    https://stackoverflow.com/a/19001722/1330381

    Example

    namespace A {
    
    // forward declarations
    namespace X {
    namespace Y {
    class MyType;
    }
    }
    
    namespace B {
    
    class Foo() {
        void methodBar(const X::Y::MyType& mt);
    }
    }
    

提交回复
热议问题