mirror of
https://github.com/boostorg/detail.git
synced 2025-06-29 14:01:04 +02:00
Compare commits
34 Commits
boost-1.33
...
svn-branch
Author | SHA1 | Date | |
---|---|---|---|
7f7562ecf7 | |||
1da5dd89a8 | |||
57fd51f8f4 | |||
60e5d575c0 | |||
87ff652a07 | |||
a548ecc968 | |||
4e009de1ec | |||
751e863564 | |||
62b7d277f2 | |||
7106b3c8b1 | |||
cd03e4d537 | |||
afbb75b3cb | |||
e2bea194a3 | |||
72a38b9137 | |||
e71cca99a6 | |||
d2e2b59111 | |||
7d61e78d56 | |||
c749e63ff2 | |||
bbd4cb3de1 | |||
3417f92b35 | |||
5f033da80e | |||
6dd212ccf7 | |||
9d5b0d7c0c | |||
83ada0473d | |||
36be4e716a | |||
3f8f91f7c7 | |||
ae07663830 | |||
d63b0de6f9 | |||
480b611fd2 | |||
c07f135aa9 | |||
0244c5a647 | |||
33ff8d33be | |||
ae50e20366 | |||
be9a4c47d4 |
@ -58,11 +58,31 @@ inline bool operator==(const blank&, const blank&)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline bool operator<=(const blank&, const blank&)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline bool operator>=(const blank&, const blank&)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline bool operator!=(const blank&, const blank&)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
inline bool operator<(const blank&, const blank&)
|
inline bool operator<(const blank&, const blank&)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline bool operator>(const blank&, const blank&)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// streaming support
|
// streaming support
|
||||||
//
|
//
|
||||||
BOOST_TEMPLATED_STREAM_TEMPLATE(E,T)
|
BOOST_TEMPLATED_STREAM_TEMPLATE(E,T)
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
// Copyright 2005 Caleb Epstein
|
||||||
|
// Copyright 2006 John Maddock
|
||||||
|
// Distributed under the Boost Software License, Version 1.0. (See accompany-
|
||||||
|
// ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1997
|
* Copyright (c) 1997
|
||||||
* Silicon Graphics Computer Systems, Inc.
|
* Silicon Graphics Computer Systems, Inc.
|
||||||
@ -37,9 +42,15 @@
|
|||||||
# error Unknown machine endianness detected.
|
# error Unknown machine endianness detected.
|
||||||
# endif
|
# endif
|
||||||
# define BOOST_BYTE_ORDER __BYTE_ORDER
|
# define BOOST_BYTE_ORDER __BYTE_ORDER
|
||||||
|
#elif defined(_BIG_ENDIAN)
|
||||||
|
# define BOOST_BIG_ENDIAN
|
||||||
|
# define BOOST_BYTE_ORDER 4321
|
||||||
|
#elif defined(_LITTLE_ENDIAN)
|
||||||
|
# define BOOST_LITTLE_ENDIAN
|
||||||
|
# define BOOST_BYTE_ORDER 1234
|
||||||
#elif defined(__sparc) || defined(__sparc__) \
|
#elif defined(__sparc) || defined(__sparc__) \
|
||||||
|| defined(_POWER) || defined(__powerpc__) \
|
|| defined(_POWER) || defined(__powerpc__) \
|
||||||
|| defined(__ppc__) || defined(__hppa) \
|
|| defined(__ppc__) || defined(__hpux) \
|
||||||
|| defined(_MIPSEB) || defined(_POWER) \
|
|| defined(_MIPSEB) || defined(_POWER) \
|
||||||
|| defined(__s390__)
|
|| defined(__s390__)
|
||||||
# define BOOST_BIG_ENDIAN
|
# define BOOST_BIG_ENDIAN
|
||||||
@ -47,7 +58,11 @@
|
|||||||
#elif defined(__i386__) || defined(__alpha__) \
|
#elif defined(__i386__) || defined(__alpha__) \
|
||||||
|| defined(__ia64) || defined(__ia64__) \
|
|| defined(__ia64) || defined(__ia64__) \
|
||||||
|| defined(_M_IX86) || defined(_M_IA64) \
|
|| defined(_M_IX86) || defined(_M_IA64) \
|
||||||
|| defined(_M_ALPHA)
|
|| defined(_M_ALPHA) || defined(__amd64) \
|
||||||
|
|| defined(__amd64__) || defined(_M_AMD64) \
|
||||||
|
|| defined(__x86_64) || defined(__x86_64__) \
|
||||||
|
|| defined(_M_X64)
|
||||||
|
|
||||||
# define BOOST_LITTLE_ENDIAN
|
# define BOOST_LITTLE_ENDIAN
|
||||||
# define BOOST_BYTE_ORDER 1234
|
# define BOOST_BYTE_ORDER 1234
|
||||||
#else
|
#else
|
||||||
|
29
include/boost/detail/has_default_constructor.hpp
Normal file
29
include/boost/detail/has_default_constructor.hpp
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
|
||||||
|
// (C) Copyright Matthias Troyerk 2006.
|
||||||
|
// Use, modification and distribution are subject to the Boost Software License,
|
||||||
|
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt).
|
||||||
|
//
|
||||||
|
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||||
|
|
||||||
|
#ifndef BOOST_DETAIL_HAS_DEFAULT_CONSTRUCTOR_HPP_INCLUDED
|
||||||
|
#define BOOST_DETAIL_HAS_DEFAULT_CONSTRUCTOR_HPP_INCLUDED
|
||||||
|
|
||||||
|
#include <boost/type_traits/has_trivial_constructor.hpp>
|
||||||
|
|
||||||
|
namespace boost { namespace detail {
|
||||||
|
|
||||||
|
/// type trait to check for a default constructor
|
||||||
|
///
|
||||||
|
/// The default implementation just checks for a trivial constructor.
|
||||||
|
/// Using some compiler magic it might be possible to provide a better default
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
struct has_default_constructor
|
||||||
|
: public has_trivial_constructor<T>
|
||||||
|
{};
|
||||||
|
|
||||||
|
} } // namespace boost::detail
|
||||||
|
|
||||||
|
|
||||||
|
#endif // BOOST_DETAIL_HAS_DEFAULT_CONSTRUCTOR_HPP_INCLUDED
|
89
include/boost/detail/identifier.hpp
Normal file
89
include/boost/detail/identifier.hpp
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
// boost/identifier.hpp ----------------------------------------------------//
|
||||||
|
|
||||||
|
// Copyright Beman Dawes 2006
|
||||||
|
|
||||||
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
// See documentation at http://www.boost.org/libs/utility
|
||||||
|
|
||||||
|
#ifndef BOOST_IDENTIFIER_HPP
|
||||||
|
#define BOOST_IDENTIFIER_HPP
|
||||||
|
|
||||||
|
#include <boost/utility/enable_if.hpp>
|
||||||
|
#include <boost/type_traits/is_base_of.hpp>
|
||||||
|
#include <iosfwd>
|
||||||
|
|
||||||
|
namespace boost
|
||||||
|
{
|
||||||
|
namespace detail
|
||||||
|
{
|
||||||
|
// class template identifier ---------------------------------------------//
|
||||||
|
|
||||||
|
// Always used as a base class so that different instantiations result in
|
||||||
|
// different class types even if instantiated with the same value type T.
|
||||||
|
|
||||||
|
// Expected usage is that T is often an integer type, best passed by
|
||||||
|
// value. There is no reason why T can't be a possibly larger class such as
|
||||||
|
// std::string, best passed by const reference.
|
||||||
|
|
||||||
|
// This implementation uses pass by value, based on expected common uses.
|
||||||
|
|
||||||
|
template <typename T, typename D>
|
||||||
|
class identifier
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef T value_type;
|
||||||
|
|
||||||
|
const value_type value() const { return m_value; }
|
||||||
|
void assign( value_type v ) { m_value = v; }
|
||||||
|
|
||||||
|
bool operator==( const D & rhs ) const { return m_value == rhs.m_value; }
|
||||||
|
bool operator!=( const D & rhs ) const { return m_value != rhs.m_value; }
|
||||||
|
bool operator< ( const D & rhs ) const { return m_value < rhs.m_value; }
|
||||||
|
bool operator<=( const D & rhs ) const { return m_value <= rhs.m_value; }
|
||||||
|
bool operator> ( const D & rhs ) const { return m_value > rhs.m_value; }
|
||||||
|
bool operator>=( const D & rhs ) const { return m_value >= rhs.m_value; }
|
||||||
|
|
||||||
|
typedef void (*unspecified_bool_type)(D); // without the D, unspecified_bool_type
|
||||||
|
static void unspecified_bool_true(D){} // conversion allows relational operators
|
||||||
|
// between different identifier types
|
||||||
|
|
||||||
|
operator unspecified_bool_type() const { return m_value == value_type() ? 0 : unspecified_bool_true; }
|
||||||
|
bool operator!() const { return m_value == value_type(); }
|
||||||
|
|
||||||
|
// constructors are protected so that class can only be used as a base class
|
||||||
|
protected:
|
||||||
|
identifier() {}
|
||||||
|
explicit identifier( value_type v ) : m_value(v) {}
|
||||||
|
|
||||||
|
#if !defined(BOOST_MSVC) || BOOST_MSVC > 1300 // 1300 == VC++ 7.0 bug workaround
|
||||||
|
private:
|
||||||
|
#endif
|
||||||
|
T m_value;
|
||||||
|
};
|
||||||
|
|
||||||
|
//#ifndef BOOST_NO_SFINAE
|
||||||
|
|
||||||
|
// template <class Ostream, class Id>
|
||||||
|
// typename enable_if< is_base_of< identifier< typename Id::value_type, Id >, Id >,
|
||||||
|
// Ostream & >::type operator<<( Ostream & os, const Id & id )
|
||||||
|
// {
|
||||||
|
// return os << id.value();
|
||||||
|
// }
|
||||||
|
|
||||||
|
// template <class Istream, class Id>
|
||||||
|
// typename enable_if< is_base_of< identifier< typename Id::value_type, Id >, Id >,
|
||||||
|
// Istream & >::type operator>>( Istream & is, Id & id )
|
||||||
|
// {
|
||||||
|
// typename Id::value_type v;
|
||||||
|
// is >> v;
|
||||||
|
// id.value( v );
|
||||||
|
// return is;
|
||||||
|
// }
|
||||||
|
//#endif
|
||||||
|
|
||||||
|
} // namespace detail
|
||||||
|
} // namespace boost
|
||||||
|
|
||||||
|
#endif // BOOST_IDENTIFIER_HPP
|
@ -388,27 +388,27 @@ typename is_pointer_help<V>::type reference_to_pointer_helper(V&);
|
|||||||
outer_no_type reference_to_pointer_helper(...);
|
outer_no_type reference_to_pointer_helper(...);
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
struct is_reference_to_pointer
|
struct reference_to_pointer_impl
|
||||||
{
|
{
|
||||||
static T t;
|
static T t;
|
||||||
BOOST_STATIC_CONSTANT(
|
BOOST_STATIC_CONSTANT(
|
||||||
bool, value
|
bool, value
|
||||||
= (is_reference<T>::value
|
= (sizeof((reference_to_pointer_helper)(t)) == sizeof(inner_yes_type))
|
||||||
&& sizeof((reference_to_pointer_helper)(t)) == sizeof(inner_yes_type))
|
|
||||||
);
|
);
|
||||||
|
|
||||||
typedef mpl::bool_<value> type;
|
typedef mpl::bool_<value> type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
struct is_reference_to_pointer
|
||||||
|
: mpl::eval_if<is_reference<T>, reference_to_pointer_impl<T>, mpl::false_>::type
|
||||||
|
{
|
||||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_pointer,(T))
|
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_pointer,(T))
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
struct is_reference_to_function_pointer
|
struct is_reference_to_function_pointer
|
||||||
: mpl::if_<
|
: mpl::eval_if<is_reference<T>, is_pointer_to_function_aux<T>, mpl::false_>::type
|
||||||
is_reference<T>
|
|
||||||
, is_pointer_to_function_aux<T>
|
|
||||||
, mpl::bool_<false>
|
|
||||||
>::type
|
|
||||||
{
|
{
|
||||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_function_pointer,(T))
|
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_function_pointer,(T))
|
||||||
};
|
};
|
||||||
|
@ -26,20 +26,66 @@
|
|||||||
# define BOOST_INTERLOCKED_INCREMENT InterlockedIncrement
|
# define BOOST_INTERLOCKED_INCREMENT InterlockedIncrement
|
||||||
# define BOOST_INTERLOCKED_DECREMENT InterlockedDecrement
|
# define BOOST_INTERLOCKED_DECREMENT InterlockedDecrement
|
||||||
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE InterlockedCompareExchange
|
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE InterlockedCompareExchange
|
||||||
|
# define BOOST_INTERLOCKED_EXCHANGE InterlockedExchange
|
||||||
|
# define BOOST_INTERLOCKED_EXCHANGE_ADD InterlockedExchangeAdd
|
||||||
|
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER InterlockedCompareExchangePointer
|
||||||
|
# define BOOST_INTERLOCKED_EXCHANGE_POINTER InterlockedExchangePointer
|
||||||
|
|
||||||
|
#elif defined(_WIN32_WCE)
|
||||||
|
|
||||||
|
// under Windows CE we still have old-style Interlocked* functions
|
||||||
|
|
||||||
|
extern "C" long __cdecl InterlockedIncrement( long* );
|
||||||
|
extern "C" long __cdecl InterlockedDecrement( long* );
|
||||||
|
extern "C" long __cdecl InterlockedCompareExchange( long*, long, long );
|
||||||
|
extern "C" long __cdecl InterlockedExchange( long*, long );
|
||||||
|
extern "C" long __cdecl InterlockedExchangeAdd( long*, long );
|
||||||
|
|
||||||
|
# define BOOST_INTERLOCKED_INCREMENT InterlockedIncrement
|
||||||
|
# define BOOST_INTERLOCKED_DECREMENT InterlockedDecrement
|
||||||
|
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE InterlockedCompareExchange
|
||||||
|
# define BOOST_INTERLOCKED_EXCHANGE InterlockedExchange
|
||||||
|
# define BOOST_INTERLOCKED_EXCHANGE_ADD InterlockedExchangeAdd
|
||||||
|
|
||||||
#elif defined( BOOST_MSVC ) || defined( BOOST_INTEL_WIN )
|
#elif defined( BOOST_MSVC ) || defined( BOOST_INTEL_WIN )
|
||||||
|
|
||||||
extern "C" long __cdecl _InterlockedIncrement( long volatile * );
|
extern "C" long __cdecl _InterlockedIncrement( long volatile * );
|
||||||
extern "C" long __cdecl _InterlockedDecrement( long volatile * );
|
extern "C" long __cdecl _InterlockedDecrement( long volatile * );
|
||||||
extern "C" long __cdecl _InterlockedCompareExchange( long volatile *, long, long );
|
extern "C" long __cdecl _InterlockedCompareExchange( long volatile *, long, long );
|
||||||
|
extern "C" long __cdecl _InterlockedExchange( long volatile *, long);
|
||||||
|
extern "C" long __cdecl _InterlockedExchangeAdd( long volatile *, long);
|
||||||
|
|
||||||
# pragma intrinsic( _InterlockedIncrement )
|
# pragma intrinsic( _InterlockedIncrement )
|
||||||
# pragma intrinsic( _InterlockedDecrement )
|
# pragma intrinsic( _InterlockedDecrement )
|
||||||
# pragma intrinsic( _InterlockedCompareExchange )
|
# pragma intrinsic( _InterlockedCompareExchange )
|
||||||
|
# pragma intrinsic( _InterlockedExchange )
|
||||||
|
# pragma intrinsic( _InterlockedExchangeAdd )
|
||||||
|
|
||||||
|
# if defined(_M_IA64) || defined(_M_AMD64)
|
||||||
|
|
||||||
|
extern "C" void* __cdecl _InterlockedCompareExchangePointer( void* volatile *, void*, void* );
|
||||||
|
extern "C" void* __cdecl _InterlockedExchangePointer( void* volatile *, void* );
|
||||||
|
|
||||||
|
# pragma intrinsic( _InterlockedCompareExchangePointer )
|
||||||
|
# pragma intrinsic( _InterlockedExchangePointer )
|
||||||
|
|
||||||
|
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER _InterlockedCompareExchangePointer
|
||||||
|
# define BOOST_INTERLOCKED_EXCHANGE_POINTER _InterlockedExchangePointer
|
||||||
|
|
||||||
|
# else
|
||||||
|
|
||||||
|
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \
|
||||||
|
((void*)BOOST_INTERLOCKED_COMPARE_EXCHANGE((long volatile*)(dest),(long)(exchange),(long)(compare)))
|
||||||
|
# define BOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \
|
||||||
|
((void*)BOOST_INTERLOCKED_EXCHANGE((long volatile*)(dest),(long)(exchange)))
|
||||||
|
|
||||||
|
# endif
|
||||||
|
|
||||||
# define BOOST_INTERLOCKED_INCREMENT _InterlockedIncrement
|
# define BOOST_INTERLOCKED_INCREMENT _InterlockedIncrement
|
||||||
# define BOOST_INTERLOCKED_DECREMENT _InterlockedDecrement
|
# define BOOST_INTERLOCKED_DECREMENT _InterlockedDecrement
|
||||||
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE _InterlockedCompareExchange
|
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE _InterlockedCompareExchange
|
||||||
|
# define BOOST_INTERLOCKED_EXCHANGE _InterlockedExchange
|
||||||
|
# define BOOST_INTERLOCKED_EXCHANGE_ADD _InterlockedExchangeAdd
|
||||||
|
|
||||||
#elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ )
|
#elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ )
|
||||||
|
|
||||||
@ -52,14 +98,23 @@ namespace detail
|
|||||||
extern "C" __declspec(dllimport) long __stdcall InterlockedIncrement( long volatile * );
|
extern "C" __declspec(dllimport) long __stdcall InterlockedIncrement( long volatile * );
|
||||||
extern "C" __declspec(dllimport) long __stdcall InterlockedDecrement( long volatile * );
|
extern "C" __declspec(dllimport) long __stdcall InterlockedDecrement( long volatile * );
|
||||||
extern "C" __declspec(dllimport) long __stdcall InterlockedCompareExchange( long volatile *, long, long );
|
extern "C" __declspec(dllimport) long __stdcall InterlockedCompareExchange( long volatile *, long, long );
|
||||||
|
extern "C" __declspec(dllimport) long __stdcall InterlockedExchange( long volatile *, long );
|
||||||
|
extern "C" __declspec(dllimport) long __stdcall InterlockedExchangeAdd( long volatile *, long );
|
||||||
|
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
|
|
||||||
# define BOOST_INTERLOCKED_INCREMENT InterlockedIncrement
|
# define BOOST_INTERLOCKED_INCREMENT ::boost::detail::InterlockedIncrement
|
||||||
# define BOOST_INTERLOCKED_DECREMENT InterlockedDecrement
|
# define BOOST_INTERLOCKED_DECREMENT ::boost::detail::InterlockedDecrement
|
||||||
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE InterlockedCompareExchange
|
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE ::boost::detail::InterlockedCompareExchange
|
||||||
|
# define BOOST_INTERLOCKED_EXCHANGE ::boost::detail::InterlockedExchange
|
||||||
|
# define BOOST_INTERLOCKED_EXCHANGE_ADD ::boost::detail::InterlockedExchangeAdd
|
||||||
|
|
||||||
|
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \
|
||||||
|
((void*)BOOST_INTERLOCKED_COMPARE_EXCHANGE((long volatile*)(dest),(long)(exchange),(long)(compare)))
|
||||||
|
# define BOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \
|
||||||
|
((void*)BOOST_INTERLOCKED_EXCHANGE((long volatile*)(dest),(long)(exchange)))
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
@ -4,13 +4,15 @@
|
|||||||
#ifndef IS_INCREMENTABLE_DWA200415_HPP
|
#ifndef IS_INCREMENTABLE_DWA200415_HPP
|
||||||
# define IS_INCREMENTABLE_DWA200415_HPP
|
# define IS_INCREMENTABLE_DWA200415_HPP
|
||||||
|
|
||||||
# include <boost/type_traits/detail/bool_trait_def.hpp>
|
|
||||||
# include <boost/type_traits/detail/template_arity_spec.hpp>
|
# include <boost/type_traits/detail/template_arity_spec.hpp>
|
||||||
# include <boost/type_traits/remove_cv.hpp>
|
# include <boost/type_traits/remove_cv.hpp>
|
||||||
# include <boost/mpl/aux_/lambda_support.hpp>
|
# include <boost/mpl/aux_/lambda_support.hpp>
|
||||||
# include <boost/mpl/bool.hpp>
|
# include <boost/mpl/bool.hpp>
|
||||||
# include <boost/detail/workaround.hpp>
|
# include <boost/detail/workaround.hpp>
|
||||||
|
|
||||||
|
// Must be the last include
|
||||||
|
# include <boost/type_traits/detail/bool_trait_def.hpp>
|
||||||
|
|
||||||
namespace boost { namespace detail {
|
namespace boost { namespace detail {
|
||||||
|
|
||||||
// is_incrementable<T> metafunction
|
// is_incrementable<T> metafunction
|
||||||
@ -32,9 +34,27 @@ namespace is_incrementable_
|
|||||||
struct any { template <class T> any(T const&); };
|
struct any { template <class T> any(T const&); };
|
||||||
|
|
||||||
// This is a last-resort operator++ for when none other is found
|
// This is a last-resort operator++ for when none other is found
|
||||||
|
# if BOOST_WORKAROUND(__GNUC__, == 4) && __GNUC_MINOR__ == 0 && __GNUC_PATCHLEVEL__ == 2
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace is_incrementable_2
|
||||||
|
{
|
||||||
|
is_incrementable_::tag operator++(is_incrementable_::any const&);
|
||||||
|
is_incrementable_::tag operator++(is_incrementable_::any const&,int);
|
||||||
|
}
|
||||||
|
using namespace is_incrementable_2;
|
||||||
|
|
||||||
|
namespace is_incrementable_
|
||||||
|
{
|
||||||
|
|
||||||
|
# else
|
||||||
|
|
||||||
tag operator++(any const&);
|
tag operator++(any const&);
|
||||||
tag operator++(any const&,int);
|
tag operator++(any const&,int);
|
||||||
|
|
||||||
|
# endif
|
||||||
|
|
||||||
# if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3202)) \
|
# if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3202)) \
|
||||||
|| BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
|
|| BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
|
||||||
# define BOOST_comma(a,b) (a)
|
# define BOOST_comma(a,b) (a)
|
||||||
@ -99,5 +119,6 @@ BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1, ::boost::detail::is_postfix_incrementable)
|
|||||||
|
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
|
|
||||||
|
# include <boost/type_traits/detail/bool_trait_undef.hpp>
|
||||||
|
|
||||||
#endif // IS_INCREMENTABLE_DWA200415_HPP
|
#endif // IS_INCREMENTABLE_DWA200415_HPP
|
||||||
|
61
include/boost/detail/is_xxx.hpp
Executable file
61
include/boost/detail/is_xxx.hpp
Executable file
@ -0,0 +1,61 @@
|
|||||||
|
// Copyright David Abrahams 2005. Distributed under the Boost
|
||||||
|
// Software License, Version 1.0. (See accompanying
|
||||||
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
#ifndef BOOST_DETAIL_IS_XXX_DWA20051011_HPP
|
||||||
|
# define BOOST_DETAIL_IS_XXX_DWA20051011_HPP
|
||||||
|
|
||||||
|
# include <boost/config.hpp>
|
||||||
|
# include <boost/mpl/bool.hpp>
|
||||||
|
# include <boost/preprocessor/enum_params.hpp>
|
||||||
|
|
||||||
|
# if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||||
|
# include <boost/type_traits/is_reference.hpp>
|
||||||
|
# include <boost/type_traits/add_reference.hpp>
|
||||||
|
|
||||||
|
# define BOOST_DETAIL_IS_XXX_DEF(name, qualified_name, nargs) \
|
||||||
|
template <class X_> \
|
||||||
|
struct is_##name \
|
||||||
|
{ \
|
||||||
|
typedef char yes; \
|
||||||
|
typedef char (&no)[2]; \
|
||||||
|
\
|
||||||
|
static typename add_reference<X_>::type dummy; \
|
||||||
|
\
|
||||||
|
struct helpers \
|
||||||
|
{ \
|
||||||
|
template < BOOST_PP_ENUM_PARAMS_Z(1, nargs, class U) > \
|
||||||
|
static yes test( \
|
||||||
|
qualified_name< BOOST_PP_ENUM_PARAMS_Z(1, nargs, U) >&, int \
|
||||||
|
); \
|
||||||
|
\
|
||||||
|
template <class U> \
|
||||||
|
static no test(U&, ...); \
|
||||||
|
}; \
|
||||||
|
\
|
||||||
|
BOOST_STATIC_CONSTANT( \
|
||||||
|
bool, value \
|
||||||
|
= !is_reference<X_>::value \
|
||||||
|
& (sizeof(helpers::test(dummy, 0)) == sizeof(yes))); \
|
||||||
|
\
|
||||||
|
typedef mpl::bool_<value> type; \
|
||||||
|
};
|
||||||
|
|
||||||
|
# else
|
||||||
|
|
||||||
|
# define BOOST_DETAIL_IS_XXX_DEF(name, qualified_name, nargs) \
|
||||||
|
template <class T> \
|
||||||
|
struct is_##name : mpl::false_ \
|
||||||
|
{ \
|
||||||
|
}; \
|
||||||
|
\
|
||||||
|
template < BOOST_PP_ENUM_PARAMS_Z(1, nargs, class T) > \
|
||||||
|
struct is_##name< \
|
||||||
|
qualified_name< BOOST_PP_ENUM_PARAMS_Z(1, nargs, T) > \
|
||||||
|
> \
|
||||||
|
: mpl::true_ \
|
||||||
|
{ \
|
||||||
|
};
|
||||||
|
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#endif // BOOST_DETAIL_IS_XXX_DWA20051011_HPP
|
@ -71,7 +71,15 @@ template<unsigned size, unsigned align_> struct allocator_impl
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef BOOST_HAS_THREADS
|
#ifdef BOOST_HAS_THREADS
|
||||||
static lightweight_mutex mutex;
|
|
||||||
|
static lightweight_mutex & mutex()
|
||||||
|
{
|
||||||
|
static lightweight_mutex m;
|
||||||
|
return m;
|
||||||
|
}
|
||||||
|
|
||||||
|
static lightweight_mutex * mutex_init;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static block * free;
|
static block * free;
|
||||||
@ -81,7 +89,7 @@ template<unsigned size, unsigned align_> struct allocator_impl
|
|||||||
static inline void * alloc()
|
static inline void * alloc()
|
||||||
{
|
{
|
||||||
#ifdef BOOST_HAS_THREADS
|
#ifdef BOOST_HAS_THREADS
|
||||||
lightweight_mutex::scoped_lock lock(mutex);
|
lightweight_mutex::scoped_lock lock( mutex() );
|
||||||
#endif
|
#endif
|
||||||
if(block * x = free)
|
if(block * x = free)
|
||||||
{
|
{
|
||||||
@ -111,7 +119,7 @@ template<unsigned size, unsigned align_> struct allocator_impl
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifdef BOOST_HAS_THREADS
|
#ifdef BOOST_HAS_THREADS
|
||||||
lightweight_mutex::scoped_lock lock(mutex);
|
lightweight_mutex::scoped_lock lock( mutex() );
|
||||||
#endif
|
#endif
|
||||||
if(block * x = free)
|
if(block * x = free)
|
||||||
{
|
{
|
||||||
@ -136,7 +144,7 @@ template<unsigned size, unsigned align_> struct allocator_impl
|
|||||||
if(pv != 0) // 18.4.1.1/13
|
if(pv != 0) // 18.4.1.1/13
|
||||||
{
|
{
|
||||||
#ifdef BOOST_HAS_THREADS
|
#ifdef BOOST_HAS_THREADS
|
||||||
lightweight_mutex::scoped_lock lock(mutex);
|
lightweight_mutex::scoped_lock lock( mutex() );
|
||||||
#endif
|
#endif
|
||||||
block * pb = static_cast<block *>(pv);
|
block * pb = static_cast<block *>(pv);
|
||||||
pb->next = free;
|
pb->next = free;
|
||||||
@ -153,7 +161,7 @@ template<unsigned size, unsigned align_> struct allocator_impl
|
|||||||
else if(pv != 0) // 18.4.1.1/13
|
else if(pv != 0) // 18.4.1.1/13
|
||||||
{
|
{
|
||||||
#ifdef BOOST_HAS_THREADS
|
#ifdef BOOST_HAS_THREADS
|
||||||
lightweight_mutex::scoped_lock lock(mutex);
|
lightweight_mutex::scoped_lock lock( mutex() );
|
||||||
#endif
|
#endif
|
||||||
block * pb = static_cast<block *>(pv);
|
block * pb = static_cast<block *>(pv);
|
||||||
pb->next = free;
|
pb->next = free;
|
||||||
@ -163,8 +171,10 @@ template<unsigned size, unsigned align_> struct allocator_impl
|
|||||||
};
|
};
|
||||||
|
|
||||||
#ifdef BOOST_HAS_THREADS
|
#ifdef BOOST_HAS_THREADS
|
||||||
|
|
||||||
template<unsigned size, unsigned align_>
|
template<unsigned size, unsigned align_>
|
||||||
lightweight_mutex allocator_impl<size, align_>::mutex;
|
lightweight_mutex * allocator_impl<size, align_>::mutex_init = &allocator_impl<size, align_>::mutex();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
template<unsigned size, unsigned align_>
|
template<unsigned size, unsigned align_>
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
// Copyright <20> 2001 Ronald Garcia, Indiana University (garcia@osl.iu.edu)
|
// Copyright <20> 2001 Ronald Garcia, Indiana University (garcia@osl.iu.edu)
|
||||||
// Andrew Lumsdaine, Indiana University (lums@osl.iu.edu). Permission to copy,
|
// Andrew Lumsdaine, Indiana University (lums@osl.iu.edu).
|
||||||
// use, modify, sell and distribute this software is granted provided this
|
// Distributed under the Boost Software License, Version 1.0. (See accompany-
|
||||||
// copyright notice appears in all copies. This software is provided "as is"
|
// ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// without express or implied warranty, and with no claim as to its suitability
|
|
||||||
// for any purpose.
|
|
||||||
|
|
||||||
#ifndef BOOST_UTF8_CODECVT_FACET_HPP
|
#ifndef BOOST_UTF8_CODECVT_FACET_HPP
|
||||||
#define BOOST_UTF8_CODECVT_FACET_HPP
|
#define BOOST_UTF8_CODECVT_FACET_HPP
|
||||||
@ -92,7 +90,7 @@
|
|||||||
namespace std {
|
namespace std {
|
||||||
#if defined(__LIBCOMO__)
|
#if defined(__LIBCOMO__)
|
||||||
using ::mbstate_t;
|
using ::mbstate_t;
|
||||||
#elif defined(BOOST_DINKUMWARE_STDLIB)
|
#elif defined(BOOST_DINKUMWARE_STDLIB) && !defined(__BORLANDC__)
|
||||||
using ::mbstate_t;
|
using ::mbstate_t;
|
||||||
#elif defined(__SGI_STL_PORT)
|
#elif defined(__SGI_STL_PORT)
|
||||||
#elif defined(BOOST_NO_STDC_NAMESPACE)
|
#elif defined(BOOST_NO_STDC_NAMESPACE)
|
||||||
@ -162,7 +160,7 @@ protected:
|
|||||||
virtual std::codecvt_base::result do_unshift(
|
virtual std::codecvt_base::result do_unshift(
|
||||||
std::mbstate_t&,
|
std::mbstate_t&,
|
||||||
char * from,
|
char * from,
|
||||||
char * to,
|
char * /*to*/,
|
||||||
char * & next
|
char * & next
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
|
@ -3,107 +3,39 @@
|
|||||||
// accompanying file LICENSE_1_0.txt or copy at
|
// accompanying file LICENSE_1_0.txt or copy at
|
||||||
// http://www.boost.org/LICENSE_1_0.txt)
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
// The ct_if implementation that avoids partial specialization is
|
// This header replaces the implementation of ct_if that preceded the
|
||||||
// based on the IF class by Ulrich W. Eisenecker and Krzysztof
|
// introduction of Boost.MPL with a facade that defers to that reviewed and
|
||||||
// Czarnecki.
|
// accepted library.
|
||||||
|
|
||||||
|
// Author: Ronald Garcia
|
||||||
|
// Date: 20 October, 2006
|
||||||
|
|
||||||
|
|
||||||
#ifndef BOOST_CT_IF_HPP
|
#ifndef BOOST_CT_IF_HPP
|
||||||
#define BOOST_CT_IF_HPP
|
#define BOOST_CT_IF_HPP
|
||||||
|
|
||||||
#include <boost/config.hpp>
|
|
||||||
|
|
||||||
/*
|
// A stub implementation in terms of Boost.MPL
|
||||||
There is a bug in the Borland compiler with regards to using
|
|
||||||
integers to specialize templates. This made it hard to use ct_if in
|
|
||||||
the graph library. Changing from 'ct_if' to 'ct_if_t' fixed the
|
|
||||||
problem.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <boost/type_traits/integral_constant.hpp> // true_type and false_type
|
#include <boost/mpl/if.hpp>
|
||||||
|
#include <boost/mpl/not.hpp>
|
||||||
|
#include <boost/mpl/and.hpp>
|
||||||
|
// true_type and false_type are used by applications of ct_if
|
||||||
|
#include <boost/type_traits/integral_constant.hpp>
|
||||||
|
|
||||||
namespace boost {
|
namespace boost {
|
||||||
|
|
||||||
struct ct_if_error { };
|
|
||||||
|
|
||||||
template <class A, class B>
|
template <class A, class B>
|
||||||
struct ct_and { typedef false_type type; };
|
struct ct_and : boost::mpl::and_<A,B> {};
|
||||||
template <> struct ct_and<true_type,true_type> { typedef true_type type; };
|
|
||||||
|
|
||||||
template <class A> struct ct_not { typedef ct_if_error type; };
|
template <class A>
|
||||||
template <> struct ct_not<true_type> { typedef false_type type; };
|
struct ct_not : mpl::not_<A> {};
|
||||||
template <> struct ct_not<false_type> { typedef true_type type; };
|
|
||||||
|
|
||||||
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
|
||||||
|
|
||||||
// agurt, 15/sep/02: in certain cases Borland has problems with
|
|
||||||
// choosing the right 'ct_if' specialization even though 'cond'
|
|
||||||
// _does_ equal '1'; the easiest way to fix it is to make first
|
|
||||||
// 'ct_if' non-type template parameter boolean.
|
|
||||||
#if !defined(__BORLANDC__)
|
|
||||||
template <bool cond, class A, class B>
|
template <bool cond, class A, class B>
|
||||||
struct ct_if { typedef ct_if_error type; };
|
struct ct_if : mpl::if_c<cond,A,B> {};
|
||||||
template <class A, class B>
|
|
||||||
struct ct_if<true, A, B> { typedef A type; };
|
|
||||||
template <class A, class B>
|
|
||||||
struct ct_if<false, A, B> { typedef B type; };
|
|
||||||
#else
|
|
||||||
template <bool cond, class A, class B>
|
|
||||||
struct ct_if { typedef A type; };
|
|
||||||
template <class A, class B>
|
|
||||||
struct ct_if<false, A, B> { typedef B type; };
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template <class cond, class A, class B>
|
template <class cond, class A, class B>
|
||||||
struct ct_if_t { typedef ct_if_error type; };
|
struct ct_if_t : mpl::if_<cond,A,B> {};
|
||||||
template <class A, class B>
|
|
||||||
struct ct_if_t<true_type, A, B> { typedef A type; };
|
|
||||||
template <class A, class B>
|
|
||||||
struct ct_if_t<false_type, A, B> { typedef B type; };
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
namespace detail {
|
|
||||||
|
|
||||||
template <int condition, class A, class B> struct IF;
|
|
||||||
template <int condition> struct SlectSelector;
|
|
||||||
struct SelectFirstType;
|
|
||||||
struct SelectSecondType;
|
|
||||||
|
|
||||||
struct SelectFirstType {
|
|
||||||
template<class A, class B>
|
|
||||||
struct Template { typedef A type; };
|
|
||||||
};
|
|
||||||
|
|
||||||
struct SelectSecondType {
|
|
||||||
template<class A, class B>
|
|
||||||
struct Template { typedef B type; };
|
|
||||||
};
|
|
||||||
|
|
||||||
template<int condition>
|
|
||||||
struct SlectSelector {
|
|
||||||
typedef SelectFirstType type;
|
|
||||||
};
|
|
||||||
|
|
||||||
template <>
|
|
||||||
struct SlectSelector<0> {
|
|
||||||
typedef SelectSecondType type;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace detail
|
|
||||||
|
|
||||||
template<int condition, class A, class B>
|
|
||||||
struct ct_if
|
|
||||||
{
|
|
||||||
typedef typename detail::SlectSelector<condition>::type Selector;
|
|
||||||
typedef typename Selector::template Template<A, B>::type type;
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class cond, class A, class B>
|
|
||||||
struct ct_if_t {
|
|
||||||
typedef typename ct_if<cond::value, A, B>::type type;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
|
|
||||||
|
@ -12,14 +12,17 @@
|
|||||||
// http://www.boost.org/LICENSE_1_0.txt)
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
//
|
//
|
||||||
// ------------------------------------------------------
|
// ------------------------------------------------------
|
||||||
|
//
|
||||||
|
// $Id$
|
||||||
|
|
||||||
|
|
||||||
#ifndef BOOST_INTEGER_LOG2_HPP_GP_20030301
|
#ifndef BOOST_INTEGER_LOG2_HPP_GP_20030301
|
||||||
#define BOOST_INTEGER_LOG2_HPP_GP_20030301
|
#define BOOST_INTEGER_LOG2_HPP_GP_20030301
|
||||||
|
|
||||||
#include <cassert>
|
#include <assert.h>
|
||||||
#include <climits> // actually used for Borland only
|
#ifdef __BORLANDC__
|
||||||
|
#include <climits>
|
||||||
|
#endif
|
||||||
#include "boost/limits.hpp"
|
#include "boost/limits.hpp"
|
||||||
#include "boost/config.hpp"
|
#include "boost/config.hpp"
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ BOOST_UTF8_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
// Translate incoming UTF-8 into UCS-4
|
// Translate incoming UTF-8 into UCS-4
|
||||||
std::codecvt_base::result utf8_codecvt_facet::do_in(
|
std::codecvt_base::result utf8_codecvt_facet::do_in(
|
||||||
std::mbstate_t& state,
|
std::mbstate_t& /*state*/,
|
||||||
const char * from,
|
const char * from,
|
||||||
const char * from_end,
|
const char * from_end,
|
||||||
const char * & from_next,
|
const char * & from_next,
|
||||||
@ -109,7 +109,7 @@ std::codecvt_base::result utf8_codecvt_facet::do_in(
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::codecvt_base::result utf8_codecvt_facet::do_out(
|
std::codecvt_base::result utf8_codecvt_facet::do_out(
|
||||||
std::mbstate_t& state,
|
std::mbstate_t& /*state*/,
|
||||||
const wchar_t * from,
|
const wchar_t * from,
|
||||||
const wchar_t * from_end,
|
const wchar_t * from_end,
|
||||||
const wchar_t * & from_next,
|
const wchar_t * & from_next,
|
||||||
|
Reference in New Issue
Block a user