forward declaration in c++
I want to forward 开发者_如何学JAVAdeclare:
namespace boost {
namespace property_tree {
template<typename Key, typename Data, typename KeyCompare = std::less<Key> >
class basic_ptree;
typedef basic_ptree< std::string, std::string > ptree;
}
}
but my g++ cribs about redefinition due to default template argument. How can I achieve this?
To forward-declare the property_tree, you should include the
#include <boost/property_tree/ptree_fwd.hpp>
header, instead of declaring one yourself.
精彩评论