use of 'typename' outside of template (even in template specialization) is disallowed.
a class-key must be used when declaring a friend.