Question on interview: diameter of binary tree.

I got a task on interview to calculate diameter of given binary tree. While I don’t like to solve abstract problems ( I have a lot of problems to solve in my projects already) I’ve found this one particularly interesting as it actually has practical value in one of algorithms on DOM tree (that is…

boost.coroutine vs my $generator.

Today I saw discussion about boost.coroutine on gmane: Generators and coroutines are conceptually the same feature and I have implementation of $generator thing that can be used to implement coroutines. My implementation is of 15 lines of code and does not require any threads/fibers and so context switches – pure C++ with macro magic, pretty…