$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-users] [range] What's the best way to initialize a new container from a range?
From: Martin B. (0xCDCDCDCD_at_[hidden])
Date: 2011-08-26 08:30:42
Hi!
Say I have a range R and I want to construct a new container from the
range R. Will I always have to repeat the expression yielding the range,
or is there a shorter way?
Example:
std::vector<int> numbers(
boost::irange(7, 42).begin(),
boost::irange(7, 42).end()
);
Note that it's just an example.
Is it possible to create a container C from a range expression R in one
step? Any helper function for this?
cheers,
Martin