src/linalg2.hpp: revert commit e4972f9bcde09143c020250b4de18e9e4666fac5

The C++03 standard forbids local types from being used as template
arguments.  See
http://stackoverflow.com/questions/742607/using-local-classes-with-stl-algorithms