mirror of
https://github.com/boostorg/utility.git
synced 2025-05-09 15:04:00 +00:00
Fixes for Sunpro C++ 5.3 (code now works!)
[SVN r11368]
This commit is contained in:
parent
633e45f61a
commit
628be0d125
@ -32,6 +32,10 @@
|
|||||||
namespace boost
|
namespace boost
|
||||||
{
|
{
|
||||||
|
|
||||||
|
template <class T1, class T2>
|
||||||
|
class compressed_pair;
|
||||||
|
|
||||||
|
|
||||||
// compressed_pair
|
// compressed_pair
|
||||||
|
|
||||||
namespace details
|
namespace details
|
||||||
@ -116,10 +120,10 @@ namespace details
|
|||||||
second_reference second() {return second_;}
|
second_reference second() {return second_;}
|
||||||
second_const_reference second() const {return second_;}
|
second_const_reference second() const {return second_;}
|
||||||
|
|
||||||
void swap(compressed_pair_imp<T1, T2, 0>& y)
|
void swap(::boost::compressed_pair<T1, T2>& y)
|
||||||
{
|
{
|
||||||
cp_swap(first_, y.first_);
|
cp_swap(first_, y.first());
|
||||||
cp_swap(second_, y.second_);
|
cp_swap(second_, y.second());
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
first_type first_;
|
first_type first_;
|
||||||
@ -147,10 +151,10 @@ namespace details
|
|||||||
compressed_pair_imp(first_param_type x, second_param_type y)
|
compressed_pair_imp(first_param_type x, second_param_type y)
|
||||||
: first_type(x), second_(y) {}
|
: first_type(x), second_(y) {}
|
||||||
|
|
||||||
explicit compressed_pair_imp(first_param_type x)
|
compressed_pair_imp(first_param_type x)
|
||||||
: first_type(x) {}
|
: first_type(x) {}
|
||||||
|
|
||||||
explicit compressed_pair_imp(second_param_type y)
|
compressed_pair_imp(second_param_type y)
|
||||||
: second_(y) {}
|
: second_(y) {}
|
||||||
|
|
||||||
first_reference first() {return *this;}
|
first_reference first() {return *this;}
|
||||||
@ -159,10 +163,10 @@ namespace details
|
|||||||
second_reference second() {return second_;}
|
second_reference second() {return second_;}
|
||||||
second_const_reference second() const {return second_;}
|
second_const_reference second() const {return second_;}
|
||||||
|
|
||||||
void swap(compressed_pair_imp& y)
|
void swap(::boost::compressed_pair<T1,T2>& y)
|
||||||
{
|
{
|
||||||
// no need to swap empty base class:
|
// no need to swap empty base class:
|
||||||
cp_swap(second_, y.second_);
|
cp_swap(second_, y.second());
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
second_type second_;
|
second_type second_;
|
||||||
@ -189,10 +193,10 @@ namespace details
|
|||||||
compressed_pair_imp(first_param_type x, second_param_type y)
|
compressed_pair_imp(first_param_type x, second_param_type y)
|
||||||
: second_type(y), first_(x) {}
|
: second_type(y), first_(x) {}
|
||||||
|
|
||||||
explicit compressed_pair_imp(first_param_type x)
|
compressed_pair_imp(first_param_type x)
|
||||||
: first_(x) {}
|
: first_(x) {}
|
||||||
|
|
||||||
explicit compressed_pair_imp(second_param_type y)
|
compressed_pair_imp(second_param_type y)
|
||||||
: second_type(y) {}
|
: second_type(y) {}
|
||||||
|
|
||||||
first_reference first() {return first_;}
|
first_reference first() {return first_;}
|
||||||
@ -201,10 +205,10 @@ namespace details
|
|||||||
second_reference second() {return *this;}
|
second_reference second() {return *this;}
|
||||||
second_const_reference second() const {return *this;}
|
second_const_reference second() const {return *this;}
|
||||||
|
|
||||||
void swap(compressed_pair_imp& y)
|
void swap(::boost::compressed_pair<T1,T2>& y)
|
||||||
{
|
{
|
||||||
// no need to swap empty base class:
|
// no need to swap empty base class:
|
||||||
cp_swap(first_, y.first_);
|
cp_swap(first_, y.first());
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -233,10 +237,10 @@ namespace details
|
|||||||
compressed_pair_imp(first_param_type x, second_param_type y)
|
compressed_pair_imp(first_param_type x, second_param_type y)
|
||||||
: first_type(x), second_type(y) {}
|
: first_type(x), second_type(y) {}
|
||||||
|
|
||||||
explicit compressed_pair_imp(first_param_type x)
|
compressed_pair_imp(first_param_type x)
|
||||||
: first_type(x) {}
|
: first_type(x) {}
|
||||||
|
|
||||||
explicit compressed_pair_imp(second_param_type y)
|
compressed_pair_imp(second_param_type y)
|
||||||
: second_type(y) {}
|
: second_type(y) {}
|
||||||
|
|
||||||
first_reference first() {return *this;}
|
first_reference first() {return *this;}
|
||||||
@ -246,7 +250,7 @@ namespace details
|
|||||||
second_const_reference second() const {return *this;}
|
second_const_reference second() const {return *this;}
|
||||||
//
|
//
|
||||||
// no need to swap empty bases:
|
// no need to swap empty bases:
|
||||||
void swap(compressed_pair_imp&) {}
|
void swap(::boost::compressed_pair<T1,T2>&) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
// JM
|
// JM
|
||||||
@ -272,7 +276,7 @@ namespace details
|
|||||||
compressed_pair_imp(first_param_type x, second_param_type)
|
compressed_pair_imp(first_param_type x, second_param_type)
|
||||||
: first_type(x) {}
|
: first_type(x) {}
|
||||||
|
|
||||||
explicit compressed_pair_imp(first_param_type x)
|
compressed_pair_imp(first_param_type x)
|
||||||
: first_type(x) {}
|
: first_type(x) {}
|
||||||
|
|
||||||
first_reference first() {return *this;}
|
first_reference first() {return *this;}
|
||||||
@ -281,7 +285,7 @@ namespace details
|
|||||||
second_reference second() {return *this;}
|
second_reference second() {return *this;}
|
||||||
second_const_reference second() const {return *this;}
|
second_const_reference second() const {return *this;}
|
||||||
|
|
||||||
void swap(compressed_pair_imp&) {}
|
void swap(::boost::compressed_pair<T1,T2>&) {}
|
||||||
private:
|
private:
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -305,7 +309,7 @@ namespace details
|
|||||||
compressed_pair_imp(first_param_type x, second_param_type y)
|
compressed_pair_imp(first_param_type x, second_param_type y)
|
||||||
: first_(x), second_(y) {}
|
: first_(x), second_(y) {}
|
||||||
|
|
||||||
explicit compressed_pair_imp(first_param_type x)
|
compressed_pair_imp(first_param_type x)
|
||||||
: first_(x), second_(x) {}
|
: first_(x), second_(x) {}
|
||||||
|
|
||||||
first_reference first() {return first_;}
|
first_reference first() {return first_;}
|
||||||
@ -314,10 +318,10 @@ namespace details
|
|||||||
second_reference second() {return second_;}
|
second_reference second() {return second_;}
|
||||||
second_const_reference second() const {return second_;}
|
second_const_reference second() const {return second_;}
|
||||||
|
|
||||||
void swap(compressed_pair_imp<T1, T2, 5>& y)
|
void swap(::boost::compressed_pair<T1, T2>& y)
|
||||||
{
|
{
|
||||||
cp_swap(first_, y.first_);
|
cp_swap(first_, y.first());
|
||||||
cp_swap(second_, y.second_);
|
cp_swap(second_, y.second());
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
first_type first_;
|
first_type first_;
|
||||||
@ -365,7 +369,7 @@ public:
|
|||||||
second_reference second() {return base::second();}
|
second_reference second() {return base::second();}
|
||||||
second_const_reference second() const {return base::second();}
|
second_const_reference second() const {return base::second();}
|
||||||
|
|
||||||
void swap(compressed_pair& y) { base::swap(static_cast<base&>(y)); }
|
void swap(compressed_pair& y) { base::swap(y); }
|
||||||
};
|
};
|
||||||
|
|
||||||
// JM
|
// JM
|
||||||
@ -401,7 +405,10 @@ public:
|
|||||||
|
|
||||||
compressed_pair() : base() {}
|
compressed_pair() : base() {}
|
||||||
compressed_pair(first_param_type x, second_param_type y) : base(x, y) {}
|
compressed_pair(first_param_type x, second_param_type y) : base(x, y) {}
|
||||||
explicit compressed_pair(first_param_type x) : base(x) {}
|
#if !(defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x530))
|
||||||
|
explicit
|
||||||
|
#endif
|
||||||
|
compressed_pair(first_param_type x) : base(x) {}
|
||||||
|
|
||||||
first_reference first() {return base::first();}
|
first_reference first() {return base::first();}
|
||||||
first_const_reference first() const {return base::first();}
|
first_const_reference first() const {return base::first();}
|
||||||
@ -409,7 +416,7 @@ public:
|
|||||||
second_reference second() {return base::second();}
|
second_reference second() {return base::second();}
|
||||||
second_const_reference second() const {return base::second();}
|
second_const_reference second() const {return base::second();}
|
||||||
|
|
||||||
void swap(compressed_pair& y) { base::swap(y); }
|
void swap(::boost::compressed_pair<T,T>& y) { base::swap(y); }
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class T1, class T2>
|
template <class T1, class T2>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user