tail const

Simen kjaeraas simen.kjaras at gmail.com
Sat Dec 4 10:23:35 PST 2010


Simen kjaeraas <simen.kjaras at gmail.com> wrote:

> What might be appropriate is a function tailconst( T )( T t ) that
> returns a tail const version of the passed type. That is, given a
> T[], const(T[]), const(T)[], immutable(T[]), or immutable(T)[], it
> returns a const(T)[]. For a MyRange!R, const(MyRange!R), or
> immutable(MyRange!R), it returns a MyRange!(R).tailconst_t. See bottom
> of post for a (naïve) implementation.

To expound further on this, I have created the attached module.
Critique wanted.

-- 
Simen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tailconst.d
Type: application/octet-stream
Size: 5054 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20101204/dd01d0c3/attachment-0001.obj>


More information about the Digitalmars-d mailing list