Please consider the following code:
using custom_t = std::valarray<unsigned>;
custom_t o;
unsigned acc = std::accumulate(std::cbegin(o), std::cend(o), 0);
g++-5 says
No matching function for call to
cbegin(custom_t&)
If I use std::begin(o)
and std::end(o)
instead, everything works. Is this a compiler bug? The code compiles with Visual Studio 2015.