I am creating a small ‘generic’ pathfinding class which takes a class type of Board on which it will be finding paths,
//T - Board class type
template<class T>
class PathFinder
{...}
Whereas Board is also templated to hold the node type. (so that i can find paths on 2D or 3D vector spaces).
I would like to be able to declare and define a member function for PathFinder that will take parameters like so
//T - Board class type
PathFinder<T>::getPath( nodeType from, nodeType to);
How can I perform the type compatibility for the node type of T and nodeType that is fed into the function as parameter ?
If I understand what you want, give
boarda type member and use that:You can also pattern match it if you can’t change
board: