kumar
kumar

Reputation: 2796

forward declaration in c++

I want to forward declare:

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?

Upvotes: 1

Views: 390

Answers (1)

kennytm
kennytm

Reputation: 523164

To forward-declare the property_tree, you should include the

#include <boost/property_tree/ptree_fwd.hpp>

header, instead of declaring one yourself.

Upvotes: 5

Related Questions