I have a class defined as:
template <typename V, typename E> class AdjacencyList; Where V and E are the types of the vertex and edge values respectively.
I am currently attempting to define the following member function inside AdjacencyList:
std::map< std::shared_ptr< Vertex<V, E> >, E > dijkstra( const std::shared_ptr< Vertex<V, E> > &start_vertex) const; For those familiar with Dijkstra's algorithm, it is only possible to implement correctly if E is an addable and non-negative type. Therefore, how do I correctly use the enable_if construct to only enable this function if E is an unsigned integral type?
I am currently seeing two complications here that I am uncomfortable with approaching:
- Both the return type and the parameter concern
E. Eitself is not used as a type, but is used in other type templates.
Because I am relatively new to the enable_if construct, I would feel more comfortable with some guidance on the issue since this is a relatively non-trivial case.