incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <se...@roguewave.com>
Subject Re: problem with map class and forward class declaration
Date Mon, 24 Oct 2005 21:38:10 GMT
Jeremy Dean wrote:
> The following test case fails to compile:
>  
> #include <map>
>  
> class A;  //forward class declaration
>  
> std::map<int, A> A_Map;

A is an incomplete type.

According to Table 69, Associative container requirements, key_type
must meet the Assignable requirement.

AFAIK, incomplete types do not meet the Assignability requirement
and thus may not be used in associative containers.

There was a discussion about relaxing some of these requirements
on comp.std.c++ last year but I'm not sure what (if anything)
happened to the proposal (I don't see it among any of the 2004
or 2005 papers):
http://groups.google.com/group/comp.std.c++/browse_thread/thread/85acdb7b78f0d2e5/5e651eb007ac865d

Martin

Mime
View raw message