Are C++ recursive type definitions possible, in particular can I put a vector within the definition of T?

前端 未结 6 2111
轻奢々
轻奢々 2020-11-27 21:32

For one of my projects, what I really wanted to do was this (simplifying it to the bare minimum);

struct Move
{
    int src;
    int dst;
};

struct MoveTree         


        
6条回答
  •  Happy的楠姐
    2020-11-27 22:10

    No, it's not portable. codepad.org does not compile it.

    t.cpp:14:   instantiated from here
    Line 215: error: '__gnu_cxx::_SGIAssignableConcept<_Tp>::__a' has incomplete type
    compilation terminated due to -Wfatal-errors.
    

提交回复
热议问题