forked from boostorg/utility
Spirit miniboost update.
[SVN r30504]
This commit is contained in:
@@ -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__))
|
#define BOOST_ASSERT(expr) ((expr)? ((void)0): ::boost::assertion_failed(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))
|
||||||
|
|
||||||
#else
|
#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)
|
# define BOOST_ASSERT(expr) assert(expr)
|
||||||
#endif
|
#endif
|
||||||
|
@@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
#include <boost/type_traits/is_arithmetic.hpp>
|
#include <boost/type_traits/is_arithmetic.hpp>
|
||||||
#include <boost/type_traits/is_pointer.hpp>
|
#include <boost/type_traits/is_pointer.hpp>
|
||||||
|
#include <boost/detail/workaround.hpp>
|
||||||
|
|
||||||
namespace boost{
|
namespace boost{
|
||||||
|
|
||||||
@@ -91,7 +92,7 @@ struct call_traits<T&>
|
|||||||
typedef T& param_type; // hh removed const
|
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
|
// these are illegal specialisations; cv-qualifies applied to
|
||||||
// references have no effect according to [8.3.2p1],
|
// references have no effect according to [8.3.2p1],
|
||||||
// C++ Builder requires them though as it treats cv-qualified
|
// C++ Builder requires them though as it treats cv-qualified
|
||||||
|
@@ -132,7 +132,7 @@ namespace details
|
|||||||
|
|
||||||
template <class T1, class T2>
|
template <class T1, class T2>
|
||||||
class compressed_pair_imp<T1, T2, 1>
|
class compressed_pair_imp<T1, T2, 1>
|
||||||
: private T1
|
: private ::boost::remove_cv<T1>::type
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef T1 first_type;
|
typedef T1 first_type;
|
||||||
@@ -174,7 +174,7 @@ namespace details
|
|||||||
|
|
||||||
template <class T1, class T2>
|
template <class T1, class T2>
|
||||||
class compressed_pair_imp<T1, T2, 2>
|
class compressed_pair_imp<T1, T2, 2>
|
||||||
: private T2
|
: private ::boost::remove_cv<T2>::type
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef T1 first_type;
|
typedef T1 first_type;
|
||||||
@@ -217,8 +217,8 @@ namespace details
|
|||||||
|
|
||||||
template <class T1, class T2>
|
template <class T1, class T2>
|
||||||
class compressed_pair_imp<T1, T2, 3>
|
class compressed_pair_imp<T1, T2, 3>
|
||||||
: private T1,
|
: private ::boost::remove_cv<T1>::type,
|
||||||
private T2
|
private ::boost::remove_cv<T2>::type
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef T1 first_type;
|
typedef T1 first_type;
|
||||||
@@ -257,7 +257,7 @@ namespace details
|
|||||||
// but reuses T1 base class for both first() and second().
|
// but reuses T1 base class for both first() and second().
|
||||||
template <class T1, class T2>
|
template <class T1, class T2>
|
||||||
class compressed_pair_imp<T1, T2, 4>
|
class compressed_pair_imp<T1, T2, 4>
|
||||||
: private T1
|
: private ::boost::remove_cv<T1>::type
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef T1 first_type;
|
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
|
#endif // BOOST_DETAIL_COMPRESSED_PAIR_HPP
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -13,9 +13,6 @@
|
|||||||
|
|
||||||
# include <boost/config.hpp>
|
# include <boost/config.hpp>
|
||||||
# include <boost/detail/workaround.hpp>
|
# include <boost/detail/workaround.hpp>
|
||||||
# if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
|
|
||||||
# include <boost/type_traits/add_pointer.hpp>
|
|
||||||
# endif
|
|
||||||
|
|
||||||
namespace boost {
|
namespace boost {
|
||||||
|
|
||||||
@@ -23,7 +20,14 @@ namespace boost {
|
|||||||
|
|
||||||
// VC7 strips const from nested classes unless we add indirection here
|
// VC7 strips const from nested classes unless we add indirection here
|
||||||
# if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
|
# 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
|
# else
|
||||||
template <typename T> T*
|
template <typename T> T*
|
||||||
# endif
|
# endif
|
||||||
@@ -33,6 +37,22 @@ addressof(T& v)
|
|||||||
&const_cast<char&>(reinterpret_cast<const volatile char &>(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
|
#endif // BOOST_UTILITY_ADDRESSOF_HPP
|
||||||
|
Reference in New Issue
Block a user