Boost logo

Boost :

From: Dave Abrahams (abrahams_at_[hidden])
Date: 2000-12-20 17:21:52


I have a patch. Use of compressed_pair in the graph library has been
failing completely for me with MSVC as of the latest boost release.
Obviously, we need better testing procedures. I know /I/ don't check
the boost regression test output to see if I've broken something
every time I check something in to CVS.

The patch follows. I'll happily check it into CVS, but I thought
everyone should get a chance to look it over first:

--- ob_compressed_pair.old.hpp Wed Dec 20 17:14:00 2000
+++ ob_compressed_pair.hpp Wed Dec 20 17:00:28 2000
@@ -104,6 +104,8 @@
    {
       init_one<best_convertion_traits<A, T1, T2>::value>::init(val,
&_first, &_second);
    }
+ compressed_pair_0(const compressed_pair_0<T1,T2>& x)
+ : _first(x._first), _second(x._second) {}
 
    first_reference first() { return _first; }
    first_const_reference first() const { return _first; }
@@ -142,6 +144,8 @@
    {
       init_one<best_convertion_traits<A, T1, T2>::value>::init(val,
&_first, static_cast<T2*>(this));
    }
+ compressed_pair_1(const compressed_pair_1<T1,T2>& x)
+ : T2(x), _first(x._first) {}
 
    first_reference first() { return _first; }
    first_const_reference first() const { return _first; }
@@ -180,6 +184,8 @@
    {
       init_one<best_convertion_traits<A, T1, T2>::value>::init(val,
static_cast<T1*>(this), &_second);
    }
+ compressed_pair_2(const compressed_pair_2<T1,T2>& x)
+ : T1(x), _second(x._second) {}
 
    first_reference first() { return *this; }
    first_const_reference first() const { return *this; }
@@ -216,6 +222,8 @@
    {
       init_one<best_convertion_traits<A, T1, T2>::value>::init(val,
static_cast<T1*>(this), static_cast<T2*>(this));
    }
+ compressed_pair_3(const compressed_pair_3<T1,T2>& x)
+ : T1(x), T2(x) {}
 
    first_reference first() { return *this; }
    first_const_reference first() const { return *this; }
@@ -387,7 +395,9 @@
             compressed_pair(first_param_type x, second_param_type
y) : base_type(x, y) {}
    template <class A>
    explicit compressed_pair(const A& x) : base_type(x){}
-
+ compressed_pair(const compressed_pair<T1,T2>& x)
+ : base_type(static_cast<const base_type&>(x)) {}
+
    first_reference first() { return base_type::first(); }
    first_const_reference first() const { return base_type::first(); }
 


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk