title: Adding all values of map using std::accumulate
body: <p>I am simply trying to add values of a map defined in the program below:</p>
  
  <pre><code>std::map&lt;int, int&gt; floor_plan;
  
  const size_t distance = std::accumulate(std::begin(floor_plan), std::end(floor_plan), 0);
  
  std::cout &lt;&lt; "Total: " &lt;&lt; distance;
  </code></pre>
  
  <p>I get the following error:</p>
  
  <blockquote>
    <p>Error C2893: Failed to specialize function template 'unknown-type std::plus::operator ()(_Ty1 &amp;&amp;,_Ty2 &amp;&amp;) const'</p>
  </blockquote>