delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/12/05/00:56:47

From: Ron House <house AT usq DOT edu DOT au>
Newsgroups: comp.lang.c++,comp.os.msdos.djgpp
Subject: Re: STL broken?
Date: Tue, 05 Dec 2000 05:41:59 +0000
Organization: University of Queensland
Lines: 54
Message-ID: <3A2C8027.427A293D@usq.edu.au>
References: <3A2C3ACD DOT 18F8C1D5 AT usq DOT edu DOT au> <zy_W5.44669$2A2 DOT 2187120 AT news20 DOT bellglobal DOT com>
NNTP-Posting-Host: heracles.usq.edu.au
Mime-Version: 1.0
X-Trace: bunyip.cc.uq.edu.au 975994895 24612 139.86.208.29 (5 Dec 2000 05:41:35 GMT)
X-Complaints-To: news AT uq DOT edu DOT au
NNTP-Posting-Date: 5 Dec 2000 05:41:35 GMT
X-Mailer: Mozilla 3.04 (X11; I; Linux 2.0.36 i586)
X-Original-NNTP-Posting-Host: 139.86.23.17
X-Original-Trace: 5 Dec 2000 15:41:19 +1000, 139.86.23.17
X-Abuse: abuse AT usq DOT edu DOT au
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Bart Kowalski wrote:
> 
> > An example of a line it won't compile is:
> >
> > vector<vector<int> > m;
> >
> > as found on page 836 of Stroustrup.
> 
> You forgot the namespace qualifier. See chapter 8 of the same book.

Oops! So did Stroustrup. (See all examples of the STL between pp1-900.) 
:-)

Seriously, no, that doesn't fix it. Besides, the error is not a simple
undeclared identifier, but a series of messages referring to lines deep
in the STL code:

d:/djgpp/lang/cxx/concept_checks.h: In function `static void
_Assignable_concept_specification<vector<int *,allocator<int *> >
>::_Assignable_requirement_violat
ion(vector<int *,allocator<int *> >)':
d:/djgpp/lang/cxx/stl_vector.h:159:   instantiated from
`vector<vector<int *,allocator<int *> >,allocator<vector<int
*,allocator<int *> > > >'
t.cpp:3:   instantiated from here
d:/djgpp/lang/cxx/concept_checks.h:530: use of parameter from containing
function
d:/djgpp/lang/cxx/concept_checks.h:389:   `int * __a' declared here
d:/djgpp/lang/cxx/concept_checks.h:531: use of parameter from containing
function
d:/djgpp/lang/cxx/concept_checks.h:389:   `int * __a' declared here
d:/djgpp/lang/cxx/concept_checks.h:532: use of parameter from containing
function
d:/djgpp/lang/cxx/concept_checks.h:389:   `int * __a' declared here
d:/djgpp/lang/cxx/concept_checks.h:532: use of parameter from containing
function
d:/djgpp/lang/cxx/concept_checks.h:389:   `int * __a' declared here
d:/djgpp/lang/cxx/concept_checks.h:533: use of parameter from containing
function
d:/djgpp/lang/cxx/concept_checks.h:389:   `int * __a' declared here
d:/djgpp/lang/cxx/concept_checks.h:533: use of parameter from containing
function
d:/djgpp/lang/cxx/concept_checks.h:389:   `int * __a' declared here

Adding or removing "std::", or inserting "using namespace std" changes
the error not one iota. As far as I can tell, any declaration of the
form: "a<b<c> > d;", where a and b are STL containers, fails to compile
no matter what you do with namespaces.

-- 
Ron House     house AT usq DOT edu DOT au
              http://www.sci.usq.edu.au/staff/house

A rose grows in the Earth's good soil.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019