how does range.put work

O.K. oliverkania at googlemail.com
Fri Aug 7 00:58:56 PDT 2009


Good point ! Use the [S/F]o[u]rce !
Thx, Oliver

> O.K. wrote:
> > Hello,
> > could someone plz clearify what the exact semantics of "put"
> > are ?
> > Put works with an appender, but gives me a runtime exception
> > when using an array.
> >
> > Best regards,
> > Oliver
> The source code for the standard library comes with the compiler.
> If you look in std\array.d, you find this around line 279 (reflowed for
> readability):
> > void put(T, E)(ref T[] a, E e) {
> >     assert(a.length);
> >     a[0] = e; a = a[1 .. $];
> > }



More information about the Digitalmars-d-learn mailing list