On 27/08/15 21:48 +0200, Marc Glisse wrote:
On Thu, 27 Aug 2015, Jonathan Wakely wrote:

The std::cbegin function in <bits/range_access.h> can't call the
std::begin function in <valarray> unless it knows about it, so we need
to declare the valarray overloads in <bits/range_access.h>.

Hmm, do you remember why valarray has an ugly overload of std::begin instead of a nice member function begin like every other container ? It should at least be legal to implement it this way.

No, sorry, I have no idea.

C++11 added the begin non-members, and then C++14 added the
cbegin non-member, which calls std::begin.

I'm not convinced it's supposed to work with valarray, but it's
confusing that it doesn't when std::begin(const valarray<T>&) exists.


Reply via email to