Conversion to output ranges

Pedro Lacerda pslacerda at gmail.com
Tue Feb 7 06:14:38 PST 2012


Maybe std.outbuffer...

    auto buffer = new OutBuffer();

    int a = 42;
    buffer.write(a);

    byte[] bytes = cast(byte[]) buffer.toBytes();
    ubyte[] ubytes = buffer.toBytes();


Pedro Lacerda



2012/2/7 Mafi <mafi at example.org>

> Hi,
> does anybody know how to bring std.conv.to or something similar to output
> into an output range?
>
> int a = 42;
> char[25] buffer;
> to!typeof(buffer[])(a, buffer[]);
>
> I want to send these texts throw sockets. Therefore I'd like to reuse the
> buffer.
>
> Mafi
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20120207/327a2651/attachment-0001.html>


More information about the Digitalmars-d-learn mailing list