title: How to limit boost::combine to the minimum of two ranges
body: <p>Finding the following as the source of a segfault just cost me about 4h of work:</p>
  
  <pre><code>#include &lt;boost/range/combine.hpp&gt;
  #include &lt;boost/foreach.hpp&gt;
  #include &lt;iostream&gt;
  #include &lt;vector&gt;
  #include &lt;list&gt;
  
  int main(int, const char*[])
  {
      std::vector&lt;int&gt; v;
      std::list&lt;char&gt; l;
      for (int i = 0; i &lt; 5; ++i)
      {
          v.push_back(i);
          l.push_back(static_cast&lt;char&gt;(i) + 'a');
      }
  
      v.push_back(5);
  
      int ti;
      char tc;
      BOOST_FOREACH(boost::tie(ti, tc), boost::combine(v, l))
      {
          std::cout &lt;&lt; '(' &lt;&lt; ti &lt;&lt; ',' &lt;&lt; tc &lt;&lt; ')' &lt;&lt; '\n';
      }
  
      return 0;
  }
  </code></pre>
  
  <p>If you execute this example, you will note that combine happily iterates as long as the longer range has values. I do not see this in the <a href="https://www.boost.org/doc/libs/1_70_0/libs/range/doc/html/range/reference/utilities/combine.html" rel="nofollow noreferrer">documentation</a>. </p>
  
  <p>Is there a way to limit the iteration to the shorter of the two ranges?</p>