|
Boost Users : |
Subject: Re: [Boost-users] [range] range metafunctions and reference types
From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2011-08-01 06:47:23
Den 30-07-2011 01:13, Nathan Ridge skrev:
>
> But now range_iterator gives an error as indicated above, so we have to do something
> awkward and verbose like this:
>
> template<typename Range>
>
> typename range_iterator<typename remove_reference<Range>::type>::type some_function(Range&& r) { ... }
>
> Could the range metafunctions be modified to accept range reference parameters and
> remove the reference themselves?
This is indeed annoying. I guess we could do the following for all
meta-functions:
template< class T >
struct meta<T&> : meta<T> {}
-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