June 18, 2012 Primary Ranges of Containers | ||||
|---|---|---|---|---|
| ||||
Hi, last week I realized that a const version of std.container.Array.opSlice() is missing. Now I looked at the code and I think that it is a general design problem. The docs state that "c.Range" is "The primary range type associated with the container.". I think we really always need two Range types (one for const view and one for non-const view) by design. I'd propose to always add a bool template parameter (maybe isConst?) to the range since most of the write-functionality can be "removed" by a static if statement in order to make the range read-only. Any suggestions? Best regards, Matthias | ||||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply