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.
This is a libstdc++ bug, I've just created https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67374
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With