title: C++ set wants an initializer_list when I try to add a single number
body: <p>I have a problem that would seem not a lot of people run into. I'm not sure if it's blatantly obvious what to do and I'm not getting it, or I am writing something wrong. I'm using Windows 10, Android Studio. my code segment looks like this. </p>
  
  <pre><code>vector&lt;pair&lt;::google::protobuf::int64,::google::protobuf::int64&gt;&gt; vpLatSortedNodes;
  vector&lt;pair&lt;::google::protobuf::int64,::google::protobuf::int64&gt;&gt; vpLonSortedNodes;
  
  //The above two lines are declared and populated else where 
  //I just moved the lines here so you could see what type they were 
  set&lt;::google::protobuf::int64&gt; sLats;
  set&lt;::google::protobuf::int64&gt; sLons;
  
  set&lt;int&gt; iSet;
  for(long i=lIndexLatMin;i&lt;lIndexLatMax;i++){
  
      sLats.insert(vpLatSortedNodes.at(i).second);//Problem here
  }//end for
  for(long i=lIndexLonMin;i&lt;lIndexLonMax;i++){
      sLons.insert(vpLonSortedNodes.at(i).second);//Problem here
  }//end for
  </code></pre>
  
  <p>From what I've been told that line should work and it does work in and IOS version. </p>
  
  <p>I get the error:</p>
  
  <pre><code>Parameter type mismatch: Types 'initializer_list&lt;long long int&gt; and 'long long int'
  </code></pre>
  
  <p>I've looked up the set::insert  acceptable calls and I found this </p>
  
  <pre><code>  single element (1)    
      pair&lt;iterator,bool&gt; insert (const value_type&amp; val);
      pair&lt;iterator,bool&gt; insert (value_type&amp;&amp; val);
    with hint (2) 
      iterator insert (const_iterator position, const value_type&amp; val);
      iterator insert (const_iterator position, value_type&amp;&amp; val);
    range (3) 
      template &lt;class InputIterator&gt;
       void insert (InputIterator first, InputIterator last);
    initializer list (4)  
      void insert (initializer_list&lt;value_type&gt; il); 
  </code></pre>
  
  <p>So my compiler seems to think I'm trying to use the last of the uses. So I understand that it wants me to use an initializer_list for the type of call I am trying to make, but what really confuses me is the example that is also on information page that seems to say I don't need the initializer_list. </p>
  
  <p>Example is here:</p>
  
  <pre><code>  // set::insert (C++98)
    #include &lt;iostream&gt;
    #include &lt;set&gt;
  
    int main ()
  {
      std::set&lt;int&gt; myset;
      std::set&lt;int&gt;::iterator it;
      std::pair&lt;std::set&lt;int&gt;::iterator,bool&gt; ret;
  
      // set some initial values:
     for (int i=1; i&lt;=5; ++i) myset.insert(i*10);   //HOW DOES THIS WORK?!?!
  
     ret = myset.insert(20);               // no new element inserted
  
     if (ret.second==false) it=ret.first;  // "it" now points to element 20
  
     myset.insert (it,25);                 // max efficiency inserting
     myset.insert (it,24);                 // max efficiency inserting
     myset.insert (it,26);                 // no max efficiency inserting
  
     int myints[]= {5,10,15};              // 10 already in set, not inserted
     myset.insert (myints,myints+3);
  
     std::cout &lt;&lt; "myset contains:";
     for (it=myset.begin(); it!=myset.end(); ++it)
        std::cout &lt;&lt; ' ' &lt;&lt; *it;
        std::cout &lt;&lt; '\n';
  
     return 0;
  } 
  </code></pre>
  
  <p>This line in particular I tried to see if it worked and I got the same error <code>for (int i=1; i&lt;=5; ++i) myset.insert(i*10);</code>. I searched StackOverflow and no one else has asked this question, which makes me very hesitant to ask myself. I've spent so much time on trying to figure this out that at this point I just want some kind of hint or answer. </p>