C++ Ranges proposal for the Standard Library

eles via Digitalmars-d digitalmars-d at puremagic.com
Fri Oct 17 12:09:58 PDT 2014


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 ;)


More information about the Digitalmars-d mailing list