title: C++ Nested Iterators for Sets
body: <p>I am trying use nested iterators for sets as shown below but gives an err:</p>
  <p>error: no match for ‘operator+’ (operand types are ‘std::_Rb_tree_const_iterator’ and ‘int’)
  for(auto itj = iti+1; itj != st.end(); itj++){</p>
  <pre><code>int alternate(string s) {
      set&lt;char&gt; st;
      for(char x : s){
          st.insert(x);
      }
  
      for(auto iti = st.begin(); iti != st.end(); iti++){
          //string t = &quot;&quot;;
          for(auto itj = iti+1; itj != st.end(); itj++){
              cout&lt;&lt;*iti&lt;&lt;&quot; &quot;&lt;&lt;*itj&lt;&lt;endl;
          }
      }
  }
  </code></pre>