Log Message: Fix permissive C++ for GCC 3.4+: - move an inline constructor outside of the class, since the friend is not fully declared yet. - template references. - missing include to get full declaration of a class.