This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Errors when typdef'ing hash_map::iterator
- From: "Jonathan Wakely" <jwakely dot gcc at gmail dot com>
- To: "Matt Fischer" <mattfischer84 at gmail dot com>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Wed, 18 Apr 2007 14:47:46 +0100
- Subject: Re: Errors when typdef'ing hash_map::iterator
- References: <be62573b0704161325k650bc3e4p38232fdf69799746@mail.gmail.com> <be62573b0704161330t7a8c99fbm1fd7b3f1f07766de@mail.gmail.com>
On 16/04/07, Matt Fischer <mattfischer84@gmail.com> wrote:
Hi all. I've run into a problem using the hash_map extension class in
libstdc++, and I'm evidently not well-versed enough in templates to
determine what the root cause is. Essentially the problem I'm seeing
arises when I attempt to make a typedef of a hash_map iterator which
references a forward-declared class.
That's not allowed when Foo is not complete, and neither is the
map<int, Foo> (but it doesn't fail unless you turn on concept-checks
with -D_GLIBCXX_CONCEPT_CHECKS)
Unless explicitly stated otherwise (as with e.g. std::tr1::shared_ptr)
all types used as template arguments to templates in the standard
library must be complete. Although hash_map isn't in the standard it
seems to have the same requirement, and so fails with the error you're
seeing.
Jon