пятница, 7 марта 2008 г.

Too much std and boost...
Как думаете, что делает этот код?

int line = 3;
ifstream f("somefile.txt");
string s;
while_loop(_3 != EOF, switch_statement(
_3 = bind
(&ifstream::get, _1),
case_statement<(ifstream::char_type)EOF>(),
case_statement<'\n'>(if_then(++_2 > line,
_3 = EOF)),
default_statement(if_then(_2 == line,
bind(&string::push_back, &s, _3)))
)) (f, *auto_ptr(new int(1)).get(),
*auto_ptr(
new ifstream::char_type(0)).get());
cout << s << endl;

Комментариев нет: