<div class="gmail_quote">Hi Martin,</div><div class="gmail_quote"><br></div><div class="gmail_quote">On 29 August 2011 13:15, Martin B. <span dir="ltr">&lt;<a href="mailto:0xCDCDCDCD@gmx.at">0xCDCDCDCD@gmx.at</a>&gt;</span> wrote:</div>

<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On 26.08.2011 20:21, Ovanes Markarian wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
On Fri, Aug 26, 2011 at 2:30 PM, Martin B. &lt;<a href="mailto:0xCDCDCDCD@gmx.at" target="_blank">0xCDCDCDCD@gmx.at</a><br></div><div class="im">
&lt;mailto:<a href="mailto:0xCDCDCDCD@gmx.at" target="_blank">0xCDCDCDCD@gmx.at</a>&gt;&gt; wrote:<br><br>
 � �Say I have a range R and I want to construct a new container from<br>
 � �the range R. Will I always have to repeat the expression yielding<br>
 � �the range, or is there a shorter way?<br>
<br>
 � �Example:<br>
<br>
 � � � �std::vector&lt;int&gt; numbers(<br>
 � � � � �boost::irange(7, 42).begin(),<br>
 � � � � �boost::irange(7, 42).end()<br>
 � � � �);<br>

<br>
What about that:<br></div>
...<div class="im"><br>
integer_range&lt;int&gt; ir=irange(7,42);<br>
vector&lt;int&gt; numbers(ir.begin(), ir.end());<br>
<br>
</div></blockquote>
<br>
For this to work I need the exact type of the range, which can be quite annoying as far as I could tell. (Plus, I *don&#39;t want* to care what type of the range is.)<br>
<br>
Really, if I had C++11/auto, I wouldn&#39;t mind so much, i.e.<br>
<br>
 � �auto xr = get_some_range(...);<br>
 � �vector&lt;int&gt; numbers(xr.begin(), xr.end());<br>
<br>
but I don&#39;t have an `auto` capable compiler, so spelling out the range type for this is really crappy.<br></blockquote><div><br></div><div>If you don&#39;t care about the type of range, you could always try:</div><div>

<br></div><div>BOOST_AUTO( xr, get_some_range(...) );</div><div>vector&lt;int&gt; numbers( xr.begin(), xr.end() );�</div><div><br></div><div><a href="http://www.boost.org/doc/libs/1_47_0/doc/html/typeof/refe.html#typeof.auto">http://www.boost.org/doc/libs/1_47_0/doc/html/typeof/refe.html#typeof.auto</a></div>

<div><br></div><div>Cheers,</div><div>Darren</div></div>