Boost logo

Boost Users :

From: MB (mb2act_at_[hidden])
Date: 2006-01-16 13:44:51

Thorsten Ottosen wrote:
> MB wrote:
>>Sebastian Redl wrote:
>>I think 'add_const' is reserved for Boost.TypeTraits.
>>I post this tiny proposal to Boost.Devel anyway.
> When we discussed the wg21 proposal many months ago and I added
> const_begin() etc to boost.range, Dave Abrahams used this function
> template< class T >
> inline T const& as_const( T const& r )
> { return r; }

I found the thread.
Maybe the time has come? :-)
A range algorithm like Boost.StringAlgorithm
no longer allows users to call 'const_begin/end'.
Now that something like 'as_const' is really needed.

       rng |
         const_qualified | // protect rng!
         reversed |
         null_terminated |
         tab_expanded |
         utf8_decoded |

I think 'const_rbegin' is obviously blob ;-)

> Similarly, we might add
> as_volatile();
> as_const_volatile();
> as_mutable();
> The latter would be a cast from rvalue to lvalue like it happens in
> boost.foreach.

Beyond my sight. Is it possible such conversion?


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at