title: conversion from std::map<std::basic_string<char>,std::pair<int,int(*)(const std::vector::Mat
body: <p>I have defined new type:</p>
  
  <pre><code>typedef int(* func) (const std::vector&lt;cv::Mat&gt;&amp;, cv::Mat&amp;);
  </code></pre>
  
  <p>Then I did class member: </p>
  
  <pre><code>std::map&lt; std::string, std::pair&lt;int,func&gt; &gt; functions;
  </code></pre>
  
  <p>In function, in first line:</p>
  
  <pre><code>pair&lt;funcId,func&gt; functionSet::getRandomFunction() const
  {
      map&lt;string, pair&lt;int,func&gt;&gt;::iterator it = functions.begin();
      std::advance(it, functions.size());
  
      string name = it-&gt;first;
      func function = it-&gt;second.second;
      int argumentsNumber = it-&gt;second.first;
      funcId id = make_pair(argumentsNumber,name);
  
      pair&lt;funcId,func&gt; p = make_pair(id,function);
  
      return p;
  }
  </code></pre>
  
  <p>I got this error:</p>
  
  <blockquote>
    <p>error: conversion from 'std::map,
    std::pair&amp;, cv::Mat&amp;)> >
    ::const_iterator {aka std::_Rb_tree_const_iterator, std::pair&amp;, cv::Mat&amp;)> > >}' to non-scalar type
    'std::map, std::pair&amp;, cv::Mat&amp;)> >::iterator {aka
    std::_Rb_tree_iterator,
    std::pair&amp;, cv::Mat&amp;)> > >}'
    requested
             map>::iterator it = functions.begin();</p>
  </blockquote>