[ create a new paste ] login | about

Link: http://codepad.org/S8QeJZ1x    [ raw code | output | fork ]

C++, pasted on Jan 26:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <iostream>

class Report {
public:
    Report& operator<<(const char *text) {
        std::cout << text << std::flush;
        return *this;
    }
};

int main() {
    Report r;
    r << "hello world\n" << "foo " << "bar";
    return 0;
}


Output:
1
2
hello world
foo bar


Create a new paste based on this one


Comments: