Re: A strange problem about vector~
lfeiman888@gmail.com wrote:
Thanks All,I modified
D:\STLport\stlport\stl/type_traits.h
To replace an error message in the case of undefined behavior
with something else. I'd consider that a step backwards;
STLPort was right, and your code was wrong.
then my code
class A
{
public:
typedef vector<A> List;
typedef List::iterator Iter;
};
compiles good....
Not with g++. Probably not with a lot more compilers as time
goes on. Most compiler writers and library implementers like to
give an error message for undefined behavior, when they
reasonably can, and the techniques necessary to do this here are
becoming widely known. (I'm not sure, but I wouldn't even be
surprized if the next version of the standard required them.)
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orientie objet/
Beratung in objektorientierter Datenverarbeitung
9 place Simard, 78210 St.-Cyr-l'Icole, France, +33 (0)1 30 23 00 34
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]