On Friday, 17 October 2014 at 14:01:46 UTC, Ola Fosheim Grøstad
wrote:
On Friday, 17 October 2014 at 13:27:37 UTC, eles wrote:
(gcc does not yet support std::cbegin() and std::cend()).
(tested :^)
Thanks ;)
Like your new version, but I don't think it will work with
regular arrays and maybe the accumulator will overflow
Just replace static_cast<typename T::value_type> with
static_cast<U>, U being a second template argument that defaults
to T::value_type. Then, you can control the size of the result,
but you need to explicitely instantiate the templae with types.
A more general and pleasant solution would be to use D ;)