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