template<typename ... Args>
class Node
{
}
template<typename ... Args>
class Link
{
}
I
I want a template class Network that is composed of Nodes and Links.
1 2 3 4 5 6 7
template<template<typename...> class NODE, typename... NODET,
template<typename...> class LINK, typename... LINKT>
class Network
{
vector<NODE<NODET...> > nodes;
vector<LINK<LINKT...> > links;
};
For example, consider these Node and Link classes:
1 2
Link<std::string> l = Link<std::string> ();
Node<int,int> n = Node <int,int> ();
I want a to be able to pass to the Network class the typenames of Node (int,int) and typename of Link (std::string) and create the following Network class:
Network<Node, int, int, Link, std::string>;
template<typename ... Args>
class Node
{
}
template<typename ... Args>
class Link
{
}
template <typename...> class Network;
template< typename... NodeT,
typename... LinkT>
class Network<Node<NodeT...>, Link<LinkT...>>
{
}
int main ()
{
Network<Node<int,int>,Link<std::string>> n = Network<Node<int,int>,Link<std::string>> ();
return 0
}