typedef and incomplete type

后端 未结 2 1064
终归单人心
终归单人心 2020-12-11 16:52

Recently I am having many problem with typedef and incomplete type when I changed certain containers, allocators in my code.

What I had previously

st         


        
2条回答
  •  青春惊慌失措
    2020-12-11 17:40

    Compiller doesn't know the size of incomplete type, therefore it can not instantiate it nor allocate some memory for it. Having a pointer to object (like typedef std::tr1::array all_foos; ) instead of instance of the object itself solves this issue.

提交回复
热议问题