stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Dean <>
Subject problem with map class and forward class declaration
Date Mon, 24 Oct 2005 20:46:31 GMT
The following test case fails to compile:
#include <map>
class A;  //forward class declaration
std::map<int, A> A_Map;
class A
    int a;
int main() { return 0; }
The following error occurs:
"./../../../include/rw/_pair.h", line 67: Error: The type "A" is incomplete.
"./../../../include/rw/_tree.h", line 98:     Where: While specializing
ir<const int, A>".
"./../../../include/rw/_tree.h", line 98:     Where: Specialized in
b_tree_node<std::allocator<std::pair<const int, A>>, std::pair<const int,
A>, in
t, __rw::__select1st<std::pair<const int, A>, int>>.
"./../../../include/rw/_tree.h", line 271:     Where: Specialized in
tree<int, std::pair<const int, A>, __rw::__select1st<std::pair<const int,
A>, in
t>, std::less<int>, std::allocator<std::pair<const int, A>>>.
"./../../../include/map", line 98:     Where: Specialized in std::map<int,
A, st
d::less<int>, std::allocator<std::pair<const int, A>>>.
"../st1.cpp", line 5:     Where: Specialized in non-template code.
1 Error(s) detected.
*** Error code 1
make: Fatal error: Command failed for target `st1.o'
Jeremy Dean 

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message