title: Is there a "generic" iterator type to be used in C++ for function parameters?
body: <p>I have a C++ class that contains a <code>std::list</code> as member. Now I want to add a method that can be used to insert values of another container into that list. Something like this:</p>
  
  <pre><code>template&lt;class factType&gt;
  class BeliefSet
  {
      std::list&lt;factType&gt; m_List;
      void SetFacts(??? IterBegin, ??? IterEnd)
      {
          m_List.insert(m_List.end(), IterBegin, IterEnd);
      }
  };
  </code></pre>
  
  <p>Now my question is: What do I have to replace <code>???</code> with, so that it can take the iterator of any (or at least most common) <code>std</code> containers, like <code>list</code>, <code>vector</code>, etc.? I tried it with <code>std::iterator&lt;std::input_iterator_tag, factType&gt;</code>, but that didn't seem to work.</p>
  
  <p>Note that this should also work with a copy constructor, like this:</p>
  
  <pre><code>const std::list&lt;factType&gt;&amp; GetFacts() const
  {
      return m_List;
  }
  
  // Copy constructor.
  explicit BeliefSet(const BeliefSet&amp; Other)
  {
      auto facts = Other.GetFacts();
      SetFacts(facts.begin(), facts.end());
  }
  </code></pre>