www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/12/05/01:21:45

From: naisbodo <naisbodo AT enteract DOT com>
Newsgroups: comp.lang.c++,comp.os.msdos.djgpp
Subject: Re: STL broken?
Date: 5 Dec 2000 06:15:13 GMT
Organization: http://www.naisbodo.com/
Lines: 51
Message-ID: <90i15h$9d$1@bob.news.rcn.net>
References: <3A2C3ACD DOT 18F8C1D5 AT usq DOT edu DOT au> <zy_W5.44669$2A2 DOT 2187120 AT news20 DOT bellglobal DOT com> <3A2C8027 DOT 427A293D AT usq DOT edu DOT au>
X-Trace: EaUsmR62cCayDNYa8khHuy6+VwjT39szZF44kb14g+4=
X-Complaints-To: abuse AT rcn DOT com
NNTP-Posting-Date: 5 Dec 2000 06:15:13 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

In comp.os.msdos.djgpp Ron House <house AT usq DOT edu DOT au> wrote:
> 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.) 
> :-)

No, he didn't.

"For simplicity, I will rarely use the std:: prefix explicitly in
examples.  Neither will I always #include the necessary headers
explicitly.  To compile and run the program fragments here, you must
#include the appropriate headers (as listed in $3.7.5, $3.8.6, and
Chapter 16).  In addition, you must either use the std:: prefix or make
every name from std global ($8.2.3)." (p.47)

I strongly recommend you read chapters 2 and 3 twice before proceeding,
to make sure you've thoroughly digested everything at a general level.
It's an excellent book and well worth reading cover-to-cover.  

> 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:

I myself can make no sense whatsoever of gcc's error messages.  They
know their errors are cryptic and often even misleading, but they've
given a higher priority to getting correct code working than correctly
diagnosing broken code.

Please look at gcc's webpage and see if you should report this as a bug 
or not.

> 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.

What version of gcc are you using precisely?  I use 2.95.2 and have no
such problems.  Rather, I have the problem of incredibly long compile
times when I use templates of templates :-)

-- 
naisbodo AT enteract DOT com
http://www.naisbodo.com/

- Raw text -


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