Spirit miniboost update.

[SVN r30504]
This commit is contained in:
Hartmut Kaiser
2005-08-08 02:18:32 +00:00
parent add09d4ffe
commit a8ce91002b
4 changed files with 32 additions and 13 deletions

View File

@@ -32,6 +32,6 @@ void assertion_failed(char const * expr, char const * function, char const * fil
#define BOOST_ASSERT(expr) ((expr)? ((void)0): ::boost::assertion_failed(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))
#else
# include <assert.h>
# include <assert.h> // .h to support old libraries w/o <cassert> - effect is the same
# define BOOST_ASSERT(expr) assert(expr)
#endif

View File

@@ -25,6 +25,7 @@
#include <boost/type_traits/is_arithmetic.hpp>
#include <boost/type_traits/is_pointer.hpp>
#include <boost/detail/workaround.hpp>
namespace boost{
@@ -91,7 +92,7 @@ struct call_traits<T&>
typedef T& param_type; // hh removed const
};
#if defined(__BORLANDC__) && (__BORLANDC__ <= 0x560)
#if BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT( 0x570 ) )
// 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

View File

@@ -132,7 +132,7 @@ namespace details
template <class T1, class T2>
class compressed_pair_imp<T1, T2, 1>
: private T1
: private ::boost::remove_cv<T1>::type
{
public:
typedef T1 first_type;
@@ -174,7 +174,7 @@ namespace details
template <class T1, class T2>
class compressed_pair_imp<T1, T2, 2>
: private T2
: private ::boost::remove_cv<T2>::type
{
public:
typedef T1 first_type;
@@ -217,8 +217,8 @@ namespace details
template <class T1, class T2>
class compressed_pair_imp<T1, T2, 3>
: private T1,
private T2
: private ::boost::remove_cv<T1>::type,
private ::boost::remove_cv<T2>::type
{
public:
typedef T1 first_type;
@@ -257,7 +257,7 @@ namespace details
// but reuses T1 base class for both first() and second().
template <class T1, class T2>
class compressed_pair_imp<T1, T2, 4>
: private T1
: private ::boost::remove_cv<T1>::type
{
public:
typedef T1 first_type;
@@ -430,5 +430,3 @@ swap(compressed_pair<T1, T2>& x, compressed_pair<T1, T2>& y)
#endif // BOOST_DETAIL_COMPRESSED_PAIR_HPP

View File

@@ -13,9 +13,6 @@
# include <boost/config.hpp>
# include <boost/detail/workaround.hpp>
# if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
# include <boost/type_traits/add_pointer.hpp>
# endif
namespace boost {
@@ -23,7 +20,14 @@ namespace boost {
// VC7 strips const from nested classes unless we add indirection here
# if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
template <typename T> typename add_pointer<T>::type
template<class T> struct _addp
{
typedef T * type;
};
template <typename T> typename _addp<T>::type
# else
template <typename T> T*
# endif
@@ -33,6 +37,22 @@ addressof(T& v)
&const_cast<char&>(reinterpret_cast<const volatile char &>(v)));
}
// Borland doesn't like casting an array reference to a char reference
// but these overloads work around the problem.
# if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
template<typename T,std::size_t N>
T (*addressof(T (&t)[N]))[N]
{
return reinterpret_cast<T(*)[N]>(&t);
}
template<typename T,std::size_t N>
const T (*addressof(const T (&t)[N]))[N]
{
return reinterpret_cast<const T(*)[N]>(&t);
}
# endif
}
#endif // BOOST_UTILITY_ADDRESSOF_HPP