Patch for stl_vector.h and vector.tcc.

Felix Yen fwy@alumni.brown.edu
Mon Feb 16 11:24:00 GMT 2004


I wrote:
 >  This defect is not a regression [...]

Sorry, I was hallucinating when I wrote that.  It is a regression, so 
the patch is critical.  I'm trying to reproduce the problem now (and 
not having any success).

You wrote:
*  I need some help in the test case where [...]

I don't understand your question, but the performance tests use a hack 
that lets the compiler determine whether to insert an integer or a pair 
of them.  That's how we support std::map.  The trick involves defining 
a class like the following:

struct value_type : public pair<int, int>
{
   value_type()
   : pair<int, int>(0, 0)
   {}

   inline value_type operator++() {return ++first, *this;}
   inline operator int() const {return first;}
};

Then, you add to the container by calling insert, e.g.

value_type value;
pic->insert(pic->end(), ++value);


Felix



More information about the Libstdc++ mailing list