在堆中创建对象

时间:2010-08-29 05:23:21

标签: c++ boost heap

我正在使用boost :: ptree来解析fils。问题是我无法在堆中创建对象。所有样品仅用于堆叠。

#include <boost/property_tree/ptree.hpp>
ptree *tree_handle;
read_info("path", tree_handle);

我需要这个,因为代码在函数中,我必须从中返回ptree-object。

错误:

‘boost::property_tree::basic_ptree<std::basic_string<char>, std::basic_string<char> >*’ is not a class, struct, or union type

request for member ‘swap’ in ‘pt’, which is of non-class type ‘boost::property_tree::basic_ptree<std::basic_string<char>, std::basic_string<char> >*’

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

从我所看到的,ptree似乎没有得到认可,你确定#include是否正常,或者ptree是否真的是你的意思?