Boost logo

Boost Users :

From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2008-07-14 05:48:38


Mathias Gaunard skrev:
> Is there an utility within Boost.Range (or Range_ex) that allows making
> a range of Ts from a single T?

No.

> It seems quite useful and practical.
> Basically a std::make_pair(&foo, &foo+1) works but requires foo to be an
> lvalue.

I guess this would require yuo to define a custom iterator type
thatholds an object by boost::optional<T> where the empty optional
denote the end of the iterator.

I'd be happy to include a function like make_single_element_range() if
you implement it and send it to the dev list.

-Thorsten


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net