title: std::rotate arguments not correct?
body: <p>I have a vector containing iterators for an <code>unordered_map</code> and I want to use <code>std::rotate</code> on the iterators, but I must be missing something.</p>
  
  <p>The code works when I do someting like</p>
  
  <pre><code>std::vector&lt;std::unordered_map&lt;int, int&gt;::iterator&gt; _lruList;
  
  void used(std::unordered_map&lt;int, int&gt;::iterator&amp; it, int type) {
      if (type == 0) {
          auto item = _lruList.begin();
          while (item != _lruList.end()){
              if (*item == it){
                  std::rotate(item, item + 1, _lruList.end());
                  return;
              }
              item++;
          }
      }
  }
  </code></pre>
  
  <p>but I want the code to work like this, because this function is called a lot, in which the extra while loop adds extra unneccessary time complexity</p>
  
  <pre><code>std::vector&lt;std::unordered_map&lt;int, int&gt;::iterator&gt; _lruList;
      void used(std::unordered_map&lt;int, int&gt;::iterator&amp; it, int type) {
          if (type == 0) {
              std::rotate(it, it + 1, _lruList.end()); //error on it
              return;
          }
      }
  </code></pre>
  
  <p>EDIT: Some more code, I see that the types of it and _lruList.end() conflicts. Is there anyway that I can fix this to still accomplish that I want to do without iterating through the vector? </p>
  
  <p>After further debugging, it appears that <code>it + 1</code> is giving me an <code>"error type"</code> according to VS2015.</p>
  
  <pre><code>std::unordered_map&lt;int, int&gt;::iterator found = _cache.find(key);
  // if key doesn't exist, return -1
  if (found == _cache.end()) {
      return -1;
  }
  // if key exists, return value and update lru
  used(found, 0);
  return found-&gt;second;
  </code></pre>
  
  <p>I can provide more code snippets if that would help answer my question. </p>
  
  <p>Any help would be appreciated!</p>