http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52942
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-04-12 08:46:04 UTC --- The solution would be to follow the same pattern as the other containers: template<typename A, typename B> struct Cont { struct Impl : B { A* data; }; Impl impl; }; instead the hash tables are more like: template<typename A, typename B> struct Impl : A, B { }; template<typename A, typename B> struct Cont : Impl<A, B> { }; which means Cont inherits all the members of A and B (including typedefs and potentially virtual functions)