std.array.array seems to return flatten copy of input

bearophile bearophileHUGS at lycos.com
Fri Apr 4 13:44:34 PDT 2014


Olivier Grant:

> Is there any way to hide Splicer.array to the outside world?

If your splice is inside another module, and you tag the array 
field with private, you will receive an error:


auto splice( size_t N, R )( R range )
    if(isInputRange!R)
{
    struct Splicer
    {
       private R array;


This avoids your mistake, but also forbids you to use the 
std.array.array on a splice with UFCS. Is this acceptable for you?

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list