Fixes for various compilers from John Maddock

[SVN r7629]
This commit is contained in:
Beman Dawes
2000-07-24 17:59:52 +00:00
parent 06adfe9658
commit a005f03cc2
5 changed files with 417 additions and 283 deletions
+40 -2
View File
@@ -6,6 +6,13 @@
// See http://www.boost.org for most recent version including documentation.
/* Release notes:
23rd July 2000:
Fixed array specialization. (JM)
Added Borland specific fixes for reference types
(issue raised by Steve Cleary).
*/
#ifndef BOOST_DETAIL_CALL_TRAITS_HPP
#define BOOST_DETAIL_CALL_TRAITS_HPP
@@ -66,6 +73,37 @@ struct call_traits<T&>
typedef T& param_type; // hh removed const
};
#if defined(__BORLANDC__) && (__BORLANDC__ <= 0x550)
// these are illegal specialisations; cv-qualifies applied to
// references have no effect according to [8.3.2p1],
// C++ Builder requires them though as it treats cv-qualified
// references as distinct types...
template <typename T>
struct call_traits<T&const>
{
typedef T& value_type;
typedef T& reference;
typedef const T& const_reference;
typedef T& param_type; // hh removed const
};
template <typename T>
struct call_traits<T&volatile>
{
typedef T& value_type;
typedef T& reference;
typedef const T& const_reference;
typedef T& param_type; // hh removed const
};
template <typename T>
struct call_traits<T&const volatile>
{
typedef T& value_type;
typedef T& reference;
typedef const T& const_reference;
typedef T& param_type; // hh removed const
};
#endif
template <typename T, std::size_t N>
struct call_traits<T [N]>
{
@@ -76,7 +114,7 @@ public:
typedef const T* value_type;
typedef array_type& reference;
typedef const array_type& const_reference;
typedef const T* param_type;
typedef const T* const param_type;
};
template <typename T, std::size_t N>
@@ -89,7 +127,7 @@ public:
typedef const T* value_type;
typedef array_type& reference;
typedef const array_type& const_reference;
typedef const T* param_type;
typedef const T* const param_type;
};
}
+10 -2
View File
@@ -6,7 +6,14 @@
// See http://www.boost.org for most recent version including documentation.
//
// this version crippled for use with crippled compilers - John Maddock Jan 2000.
/* Release notes:
23rd July 2000:
Additional comments added. (JM)
Jan 2000:
Original version: this version crippled for use with crippled compilers
- John Maddock Jan 2000.
*/
#ifndef BOOST_OB_COMPRESSED_PAIR_HPP
#define BOOST_OB_COMPRESSED_PAIR_HPP
@@ -41,7 +48,8 @@ public:
compressed_pair() : _first(), _second() {}
compressed_pair(first_param_type x, second_param_type y) : _first(x), _second(y) {}
explicit compressed_pair(first_param_type x) : _first(x), _second() {}
//explicit compressed_pair(second_param_type y) : _first(), _second(y) {}
// can't define this in case T1 == T2:
// explicit compressed_pair(second_param_type y) : _first(), _second(y) {}
first_reference first() { return _first; }
first_const_reference first() const { return _first; }