Docs for `Group` type

Mike Parker via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jul 12 01:31:11 PDT 2016


On Tuesday, 12 July 2016 at 08:03:53 UTC, Bahman Movaqar wrote:
> On 07/12/2016 11:06 AM, Mike Parker wrote:
>> The 'Group' type is an implementation detail -- a type used 
>> internally -- that you aren't supposed to care about. All you 
>> need to care about is that it's a range. The documentation for 
>> chunkBy [1] explains what the return type is.
>> 
>> [1] 
>> https://dlang.org/phobos/std_algorithm_iteration.html#.chunkBy
>
> Thanks.  Now since I can't do `takeOne` on `Group`[1], exactly 
> what kind of range is `Group`?
>
> [1] Error: no property 'takeOne' for type 'Group'

When you downloaded DMD, you also received the source to Phobos, 
so you can see for yourself. The only Group type I see the 
chunkBy implementations is at [1] (the link to the github viewer 
probably won't point to the same place for long, but you should 
be looking in the the version of ChunkByImpl for forward ranges). 
It's a forward range.

Do you have some sample code that shows the error?

[1] 
https://github.com/dlang/phobos/blob/master/std/algorithm/iteration.d#L1608


More information about the Digitalmars-d-learn mailing list