title: Not able to to do set element insertion inside constructor
body: <p>I am getting compilation error while inserting values inside constructor Monitor counstructor.
  Could you suggest what could be approach for the same as I need to populate this
  vector during class instantiation. It works fine with below approach but I don't want to populate the vector separately.</p>
  
  <pre><code>   vect1.insert( make_pair(10,20) );
     vect1.insert( make_pair(30,49) );
     vect1.insert( make_pair(50,60) );
     vect1.insert( make_pair(70,80) );
  </code></pre>
  
  <h2>below is the code snippet</h2>
  
  <pre><code>  #include &lt;iostream&gt;
    #include &lt;vector&gt;
    #include&lt;algorithm&gt;
    #include&lt;memory&gt;
    #include &lt;set&gt;
    using namespace std;
    class Monitor
    {
    public:
    virtual ~Monitor() = default;
    explicit Monitor(
    const set&lt; pair &lt;double,double&gt; &gt; &amp;vect1
    )
    {  
  
       for (auto &amp;itr : vect1 ) 
        { 
           std::cout&lt;&lt;"value1 ="&lt;&lt;itr.first&lt;&lt;endl;
           std::cout&lt;&lt;"value2="&lt;&lt;itr.second&lt;&lt;endl;
        }       
    }
  
   };
  
  int main()
  {  set&lt; pair &lt;double,double&gt; &gt; vect1;
     Monitor obj (vect1.insert( make_pair(10,20) ));
  
   return 0;   
  }
  </code></pre>
  
  <h2>compilation error</h2>
  
  <pre><code>error: no matching function for call to ‘Monitor::Monitor(std::pair &gt;, bool&gt;)’
      Monitor obj (vect1.insert( make_pair(10,20) ));
  </code></pre>