At a very very quick glance, the one-liner if statements without curly braces is killing me. Definition of the variables at the start of the functions (eg. int i) makes me think this is an old C developer.<p>Needs more use of obtuse STL and difficult-to-read use of modern C++ template and decltype stuff to be true C++! More use of tuple and std::get<> is needed.<p>It's probably really fast though.