$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [Boost-users] [Range] Generating a singular range.
From: Nathan Ridge (zeratul976_at_[hidden])
Date: 2011-12-14 13:12:20
> Hi All
>
> Is there an easy and obvious way to construct a single element range
> from a value_type of that range?
>
> Thx
>
> - Rob.
How about:
template <typename T>
boost::iterator_range<T*> singular(T& t)
{
return boost::make_iterator_range(&t, &t + 1);
}
Of course you'll want a const version as well.
Regards,
Nate