Quantcast
Channel: Get templated, template type - Stack Overflow
Browsing index pages (3 articles)

Get templated, template type

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 typetemplate<class T>class PathFinder{...}Whereas Board is...

View Article


Answer by Denis Ermolin for Get templated, template type

You can typedefnodeType inside class definition:typedef typename T::nodeType TNode;PathFinder<T>::getPath( TNode from, TNode to);

View Article


Answer by Pubby for Get templated, template type

If I understand what you want, give board a type member and use that:template<class nodeType>class board { public: typedef nodeType node_type; // ...};PathFinder<T>::getPath(typename...

View Article
Browsing index pages (3 articles)


Latest Images