On Tuesday, 29 January 2013 at 08:05:25 UTC, eles wrote:
On Tuesday, 29 January 2013 at 01:24:45 UTC, Chad Joan wrote:
On 01/28/2013 08:09 PM, F i L wrote:
why in the hell would you want:

writeln = "lolwut";

But it does right now ;)

Joking here, but what about renaming writeln into cout and overloading the <<?

Great idea :)

import std.stdio;
struct COut {
    COut opBinary(string op, T)(T other) if(op == "<<") {
            write(other);
            return this;
    }
}

@property COut cout() {
    return COut();
}

void main() {
    cout << "cout" << " " << "rocks" << "\n";
}

Reply via email to