나는 C++에서 다음 struct
를 가지고 있는데, 다음과 같이 사용할 때 기본이 아닌 생성자를 정의해야하는지 궁금해했습니다. boost::shared_ptr<node> p_node = boost:shared_ptr<node>();
이 구조체는 기본이 아닌 생성자가 필요합니다.
struct node
{
std::string name;
std::map<std::string, std::vector<variant> > values; // it is possible that nodes contain as a value, key/value pairs so we need a map
NodeType type; //Enum
typedef struct attrib
{
std::string key;
variant value; //Boost::variant
};
std::vector<attrib> attributes;
boost::shared_ptr<node> childnode;
};
이것은 * 아닙니다 * a POD –