Mail Archives: djgpp/2000/12/05/00:56:47
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 -