I am trying to use the dpointer pattern in a generic class that made use of template but I cant figure how to define it correctly.
template <class TNode, class TLink>
class Network
{
private:
template<class TNode, class TLink>
struct Impl<TNode,TLink>;
std::unique_ptr<Impl<TNode,TLink>> d_ptr; //d_pointer
};
How can I define the Impl class in the cpp file?
template<class TNode, class TLink>
struct Network<TNode,TLink>::Impl<TNode, TLink>
{
vector<TNode> nodes;
vector<TLink> links;
}
This doesn't work! It says that Impl is not a template error C3856.