mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-18 13:40:19 +00:00
Upgrade to boost 1.33.1
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13298 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
c0ce7ff659
commit
376aaac146
@ -1,3 +1,7 @@
|
||||
2006-03-05 Lars Gullik Bjøøonnes<larsbj@lyx.org>
|
||||
|
||||
* Upgrade to version 1.33.1 of boost.
|
||||
|
||||
2006-02-21 Lars Gullik Bjønnes <larsbj@lyx.org>
|
||||
|
||||
* boost/bind.hpp: include visit_each.hpp to fix a gcc 4.1 compile
|
||||
|
170
boost/boost/aligned_storage.hpp
Normal file
170
boost/boost/aligned_storage.hpp
Normal file
@ -0,0 +1,170 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// boost aligned_storage.hpp header file
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright (c) 2002-2003
|
||||
// Eric Friedman, Itay Maman
|
||||
//
|
||||
// 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_ALIGNED_STORAGE_HPP
|
||||
#define BOOST_ALIGNED_STORAGE_HPP
|
||||
|
||||
#include <cstddef> // for std::size_t
|
||||
|
||||
#include "boost/config.hpp"
|
||||
#include "boost/detail/workaround.hpp"
|
||||
#include "boost/type_traits/alignment_of.hpp"
|
||||
#include "boost/type_traits/type_with_alignment.hpp"
|
||||
#include "boost/type_traits/is_pod.hpp"
|
||||
|
||||
#include "boost/mpl/eval_if.hpp"
|
||||
#include "boost/mpl/identity.hpp"
|
||||
|
||||
#include "boost/type_traits/detail/bool_trait_def.hpp"
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace detail { namespace aligned_storage {
|
||||
|
||||
BOOST_STATIC_CONSTANT(
|
||||
std::size_t
|
||||
, alignment_of_max_align = ::boost::alignment_of<max_align>::value
|
||||
);
|
||||
|
||||
//
|
||||
// To be TR1 conforming this must be a POD type:
|
||||
//
|
||||
template <
|
||||
std::size_t size_
|
||||
, std::size_t alignment_
|
||||
>
|
||||
struct aligned_storage_imp
|
||||
{
|
||||
union data_t
|
||||
{
|
||||
char buf[size_];
|
||||
|
||||
typename mpl::eval_if_c<
|
||||
alignment_ == std::size_t(-1)
|
||||
, mpl::identity<detail::max_align>
|
||||
, type_with_alignment<alignment_>
|
||||
>::type align_;
|
||||
} data_;
|
||||
};
|
||||
|
||||
}} // namespace detail::aligned_storage
|
||||
|
||||
template <
|
||||
std::size_t size_
|
||||
, std::size_t alignment_ = std::size_t(-1)
|
||||
>
|
||||
class aligned_storage
|
||||
{
|
||||
private: // representation
|
||||
|
||||
detail::aligned_storage::aligned_storage_imp<size_, alignment_> data_;
|
||||
|
||||
public: // constants
|
||||
|
||||
typedef detail::aligned_storage::aligned_storage_imp<size_, alignment_> type;
|
||||
|
||||
BOOST_STATIC_CONSTANT(
|
||||
std::size_t
|
||||
, size = size_
|
||||
);
|
||||
BOOST_STATIC_CONSTANT(
|
||||
std::size_t
|
||||
, alignment = (
|
||||
alignment_ == std::size_t(-1)
|
||||
? ::boost::detail::aligned_storage::alignment_of_max_align
|
||||
: alignment_
|
||||
)
|
||||
);
|
||||
|
||||
#if defined(__GNUC__) &&\
|
||||
(__GNUC__ > 3) ||\
|
||||
(__GNUC__ == 3 && (__GNUC_MINOR__ > 2 ||\
|
||||
(__GNUC_MINOR__ == 2 && __GNUC_PATCHLEVEL__ >=3)))
|
||||
|
||||
private: // noncopyable
|
||||
|
||||
aligned_storage(const aligned_storage&);
|
||||
aligned_storage& operator=(const aligned_storage&);
|
||||
|
||||
#else // gcc less than 3.2.3
|
||||
|
||||
public: // _should_ be noncopyable, but GCC compiler emits error
|
||||
|
||||
aligned_storage(const aligned_storage&);
|
||||
aligned_storage& operator=(const aligned_storage&);
|
||||
|
||||
#endif // gcc < 3.2.3 workaround
|
||||
|
||||
public: // structors
|
||||
|
||||
aligned_storage()
|
||||
{
|
||||
}
|
||||
|
||||
~aligned_storage()
|
||||
{
|
||||
}
|
||||
|
||||
public: // accessors
|
||||
|
||||
void* address()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1200)
|
||||
|
||||
const void* address() const
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
#else // MSVC6
|
||||
|
||||
const void* address() const;
|
||||
|
||||
#endif // MSVC6 workaround
|
||||
|
||||
};
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1200)
|
||||
|
||||
// MSVC6 seems not to like inline functions with const void* returns, so we
|
||||
// declare the following here:
|
||||
|
||||
template <std::size_t S, std::size_t A>
|
||||
const void* aligned_storage<S,A>::address() const
|
||||
{
|
||||
return const_cast< aligned_storage<S,A>* >(this)->address();
|
||||
}
|
||||
|
||||
#endif // MSVC6 workaround
|
||||
|
||||
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
//
|
||||
// Make sure that is_pod recognises aligned_storage<>::type
|
||||
// as a POD (Note that aligned_storage<> itself is not a POD):
|
||||
//
|
||||
template <std::size_t size_, std::size_t alignment_>
|
||||
struct is_pod<boost::detail::aligned_storage::aligned_storage_imp<size_,alignment_> >
|
||||
BOOST_TT_AUX_BOOL_C_BASE(true)
|
||||
{
|
||||
BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(true)
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#include "boost/type_traits/detail/bool_trait_undef.hpp"
|
||||
|
||||
#endif // BOOST_ALIGNED_STORAGE_HPP
|
@ -14,7 +14,10 @@
|
||||
#include <typeinfo>
|
||||
|
||||
#include "boost/config.hpp"
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
#include <boost/type_traits/is_reference.hpp>
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
@ -133,6 +136,9 @@ namespace boost
|
||||
template<typename ValueType>
|
||||
friend ValueType * any_cast(any *);
|
||||
|
||||
template<typename ValueType>
|
||||
friend ValueType * unsafe_any_cast(any *);
|
||||
|
||||
#else
|
||||
|
||||
public: // representation (public so any_cast can be non-friend)
|
||||
@ -170,12 +176,57 @@ namespace boost
|
||||
template<typename ValueType>
|
||||
ValueType any_cast(const any & operand)
|
||||
{
|
||||
const ValueType * result = any_cast<ValueType>(&operand);
|
||||
typedef BOOST_DEDUCED_TYPENAME remove_reference<ValueType>::type nonref;
|
||||
|
||||
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
// If 'nonref' is still reference type, it means the user has not
|
||||
// specialized 'remove_reference'.
|
||||
|
||||
// Please use BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION macro
|
||||
// to generate specialization of remove_reference for your class
|
||||
// See type traits library documentation for details
|
||||
BOOST_STATIC_ASSERT(!is_reference<nonref>::value);
|
||||
#endif
|
||||
|
||||
const nonref * result = any_cast<nonref>(&operand);
|
||||
if(!result)
|
||||
boost::throw_exception(bad_any_cast());
|
||||
return *result;
|
||||
}
|
||||
|
||||
template<typename ValueType>
|
||||
ValueType any_cast(any & operand)
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME remove_reference<ValueType>::type nonref;
|
||||
|
||||
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
// The comment in the above version of 'any_cast' explains when this
|
||||
// assert is fired and what to do.
|
||||
BOOST_STATIC_ASSERT(!is_reference<nonref>::value);
|
||||
#endif
|
||||
|
||||
nonref * result = any_cast<nonref>(&operand);
|
||||
if(!result)
|
||||
boost::throw_exception(bad_any_cast());
|
||||
return *result;
|
||||
}
|
||||
|
||||
// Note: The "unsafe" versions of any_cast are not part of the
|
||||
// public interface and may be removed at any time. They are
|
||||
// required where we know what type is stored in the any and can't
|
||||
// use typeid() comparison, e.g., when our types may travel across
|
||||
// different shared libraries.
|
||||
template<typename ValueType>
|
||||
ValueType * unsafe_any_cast(any * operand)
|
||||
{
|
||||
return &static_cast<any::holder<ValueType> *>(operand->content)->held;
|
||||
}
|
||||
|
||||
template<typename ValueType>
|
||||
const ValueType * unsafe_any_cast(const any * operand)
|
||||
{
|
||||
return any_cast<ValueType>(const_cast<any *>(operand));
|
||||
}
|
||||
}
|
||||
|
||||
// Copyright Kevlin Henney, 2000, 2001, 2002. All rights reserved.
|
||||
|
@ -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
|
||||
|
@ -12,6 +12,7 @@
|
||||
//
|
||||
// Copyright (c) 2001-2004 Peter Dimov and Multi Media Ltd.
|
||||
// Copyright (c) 2001 David Abrahams
|
||||
// Copyright (c) 2005 Peter Dimov
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
@ -128,7 +129,7 @@ template<class F> inline F & unwrap(reference_wrapper<F> const * f, int)
|
||||
return f->get();
|
||||
}
|
||||
|
||||
#if !( defined(__MWERKS__) && BOOST_WORKAROUND(__MWERKS__, <= 0x3003) )
|
||||
#if !( defined(__MWERKS__) && BOOST_WORKAROUND(__MWERKS__, <= 0x3004) )
|
||||
|
||||
template<class R, class T> inline _mfi::dm<R, T> unwrap(R T::* * pm, int)
|
||||
{
|
||||
@ -154,9 +155,9 @@ public:
|
||||
|
||||
list0() {}
|
||||
|
||||
template<class T> T & operator[] (value<T> & v) const { return v.get(); }
|
||||
template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
|
||||
|
||||
template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
|
||||
template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
|
||||
|
||||
template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
|
||||
|
||||
@ -204,9 +205,9 @@ public:
|
||||
|
||||
A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
|
||||
|
||||
template<class T> T & operator[] (value<T> & v) const { return v.get(); }
|
||||
template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
|
||||
|
||||
template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
|
||||
template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
|
||||
|
||||
template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
|
||||
|
||||
@ -261,9 +262,9 @@ public:
|
||||
A1 operator[] (boost::arg<1> (*) ()) const { return a1_; }
|
||||
A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
|
||||
|
||||
template<class T> T & operator[] (value<T> & v) const { return v.get(); }
|
||||
template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
|
||||
|
||||
template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
|
||||
template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
|
||||
|
||||
template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
|
||||
|
||||
@ -322,9 +323,9 @@ public:
|
||||
A2 operator[] (boost::arg<2> (*) ()) const { return a2_; }
|
||||
A3 operator[] (boost::arg<3> (*) ()) const { return a3_; }
|
||||
|
||||
template<class T> T & operator[] (value<T> & v) const { return v.get(); }
|
||||
template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
|
||||
|
||||
template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
|
||||
template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
|
||||
|
||||
template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
|
||||
|
||||
@ -387,9 +388,9 @@ public:
|
||||
A3 operator[] (boost::arg<3> (*) ()) const { return a3_; }
|
||||
A4 operator[] (boost::arg<4> (*) ()) const { return a4_; }
|
||||
|
||||
template<class T> T & operator[] (value<T> & v) const { return v.get(); }
|
||||
template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
|
||||
|
||||
template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
|
||||
template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
|
||||
|
||||
template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
|
||||
|
||||
@ -458,9 +459,9 @@ public:
|
||||
A4 operator[] (boost::arg<4> (*) ()) const { return a4_; }
|
||||
A5 operator[] (boost::arg<5> (*) ()) const { return a5_; }
|
||||
|
||||
template<class T> T & operator[] (value<T> & v) const { return v.get(); }
|
||||
template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
|
||||
|
||||
template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
|
||||
template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
|
||||
|
||||
template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
|
||||
|
||||
@ -533,9 +534,9 @@ public:
|
||||
A5 operator[] (boost::arg<5> (*) ()) const { return a5_; }
|
||||
A6 operator[] (boost::arg<6> (*) ()) const { return a6_; }
|
||||
|
||||
template<class T> T & operator[] (value<T> & v) const { return v.get(); }
|
||||
template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
|
||||
|
||||
template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
|
||||
template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
|
||||
|
||||
template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
|
||||
|
||||
@ -612,9 +613,9 @@ public:
|
||||
A6 operator[] (boost::arg<6> (*) ()) const { return a6_; }
|
||||
A7 operator[] (boost::arg<7> (*) ()) const { return a7_; }
|
||||
|
||||
template<class T> T & operator[] (value<T> & v) const { return v.get(); }
|
||||
template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
|
||||
|
||||
template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
|
||||
template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
|
||||
|
||||
template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
|
||||
|
||||
@ -696,9 +697,9 @@ public:
|
||||
A7 operator[] (boost::arg<7> (*) ()) const { return a7_; }
|
||||
A8 operator[] (boost::arg<8> (*) ()) const { return a8_; }
|
||||
|
||||
template<class T> T & operator[] (value<T> & v) const { return v.get(); }
|
||||
template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
|
||||
|
||||
template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
|
||||
template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
|
||||
|
||||
template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
|
||||
|
||||
@ -784,9 +785,9 @@ public:
|
||||
A8 operator[] (boost::arg<8> (*) ()) const { return a8_; }
|
||||
A9 operator[] (boost::arg<9> (*) ()) const { return a9_; }
|
||||
|
||||
template<class T> T & operator[] (value<T> & v) const { return v.get(); }
|
||||
template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
|
||||
|
||||
template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
|
||||
template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
|
||||
|
||||
template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
|
||||
|
||||
@ -920,30 +921,67 @@ public:
|
||||
|
||||
#endif
|
||||
|
||||
// bind_t::operator==
|
||||
// function_equal
|
||||
|
||||
template<class R, class F, class L> bool operator==(bind_t<R, F, L> const & a, bind_t<R, F, L> const & b)
|
||||
#ifndef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
|
||||
|
||||
// put overloads in _bi, rely on ADL
|
||||
|
||||
# ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
|
||||
|
||||
template<class R, class F, class L> bool function_equal( bind_t<R, F, L> const & a, bind_t<R, F, L> const & b )
|
||||
{
|
||||
return a.compare(b);
|
||||
}
|
||||
|
||||
template<class R, class F, class L> bool operator!=(bind_t<R, F, L> const & a, bind_t<R, F, L> const & b)
|
||||
# else
|
||||
|
||||
template<class R, class F, class L> bool function_equal_impl( bind_t<R, F, L> const & a, bind_t<R, F, L> const & b, int )
|
||||
{
|
||||
return !a.compare(b);
|
||||
return a.compare(b);
|
||||
}
|
||||
|
||||
# endif // #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
|
||||
|
||||
#else // BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
|
||||
|
||||
// put overloads in boost
|
||||
|
||||
} // namespace _bi
|
||||
|
||||
# ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
|
||||
|
||||
template<class R, class F, class L> bool function_equal( _bi::bind_t<R, F, L> const & a, _bi::bind_t<R, F, L> const & b )
|
||||
{
|
||||
return a.compare(b);
|
||||
}
|
||||
|
||||
# else
|
||||
|
||||
template<class R, class F, class L> bool function_equal_impl( _bi::bind_t<R, F, L> const & a, _bi::bind_t<R, F, L> const & b, int )
|
||||
{
|
||||
return a.compare(b);
|
||||
}
|
||||
|
||||
# endif // #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
|
||||
|
||||
namespace _bi
|
||||
{
|
||||
|
||||
#endif // BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
|
||||
|
||||
// add_value
|
||||
|
||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || (__SUNPRO_CC >= 0x530)
|
||||
|
||||
template<class T> struct add_value
|
||||
{
|
||||
typedef value<T> type;
|
||||
typedef _bi::value<T> type;
|
||||
};
|
||||
|
||||
template<class T> struct add_value< value<T> >
|
||||
{
|
||||
typedef value<T> type;
|
||||
typedef _bi::value<T> type;
|
||||
};
|
||||
|
||||
template<class T> struct add_value< reference_wrapper<T> >
|
||||
@ -1097,6 +1135,71 @@ template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, c
|
||||
typedef list9<B1, B2, B3, B4, B5, B6, B7, B8, B9> type;
|
||||
};
|
||||
|
||||
// operator!
|
||||
|
||||
struct logical_not
|
||||
{
|
||||
template<class V> bool operator()(V const & v) const { return !v; }
|
||||
};
|
||||
|
||||
template<class R, class F, class L>
|
||||
bind_t< bool, logical_not, list1< bind_t<R, F, L> > >
|
||||
operator! (bind_t<R, F, L> const & f)
|
||||
{
|
||||
typedef list1< bind_t<R, F, L> > list_type;
|
||||
return bind_t<bool, logical_not, list_type> ( logical_not(), list_type(f) );
|
||||
}
|
||||
|
||||
// relational operators
|
||||
|
||||
#define BOOST_BIND_OPERATOR( op, name ) \
|
||||
\
|
||||
struct name \
|
||||
{ \
|
||||
template<class V, class W> bool operator()(V const & v, W const & w) const { return v op w; } \
|
||||
}; \
|
||||
\
|
||||
template<class R, class F, class L, class A2> \
|
||||
bind_t< bool, name, list2< bind_t<R, F, L>, typename add_value<A2>::type > > \
|
||||
operator op (bind_t<R, F, L> const & f, A2 a2) \
|
||||
{ \
|
||||
typedef typename add_value<A2>::type B2; \
|
||||
typedef list2< bind_t<R, F, L>, B2> list_type; \
|
||||
return bind_t<bool, name, list_type> ( name(), list_type(f, a2) ); \
|
||||
}
|
||||
|
||||
BOOST_BIND_OPERATOR( ==, equal )
|
||||
BOOST_BIND_OPERATOR( !=, not_equal )
|
||||
|
||||
BOOST_BIND_OPERATOR( <, less )
|
||||
BOOST_BIND_OPERATOR( <=, less_equal )
|
||||
|
||||
BOOST_BIND_OPERATOR( >, greater )
|
||||
BOOST_BIND_OPERATOR( >=, greater_equal )
|
||||
|
||||
#undef BOOST_BIND_OPERATOR
|
||||
|
||||
#if defined(__GNUC__) && BOOST_WORKAROUND(__GNUC__, < 3)
|
||||
|
||||
// resolve ambiguity with rel_ops
|
||||
|
||||
#define BOOST_BIND_OPERATOR( op, name ) \
|
||||
\
|
||||
template<class R, class F, class L> \
|
||||
bind_t< bool, name, list2< bind_t<R, F, L>, bind_t<R, F, L> > > \
|
||||
operator op (bind_t<R, F, L> const & f, bind_t<R, F, L> const & g) \
|
||||
{ \
|
||||
typedef list2< bind_t<R, F, L>, bind_t<R, F, L> > list_type; \
|
||||
return bind_t<bool, name, list_type> ( name(), list_type(f, g) ); \
|
||||
}
|
||||
|
||||
BOOST_BIND_OPERATOR( !=, not_equal )
|
||||
BOOST_BIND_OPERATOR( <=, less_equal )
|
||||
BOOST_BIND_OPERATOR( >, greater )
|
||||
BOOST_BIND_OPERATOR( >=, greater_equal )
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace _bi
|
||||
|
||||
// visit_each
|
||||
@ -1423,6 +1526,18 @@ template<class F, class A1, class A2, class A3, class A4, class A5, class A6, cl
|
||||
#undef BOOST_BIND_MF_NAME
|
||||
#undef BOOST_BIND_MF_CC
|
||||
|
||||
#ifdef BOOST_MEM_FN_ENABLE_CDECL
|
||||
|
||||
#define BOOST_BIND_MF_NAME(X) X##_cdecl
|
||||
#define BOOST_BIND_MF_CC __cdecl
|
||||
|
||||
#include <boost/bind/bind_mf_cc.hpp>
|
||||
|
||||
#undef BOOST_BIND_MF_NAME
|
||||
#undef BOOST_BIND_MF_CC
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_MEM_FN_ENABLE_STDCALL
|
||||
|
||||
#define BOOST_BIND_MF_NAME(X) X##_stdcall
|
||||
|
@ -8,6 +8,7 @@
|
||||
// See http://www.boost.org/libs/conversion for Documentation.
|
||||
|
||||
// Revision History
|
||||
// 23 JUn 05 numeric_cast removed and redirected to the new verion (Fernando Cacciola)
|
||||
// 02 Apr 01 Removed BOOST_NO_LIMITS workarounds and included
|
||||
// <boost/limits.hpp> instead (the workaround did not
|
||||
// actually compile when BOOST_NO_LIMITS was defined in
|
||||
@ -95,290 +96,10 @@ namespace boost
|
||||
return static_cast<Target>(x);
|
||||
}
|
||||
|
||||
// implicit_cast -----------------------------------------------------------//
|
||||
//
|
||||
// Removed due to uncertain purpose. Use either numeric_cast (see below)
|
||||
// or static_cast according to the need.
|
||||
|
||||
// numeric_cast and related exception --------------------------------------//
|
||||
|
||||
// Contributed by Kevlin Henney
|
||||
|
||||
// bad_numeric_cast --------------------------------------------------------//
|
||||
|
||||
// exception used to indicate runtime numeric_cast failure
|
||||
class bad_numeric_cast : public std::bad_cast
|
||||
{
|
||||
public:
|
||||
// constructors, destructors and assignment operator defaulted
|
||||
|
||||
// function inlined for brevity and consistency with rest of library
|
||||
virtual const char *what() const throw()
|
||||
{
|
||||
return "bad numeric cast: loss of range in numeric_cast";
|
||||
}
|
||||
};
|
||||
|
||||
// numeric_cast ------------------------------------------------------------//
|
||||
|
||||
#if !defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS) || defined(BOOST_SGI_CPP_LIMITS)
|
||||
|
||||
namespace detail
|
||||
{
|
||||
template <class T>
|
||||
struct signed_numeric_limits : std::numeric_limits<T>
|
||||
{
|
||||
static inline T min BOOST_PREVENT_MACRO_SUBSTITUTION ()
|
||||
{
|
||||
return (std::numeric_limits<T>::min)() >= 0
|
||||
// unary minus causes integral promotion, thus the static_cast<>
|
||||
? static_cast<T>(-(std::numeric_limits<T>::max)())
|
||||
: (std::numeric_limits<T>::min)();
|
||||
};
|
||||
};
|
||||
|
||||
// Move to namespace boost in utility.hpp?
|
||||
template <class T, bool specialized>
|
||||
struct fixed_numeric_limits_base
|
||||
: public if_true< std::numeric_limits<T>::is_signed >
|
||||
::BOOST_NESTED_TEMPLATE then< signed_numeric_limits<T>,
|
||||
std::numeric_limits<T>
|
||||
>::type
|
||||
{};
|
||||
|
||||
template <class T>
|
||||
struct fixed_numeric_limits
|
||||
: fixed_numeric_limits_base<T,(std::numeric_limits<T>::is_specialized)>
|
||||
{};
|
||||
|
||||
# ifdef BOOST_HAS_LONG_LONG
|
||||
// cover implementations which supply no specialization for long
|
||||
// long / unsigned long long. Not intended to be full
|
||||
// numeric_limits replacements, but good enough for numeric_cast<>
|
||||
template <>
|
||||
struct fixed_numeric_limits_base< ::boost::long_long_type, false>
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(bool, is_specialized = true);
|
||||
BOOST_STATIC_CONSTANT(bool, is_signed = true);
|
||||
static ::boost::long_long_type max BOOST_PREVENT_MACRO_SUBSTITUTION ()
|
||||
{
|
||||
# ifdef LONGLONG_MAX
|
||||
return LONGLONG_MAX;
|
||||
# else
|
||||
return 9223372036854775807LL; // hope this is portable
|
||||
# endif
|
||||
}
|
||||
|
||||
static ::boost::long_long_type min BOOST_PREVENT_MACRO_SUBSTITUTION ()
|
||||
{
|
||||
# ifdef LONGLONG_MIN
|
||||
return LONGLONG_MIN;
|
||||
# else
|
||||
return -( 9223372036854775807LL )-1; // hope this is portable
|
||||
# endif
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct fixed_numeric_limits_base< ::boost::ulong_long_type, false>
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(bool, is_specialized = true);
|
||||
BOOST_STATIC_CONSTANT(bool, is_signed = false);
|
||||
static ::boost::ulong_long_type max BOOST_PREVENT_MACRO_SUBSTITUTION ()
|
||||
{
|
||||
# ifdef ULONGLONG_MAX
|
||||
return ULONGLONG_MAX;
|
||||
# else
|
||||
return 0xffffffffffffffffULL; // hope this is portable
|
||||
# endif
|
||||
}
|
||||
|
||||
static ::boost::ulong_long_type min BOOST_PREVENT_MACRO_SUBSTITUTION () { return 0; }
|
||||
};
|
||||
# endif
|
||||
} // namespace detail
|
||||
|
||||
// less_than_type_min -
|
||||
// x_is_signed should be numeric_limits<X>::is_signed
|
||||
// y_is_signed should be numeric_limits<Y>::is_signed
|
||||
// y_min should be numeric_limits<Y>::min()
|
||||
//
|
||||
// check(x, y_min) returns true iff x < y_min without invoking comparisons
|
||||
// between signed and unsigned values.
|
||||
//
|
||||
// "poor man's partial specialization" is in use here.
|
||||
template <bool x_is_signed, bool y_is_signed>
|
||||
struct less_than_type_min
|
||||
{
|
||||
template <class X, class Y>
|
||||
static bool check(X x, Y y_min)
|
||||
{ return x < y_min; }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct less_than_type_min<false, true>
|
||||
{
|
||||
template <class X, class Y>
|
||||
static bool check(X, Y)
|
||||
{ return false; }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct less_than_type_min<true, false>
|
||||
{
|
||||
template <class X, class Y>
|
||||
static bool check(X x, Y)
|
||||
{ return x < 0; }
|
||||
};
|
||||
|
||||
// greater_than_type_max -
|
||||
// same_sign should be:
|
||||
// numeric_limits<X>::is_signed == numeric_limits<Y>::is_signed
|
||||
// y_max should be numeric_limits<Y>::max()
|
||||
//
|
||||
// check(x, y_max) returns true iff x > y_max without invoking comparisons
|
||||
// between signed and unsigned values.
|
||||
//
|
||||
// "poor man's partial specialization" is in use here.
|
||||
template <bool same_sign, bool x_is_signed>
|
||||
struct greater_than_type_max;
|
||||
|
||||
template<>
|
||||
struct greater_than_type_max<true, true>
|
||||
{
|
||||
template <class X, class Y>
|
||||
static inline bool check(X x, Y y_max)
|
||||
{ return x > y_max; }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct greater_than_type_max<false, true>
|
||||
{
|
||||
// What does the standard say about this? I think it's right, and it
|
||||
// will work with every compiler I know of.
|
||||
template <class X, class Y>
|
||||
static inline bool check(X x, Y)
|
||||
{ return x >= 0 && static_cast<X>(static_cast<Y>(x)) != x; }
|
||||
|
||||
# if defined(BOOST_MSVC) && BOOST_MSVC <= 1200
|
||||
// MSVC6 can't static_cast unsigned __int64 -> floating types
|
||||
# define BOOST_UINT64_CAST(src_type) \
|
||||
static inline bool check(src_type x, unsigned __int64) \
|
||||
{ \
|
||||
if (x < 0) return false; \
|
||||
unsigned __int64 y = static_cast<unsigned __int64>(x); \
|
||||
bool odd = y & 0x1; \
|
||||
__int64 div2 = static_cast<__int64>(y >> 1); \
|
||||
return ((static_cast<src_type>(div2) * 2.0) + odd) != x; \
|
||||
}
|
||||
|
||||
BOOST_UINT64_CAST(long double);
|
||||
BOOST_UINT64_CAST(double);
|
||||
BOOST_UINT64_CAST(float);
|
||||
# undef BOOST_UINT64_CAST
|
||||
# endif
|
||||
};
|
||||
|
||||
template<>
|
||||
struct greater_than_type_max<true, false>
|
||||
{
|
||||
template <class X, class Y>
|
||||
static inline bool check(X x, Y y_max)
|
||||
{ return x > y_max; }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct greater_than_type_max<false, false>
|
||||
{
|
||||
// What does the standard say about this? I think it's right, and it
|
||||
// will work with every compiler I know of.
|
||||
template <class X, class Y>
|
||||
static inline bool check(X x, Y)
|
||||
{ return static_cast<X>(static_cast<Y>(x)) != x; }
|
||||
};
|
||||
|
||||
#else // use #pragma hacks if available
|
||||
|
||||
namespace detail
|
||||
{
|
||||
# if BOOST_MSVC
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable : 4018)
|
||||
# pragma warning(disable : 4146)
|
||||
#elif defined(__BORLANDC__)
|
||||
# pragma option push -w-8041
|
||||
# endif
|
||||
|
||||
// Move to namespace boost in utility.hpp?
|
||||
template <class T>
|
||||
struct fixed_numeric_limits : public std::numeric_limits<T>
|
||||
{
|
||||
static inline T min BOOST_PREVENT_MACRO_SUBSTITUTION ()
|
||||
{
|
||||
return std::numeric_limits<T>::is_signed && (std::numeric_limits<T>::min)() >= 0
|
||||
? T(-(std::numeric_limits<T>::max)()) : (std::numeric_limits<T>::min)();
|
||||
}
|
||||
};
|
||||
|
||||
# if BOOST_MSVC
|
||||
# pragma warning(pop)
|
||||
#elif defined(__BORLANDC__)
|
||||
# pragma option pop
|
||||
# endif
|
||||
} // namespace detail
|
||||
|
||||
#endif
|
||||
|
||||
template<typename Target, typename Source>
|
||||
inline Target numeric_cast(Source arg BOOST_EXPLICIT_DEFAULT_TARGET)
|
||||
{
|
||||
// typedefs abbreviating respective trait classes
|
||||
typedef detail::fixed_numeric_limits<Source> arg_traits;
|
||||
typedef detail::fixed_numeric_limits<Target> result_traits;
|
||||
|
||||
#if defined(BOOST_STRICT_CONFIG) \
|
||||
|| (!defined(__HP_aCC) || __HP_aCC > 33900) \
|
||||
&& (!defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS) \
|
||||
|| defined(BOOST_SGI_CPP_LIMITS))
|
||||
// typedefs that act as compile time assertions
|
||||
// (to be replaced by boost compile time assertions
|
||||
// as and when they become available and are stable)
|
||||
typedef bool argument_must_be_numeric[arg_traits::is_specialized];
|
||||
typedef bool result_must_be_numeric[result_traits::is_specialized];
|
||||
|
||||
const bool arg_is_signed = arg_traits::is_signed;
|
||||
const bool result_is_signed = result_traits::is_signed;
|
||||
const bool same_sign = arg_is_signed == result_is_signed;
|
||||
|
||||
if (less_than_type_min<arg_is_signed, result_is_signed>::check(arg, (result_traits::min)())
|
||||
|| greater_than_type_max<same_sign, arg_is_signed>::check(arg, (result_traits::max)())
|
||||
)
|
||||
|
||||
#else // We need to use #pragma hacks if available
|
||||
|
||||
# if BOOST_MSVC
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable : 4018)
|
||||
#elif defined(__BORLANDC__)
|
||||
#pragma option push -w-8012
|
||||
# endif
|
||||
if ((arg < 0 && !result_traits::is_signed) // loss of negative range
|
||||
|| (arg_traits::is_signed && arg < (result_traits::min)()) // underflow
|
||||
|| arg > (result_traits::max)()) // overflow
|
||||
# if BOOST_MSVC
|
||||
# pragma warning(pop)
|
||||
#elif defined(__BORLANDC__)
|
||||
#pragma option pop
|
||||
# endif
|
||||
#endif
|
||||
{
|
||||
throw bad_numeric_cast();
|
||||
}
|
||||
return static_cast<Target>(arg);
|
||||
} // numeric_cast
|
||||
|
||||
# undef BOOST_EXPLICIT_DEFAULT_TARGET
|
||||
|
||||
} // namespace boost
|
||||
|
||||
# include <boost/numeric/conversion/cast.hpp>
|
||||
|
||||
#endif // BOOST_CAST_HPP
|
||||
|
@ -688,12 +688,12 @@ struct require_same { typedef T type; };
|
||||
function_requires< AssignableConcept<Container> >();
|
||||
const_constraints(c);
|
||||
}
|
||||
void const_constraints(const Container& c) {
|
||||
i = c.begin();
|
||||
i = c.end();
|
||||
n = c.size();
|
||||
n = c.max_size();
|
||||
b = c.empty();
|
||||
void const_constraints(const Container& cc) {
|
||||
i = cc.begin();
|
||||
i = cc.end();
|
||||
n = cc.size();
|
||||
n = cc.max_size();
|
||||
b = cc.empty();
|
||||
}
|
||||
Container c;
|
||||
bool b;
|
||||
@ -757,9 +757,9 @@ struct require_same { typedef T type; };
|
||||
BidirectionalIteratorConcept<const_reverse_iterator> >();
|
||||
const_constraints(c);
|
||||
}
|
||||
void const_constraints(const ReversibleContainer& c) {
|
||||
const_reverse_iterator i = c.rbegin();
|
||||
i = c.rend();
|
||||
void const_constraints(const ReversibleContainer& cc) {
|
||||
const_reverse_iterator i = cc.rbegin();
|
||||
i = cc.rend();
|
||||
}
|
||||
ReversibleContainer c;
|
||||
};
|
||||
@ -801,8 +801,8 @@ struct require_same { typedef T type; };
|
||||
|
||||
const_constraints(c);
|
||||
}
|
||||
void const_constraints(const RandomAccessContainer& c) {
|
||||
const_reference r = c[n];
|
||||
void const_constraints(const RandomAccessContainer& cc) {
|
||||
const_reference r = cc[n];
|
||||
ignore_unused_variable_warning(r);
|
||||
}
|
||||
RandomAccessContainer c;
|
||||
@ -905,8 +905,8 @@ struct require_same { typedef T type; };
|
||||
reference r = c.back();
|
||||
ignore_unused_variable_warning(r);
|
||||
}
|
||||
void const_constraints(const BackInsertionSequence& c) {
|
||||
const_reference r = c.back();
|
||||
void const_constraints(const BackInsertionSequence& cc) {
|
||||
const_reference r = cc.back();
|
||||
ignore_unused_variable_warning(r);
|
||||
};
|
||||
BackInsertionSequence c;
|
||||
@ -927,10 +927,10 @@ struct require_same { typedef T type; };
|
||||
c.erase(r.first, r.second);
|
||||
const_constraints(c);
|
||||
}
|
||||
void const_constraints(const AssociativeContainer& c) {
|
||||
ci = c.find(k);
|
||||
n = c.count(k);
|
||||
cr = c.equal_range(k);
|
||||
void const_constraints(const AssociativeContainer& cc) {
|
||||
ci = cc.find(k);
|
||||
n = cc.count(k);
|
||||
cr = cc.equal_range(k);
|
||||
}
|
||||
typedef typename AssociativeContainer::iterator iterator;
|
||||
typedef typename AssociativeContainer::const_iterator const_iterator;
|
||||
|
@ -19,9 +19,12 @@ Before including this header you must define one or more of define the following
|
||||
|
||||
BOOST_LIB_NAME: Required: A string containing the basename of the library,
|
||||
for example boost_regex.
|
||||
BOOST_LIB_TOOLSET: Optional: the base name of the toolset.
|
||||
BOOST_DYN_LINK: Optional: when set link to dll rather than static library.
|
||||
BOOST_LIB_DIAGNOSTIC: Optional: when set the header will print out the name
|
||||
of the library selected (useful for debugging).
|
||||
BOOST_AUTO_LINK_NOMANGLE: Specifies that we should link to BOOST_LIB_NAME.lib,
|
||||
rather than a mangled-name version.
|
||||
|
||||
These macros will be undef'ed at the end of the header, further this header
|
||||
has no include guards - so be sure to include it only once from your library!
|
||||
@ -103,8 +106,9 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y.
|
||||
# error "Incompatible build options"
|
||||
#endif
|
||||
//
|
||||
// select toolset:
|
||||
// select toolset if not defined already:
|
||||
//
|
||||
#ifndef BOOST_LIB_TOOLSET
|
||||
#if defined(BOOST_MSVC) && (BOOST_MSVC == 1200)
|
||||
|
||||
// vc6:
|
||||
@ -146,6 +150,7 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y.
|
||||
# define BOOST_LIB_TOOLSET "cw9"
|
||||
|
||||
#endif
|
||||
#endif // BOOST_LIB_TOOLSET
|
||||
|
||||
//
|
||||
// select thread opt:
|
||||
@ -237,7 +242,9 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y.
|
||||
//
|
||||
// figure out whether we want the debug builds or not:
|
||||
//
|
||||
#if __BORLANDC__ > 0x561
|
||||
#pragma defineonoption BOOST_BORLAND_DEBUG -v
|
||||
#endif
|
||||
//
|
||||
// sanity check:
|
||||
//
|
||||
@ -286,9 +293,16 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y.
|
||||
&& defined(BOOST_LIB_RT_OPT) \
|
||||
&& defined(BOOST_LIB_VERSION)
|
||||
|
||||
#ifndef BOOST_AUTO_LINK_NOMANGLE
|
||||
# pragma comment(lib, BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) "-" BOOST_LIB_TOOLSET BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT "-" BOOST_LIB_VERSION ".lib")
|
||||
#ifdef BOOST_LIB_DIAGNOSTIC
|
||||
# ifdef BOOST_LIB_DIAGNOSTIC
|
||||
# pragma message ("Linking to lib file: " BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) "-" BOOST_LIB_TOOLSET BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT "-" BOOST_LIB_VERSION ".lib")
|
||||
# endif
|
||||
#else
|
||||
# pragma comment(lib, BOOST_STRINGIZE(BOOST_LIB_NAME) ".lib")
|
||||
# ifdef BOOST_LIB_DIAGNOSTIC
|
||||
# pragma message ("Linking to lib file: " BOOST_STRINGIZE(BOOST_LIB_NAME) ".lib")
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#else
|
||||
@ -307,9 +321,11 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y.
|
||||
#if defined(BOOST_LIB_NAME)
|
||||
# undef BOOST_LIB_NAME
|
||||
#endif
|
||||
#if defined(BOOST_LIB_TOOLSET)
|
||||
# undef BOOST_LIB_TOOLSET
|
||||
#endif
|
||||
// Don't undef this one: it can be set by the user and should be the
|
||||
// same for all libraries:
|
||||
//#if defined(BOOST_LIB_TOOLSET)
|
||||
//# undef BOOST_LIB_TOOLSET
|
||||
//#endif
|
||||
#if defined(BOOST_LIB_THREAD_OPT)
|
||||
# undef BOOST_LIB_THREAD_OPT
|
||||
#endif
|
||||
@ -325,6 +341,11 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y.
|
||||
#if defined(BOOST_DYN_LINK)
|
||||
# undef BOOST_DYN_LINK
|
||||
#endif
|
||||
#if defined(BOOST_AUTO_LINK_NOMANGLE)
|
||||
# undef BOOST_AUTO_LINK_NOMANGLE
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -36,12 +36,9 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (__BORLANDC__ <= 0x564)
|
||||
# define BOOST_NO_SFINAE
|
||||
#endif
|
||||
|
||||
// Version 7.0 (Kylix) and below:
|
||||
#if (__BORLANDC__ <= 0x570)
|
||||
# define BOOST_NO_SFINAE
|
||||
# define BOOST_NO_INTEGRAL_INT64_T
|
||||
# define BOOST_NO_DEPENDENT_NESTED_DERIVATIONS
|
||||
# define BOOST_NO_PRIVATE_IN_AGGREGATE
|
||||
@ -54,6 +51,7 @@
|
||||
// without it, this needs more investigation:
|
||||
# define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
|
||||
# define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
|
||||
# define BOOST_NO_IS_ABSTRACT
|
||||
# ifdef NDEBUG
|
||||
// fix broken <cstring> so that Boost.test works:
|
||||
# include <cstring>
|
||||
|
@ -16,8 +16,6 @@
|
||||
|
||||
#if (__COMO_VERSION__ <= 4245)
|
||||
|
||||
# define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
|
||||
|
||||
# if defined(_MSC_VER) && _MSC_VER <= 1300
|
||||
# if _MSC_VER > 100
|
||||
// only set this in non-strict mode:
|
||||
|
@ -2,6 +2,7 @@
|
||||
// (C) Copyright Jens Maurer 2001.
|
||||
// (C) Copyright David Abrahams 2002.
|
||||
// (C) Copyright Aleksey Gurtovoy 2002.
|
||||
// (C) Copyright Markus Schoepflin 2005.
|
||||
// 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)
|
||||
@ -34,6 +35,14 @@
|
||||
# define BOOST_NO_TEMPLATE_TEMPLATES
|
||||
#endif
|
||||
|
||||
#if (__EDG_VERSION__ < 300) && !defined(BOOST_NO_IS_ABSTRACT)
|
||||
# define BOOST_NO_IS_ABSTRACT
|
||||
#endif
|
||||
|
||||
#if (__EDG_VERSION__ <= 303) && !defined(BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL)
|
||||
# define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
|
||||
#endif
|
||||
|
||||
// See also kai.hpp which checks a Kai-specific symbol for EH
|
||||
# if !defined(__KCC) && !defined(__EXCEPTIONS)
|
||||
# define BOOST_NO_EXCEPTIONS
|
||||
|
@ -15,6 +15,5 @@
|
||||
// versions check:
|
||||
// Nothing to do here?
|
||||
|
||||
# define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
|
||||
|
||||
|
||||
|
@ -13,11 +13,12 @@
|
||||
|
||||
// GNU C++ compiler setup:
|
||||
|
||||
# if __GNUC__ == 2 && __GNUC_MINOR__ == 91
|
||||
#if __GNUC__ < 3
|
||||
# if __GNUC_MINOR__ == 91
|
||||
// egcs 1.1 won't parse shared_ptr.hpp without this:
|
||||
# define BOOST_NO_AUTO_PTR
|
||||
# endif
|
||||
# if __GNUC__ == 2 && __GNUC_MINOR__ < 95
|
||||
# if __GNUC_MINOR__ < 95
|
||||
//
|
||||
// Prior to gcc 2.95 member templates only partly
|
||||
// work - define BOOST_MSVC6_MEMBER_TEMPLATES
|
||||
@ -29,30 +30,36 @@
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# if __GNUC__ == 2 && __GNUC_MINOR__ < 96
|
||||
# if __GNUC_MINOR__ < 96
|
||||
# define BOOST_NO_SFINAE
|
||||
# endif
|
||||
|
||||
# if __GNUC__ == 2 && __GNUC_MINOR__ <= 97
|
||||
# if __GNUC_MINOR__ <= 97
|
||||
# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
# define BOOST_NO_OPERATORS_IN_NAMESPACE
|
||||
# endif
|
||||
|
||||
# if __GNUC__ < 3
|
||||
# define BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE
|
||||
# define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
|
||||
# define BOOST_NO_IS_ABSTRACT
|
||||
#elif __GNUC__ == 3
|
||||
//
|
||||
// gcc-3.x problems:
|
||||
//
|
||||
// Bug specific to gcc 3.1 and 3.2:
|
||||
//
|
||||
# if ((__GNUC_MINOR__ == 1) || (__GNUC_MINOR__ == 2))
|
||||
# define BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
|
||||
# endif
|
||||
# if __GNUC_MINOR__ < 4
|
||||
# define BOOST_NO_IS_ABSTRACT
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef __EXCEPTIONS
|
||||
# define BOOST_NO_EXCEPTIONS
|
||||
#endif
|
||||
|
||||
//
|
||||
// Bug specific to gcc 3.1 and 3.2:
|
||||
//
|
||||
#if (__GNUC__ == 3) && ((__GNUC_MINOR__ == 1) || (__GNUC_MINOR__ == 2))
|
||||
# define BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
|
||||
#endif
|
||||
|
||||
//
|
||||
// Threading support: Turn this on unconditionally here (except for
|
||||
@ -84,12 +91,14 @@
|
||||
# error "Compiler not configured - please reconfigure"
|
||||
#endif
|
||||
//
|
||||
// last known and checked version is 3.4:
|
||||
// last known and checked version is 4.0 (Pre-release):
|
||||
#if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 0))
|
||||
# if defined(BOOST_ASSERT_CONFIG)
|
||||
# error "Unknown compiler version - please run the configure tests and report the results"
|
||||
# else
|
||||
# warning "Unknown compiler version - please run the configure tests and report the results"
|
||||
// we don't emit warnings here anymore since there are no defect macros defined for
|
||||
// gcc post 3.4, so any failures are gcc regressions...
|
||||
//# warning "Unknown compiler version - please run the configure tests and report the results"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
@ -32,6 +32,7 @@
|
||||
# define BOOST_NO_TEMPLATE_TEMPLATES
|
||||
# define BOOST_NO_SWPRINTF
|
||||
# define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
|
||||
# define BOOST_NO_IS_ABSTRACT
|
||||
// std lib config should set this one already:
|
||||
//# define BOOST_NO_STD_ALLOCATOR
|
||||
#endif
|
||||
|
@ -88,6 +88,15 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && !defined(BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL)
|
||||
//
|
||||
// Figure out when Intel is emulating this gcc bug:
|
||||
//
|
||||
# if ((__GNUC__ == 3) && (__GNUC_MINOR__ <= 2)) || (BOOST_INTEL <= 900)
|
||||
# define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
|
||||
# endif
|
||||
#endif
|
||||
|
||||
//
|
||||
// Verify that we have actually got BOOST_NO_INTRINSIC_WCHAR_T
|
||||
// set correctly, if we don't do this now, we will get errors later
|
||||
@ -108,11 +117,6 @@ template<> struct assert_intrinsic_wchar_t<wchar_t> {};
|
||||
template<> struct assert_intrinsic_wchar_t<unsigned short> {};
|
||||
#endif
|
||||
|
||||
|
||||
#if (BOOST_INTEL_CXX_VERSION <= 800) || !defined(BOOST_STRICT_CONFIG)
|
||||
# define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
|
||||
#endif
|
||||
|
||||
#if _MSC_VER+0 >= 1000
|
||||
# if _MSC_VER >= 1200
|
||||
# define BOOST_HAS_MS_INT64
|
||||
@ -137,7 +141,7 @@ template<> struct assert_intrinsic_wchar_t<unsigned short> {};
|
||||
#endif
|
||||
//
|
||||
// last known and checked version:
|
||||
#if (BOOST_INTEL_CXX_VERSION > 810)
|
||||
#if (BOOST_INTEL_CXX_VERSION > 900)
|
||||
# if defined(BOOST_ASSERT_CONFIG)
|
||||
# error "Unknown compiler version - please run the configure tests and report the results"
|
||||
# elif defined(_MSC_VER)
|
||||
|
@ -37,8 +37,11 @@
|
||||
# define BOOST_NO_SFINAE
|
||||
# endif
|
||||
|
||||
# if(__MWERKS__ <= 0x3204) // 9.3
|
||||
// the "|| !defined(BOOST_STRICT_CONFIG)" part should apply to the last
|
||||
// tested version *only*:
|
||||
# if(__MWERKS__ <= 0x3206) || !defined(BOOST_STRICT_CONFIG) // 9.5
|
||||
# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
# define BOOST_NO_IS_ABSTRACT
|
||||
# endif
|
||||
|
||||
#if !__option(wchar_type)
|
||||
@ -66,6 +69,10 @@
|
||||
# define BOOST_COMPILER_VERSION 9.2
|
||||
# elif __MWERKS__ == 0x3204
|
||||
# define BOOST_COMPILER_VERSION 9.3
|
||||
# elif __MWERKS__ == 0x3205
|
||||
# define BOOST_COMPILER_VERSION 9.4
|
||||
# elif __MWERKS__ == 0x3206
|
||||
# define BOOST_COMPILER_VERSION 9.5
|
||||
# else
|
||||
# define BOOST_COMPILER_VERSION __MWERKS__
|
||||
# endif
|
||||
@ -83,7 +90,7 @@
|
||||
#endif
|
||||
//
|
||||
// last known and checked version:
|
||||
#if (__MWERKS__ > 0x3204)
|
||||
#if (__MWERKS__ > 0x3205)
|
||||
# if defined(BOOST_ASSERT_CONFIG)
|
||||
# error "Unknown compiler version - please run the configure tests and report the results"
|
||||
# endif
|
||||
|
@ -34,7 +34,7 @@
|
||||
# define BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
# endif
|
||||
|
||||
# if (__SUNPRO_CC <= 0x530) || !defined(BOOST_STRICT_CONFIG)
|
||||
# if (__SUNPRO_CC <= 0x530)
|
||||
// Requesting debug info (-g) with Boost.Python results
|
||||
// in an internal compiler error for "static const"
|
||||
// initialized in-class.
|
||||
@ -57,13 +57,14 @@
|
||||
# define BOOST_NO_INTEGRAL_INT64_T
|
||||
# endif
|
||||
|
||||
# if (__SUNPRO_CC <= 0x540) || !defined(BOOST_STRICT_CONFIG)
|
||||
# if (__SUNPRO_CC < 0x570)
|
||||
# define BOOST_NO_TEMPLATE_TEMPLATES
|
||||
// see http://lists.boost.org/MailArchives/boost/msg47184.php
|
||||
// and http://lists.boost.org/MailArchives/boost/msg47220.php
|
||||
# define BOOST_NO_INCLASS_MEMBER_INITIALIZATION
|
||||
# define BOOST_NO_SFINAE
|
||||
# define BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS
|
||||
# define BOOST_NO_IS_ABSTRACT
|
||||
# endif
|
||||
|
||||
#define BOOST_COMPILER "Sun compiler version " BOOST_STRINGIZE(__SUNPRO_CC)
|
||||
@ -75,8 +76,8 @@
|
||||
#error "Compiler not supported or configured - please reconfigure"
|
||||
#endif
|
||||
//
|
||||
// last known and checked version is 0x530:
|
||||
#if (__SUNPRO_CC > 0x530)
|
||||
// last known and checked version is 0x570:
|
||||
#if (__SUNPRO_CC > 0x570)
|
||||
# if defined(BOOST_ASSERT_CONFIG)
|
||||
# error "Unknown compiler version - please run the configure tests and report the results"
|
||||
# endif
|
||||
|
@ -17,8 +17,8 @@
|
||||
// turn off the warnings before we #include anything
|
||||
#pragma warning( disable : 4503 ) // warning: decorated name length exceeded
|
||||
|
||||
#if _MSC_VER < 1300 // 1200 == VC++ 6.0, 1201 == EVC4.2
|
||||
#pragma warning( disable : 4786 ) // ident trunc to '255' chars in debug info
|
||||
#if _MSC_VER < 1300 // 1200 == VC++ 6.0, 1200-1202 == eVC++4
|
||||
# pragma warning( disable : 4786 ) // ident trunc to '255' chars in debug info
|
||||
# define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
|
||||
# define BOOST_NO_VOID_RETURNS
|
||||
# define BOOST_NO_EXCEPTION_STD_NAMESPACE
|
||||
@ -28,9 +28,9 @@
|
||||
|
||||
#if (_MSC_VER <= 1300) // 1300 == VC++ 7.0
|
||||
|
||||
#if !defined(_MSC_EXTENSIONS) && !defined(BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS) // VC7 bug with /Za
|
||||
# if !defined(_MSC_EXTENSIONS) && !defined(BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS) // VC7 bug with /Za
|
||||
# define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
|
||||
#endif
|
||||
# endif
|
||||
|
||||
# define BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
|
||||
# define BOOST_NO_INCLASS_MEMBER_INITIALIZATION
|
||||
@ -55,6 +55,8 @@
|
||||
# define BOOST_NO_TEMPLATE_TEMPLATES
|
||||
# define BOOST_NO_SFINAE
|
||||
# define BOOST_NO_POINTER_TO_MEMBER_TEMPLATE_PARAMETERS
|
||||
# define BOOST_NO_IS_ABSTRACT
|
||||
// TODO: what version is meant here? Have there really been any fixes in cl 12.01 (as e.g. shipped with eVC4)?
|
||||
# if (_MSC_VER > 1200)
|
||||
# define BOOST_NO_MEMBER_FUNCTION_SPECIALIZATIONS
|
||||
# endif
|
||||
@ -115,7 +117,26 @@
|
||||
# define BOOST_ABI_SUFFIX "boost/config/abi/msvc_suffix.hpp"
|
||||
#endif
|
||||
|
||||
# if _MSC_VER == 1200
|
||||
// TODO:
|
||||
// these things are mostly bogus. 1200 means version 12.0 of the compiler. The
|
||||
// artificial versions assigned to them only refer to the versions of some IDE
|
||||
// these compilers have been shipped with, and even that is not all of it. Some
|
||||
// were shipped with freely downloadable SDKs, others as crosscompilers in eVC.
|
||||
// IOW, you can't use these 'versions' in any sensible way. Sorry.
|
||||
# if defined(UNDER_CE)
|
||||
# if _MSC_VER < 1200
|
||||
// Note: these are so far off, they are not really supported
|
||||
# elif _MSC_VER < 1300 // eVC++ 4 comes with 1200-1202
|
||||
# define BOOST_COMPILER_VERSION evc4.0
|
||||
# error unknown CE compiler
|
||||
# else
|
||||
# error unknown CE compiler
|
||||
# endif
|
||||
# else
|
||||
# if _MSC_VER < 1200
|
||||
// Note: these are so far off, they are not really supported
|
||||
# define BOOST_COMPILER_VERSION 5.0
|
||||
# elif _MSC_VER < 1300
|
||||
# define BOOST_COMPILER_VERSION 6.0
|
||||
# elif _MSC_VER == 1300
|
||||
# define BOOST_COMPILER_VERSION 7.0
|
||||
@ -126,6 +147,7 @@
|
||||
# else
|
||||
# define BOOST_COMPILER_VERSION _MSC_VER
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#define BOOST_COMPILER "Microsoft Visual C++ version " BOOST_STRINGIZE(BOOST_COMPILER_VERSION)
|
||||
|
||||
@ -136,7 +158,7 @@
|
||||
#error "Compiler not supported or configured - please reconfigure"
|
||||
#endif
|
||||
//
|
||||
// last known and checked version is 1310:
|
||||
// last known and checked version is 1400 (VC8):
|
||||
#if (_MSC_VER > 1400)
|
||||
# if defined(BOOST_ASSERT_CONFIG)
|
||||
# error "Unknown compiler version - please run the configure tests and report the results"
|
||||
|
@ -43,8 +43,9 @@
|
||||
//
|
||||
// No wide character support in the BSD header files:
|
||||
//
|
||||
#define BOOST_NO_CWCHAR
|
||||
|
||||
#if !(defined(__FreeBSD__) && (__FreeBSD__ >= 5))
|
||||
# define BOOST_NO_CWCHAR
|
||||
#endif
|
||||
//
|
||||
// The BSD <ctype.h> has macros only, no functions:
|
||||
//
|
||||
|
@ -21,9 +21,15 @@
|
||||
#define BOOST_NO_SWPRINTF
|
||||
#define BOOST_NO_CWCTYPE
|
||||
|
||||
#ifdef __GNUC__
|
||||
#if defined(__GNUC__)
|
||||
# if (__GNUC__ < 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ < 3))
|
||||
// GNU C on HP-UX does not support threads (checked up to gcc 3.3)
|
||||
# define BOOST_DISABLE_THREADS
|
||||
# elif !defined(BOOST_DISABLE_THREADS)
|
||||
// threads supported from gcc-3.3 onwards:
|
||||
# define BOOST_HAS_THREADS
|
||||
# define BOOST_HAS_PTHREADS
|
||||
# endif
|
||||
#endif
|
||||
|
||||
// boilerplate code:
|
||||
|
@ -18,10 +18,14 @@
|
||||
# ifndef BOOST_HAS_UNISTD_H
|
||||
# define BOOST_HAS_UNISTD_H
|
||||
# endif
|
||||
// boilerplate code:
|
||||
# ifndef TARGET_CARBON
|
||||
//
|
||||
// Begin by including our boilerplate code for POSIX
|
||||
// feature detection, this is safe even when using
|
||||
// the MSL as Metrowerks supply their own <unistd.h>
|
||||
// to replace the platform-native BSD one. G++ users
|
||||
// should also always be able to do this on MaxOS X.
|
||||
//
|
||||
# include <boost/config/posix_features.hpp>
|
||||
# endif
|
||||
# ifndef BOOST_HAS_STDINT_H
|
||||
# define BOOST_HAS_STDINT_H
|
||||
# endif
|
||||
@ -49,9 +53,15 @@
|
||||
|
||||
// We will eventually support threads in non-Carbon builds, but we do
|
||||
// not support this yet.
|
||||
# if TARGET_CARBON
|
||||
# if ( defined(TARGET_API_MAC_CARBON) && TARGET_API_MAC_CARBON ) || ( defined(TARGET_CARBON) && TARGET_CARBON )
|
||||
|
||||
# if !defined(BOOST_HAS_PTHREADS)
|
||||
# define BOOST_HAS_MPTASKS
|
||||
# elif ( __dest_os == __mac_os_x )
|
||||
// We are doing a Carbon/Mach-O/MSL build which has pthreads, but only the
|
||||
// gettimeofday and no posix.
|
||||
# define BOOST_HAS_GETTIMEOFDAY
|
||||
# endif
|
||||
|
||||
// The MP task implementation of Boost Threads aims to replace MP-unsafe
|
||||
// parts of the MSL, so we turn on threads unconditionally.
|
||||
|
@ -1,6 +1,7 @@
|
||||
// (C) Copyright John Maddock 2001 - 2003.
|
||||
// (C) Copyright Bill Kempf 2001.
|
||||
// (C) Copyright Aleksey Gurtovoy 2003.
|
||||
// (C) Copyright Rene Rivera 2005.
|
||||
// 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)
|
||||
@ -11,6 +12,11 @@
|
||||
|
||||
#define BOOST_PLATFORM "Win32"
|
||||
|
||||
// Get the information about the MinGW runtime, i.e. __MINGW32_*VERSION.
|
||||
#if defined(__MINGW32__)
|
||||
# include <_mingw.h>
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && !defined(BOOST_NO_SWPRINTF)
|
||||
# define BOOST_NO_SWPRINTF
|
||||
#endif
|
||||
@ -19,9 +25,11 @@
|
||||
# define BOOST_HAS_DECLSPEC
|
||||
#endif
|
||||
|
||||
#if defined(__MINGW32__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 2)))
|
||||
#if defined(__MINGW32__) && ((__MINGW32_MAJOR_VERSION > 2) || ((__MINGW32_MAJOR_VERSION == 2) && (__MINGW32_MINOR_VERSION >= 0)))
|
||||
# define BOOST_HAS_STDINT_H
|
||||
# define __STDC_LIMIT_MACROS
|
||||
# define BOOST_HAS_DIRENT_H
|
||||
# define BOOST_HAS_UNISTD_H
|
||||
#endif
|
||||
|
||||
//
|
||||
|
@ -49,7 +49,7 @@
|
||||
// MacOS
|
||||
# define BOOST_PLATFORM_CONFIG "boost/config/platform/macos.hpp"
|
||||
|
||||
#elif defined(__IBMCPP__)
|
||||
#elif defined(__IBMCPP__) || defined(_AIX)
|
||||
// IBM
|
||||
# define BOOST_PLATFORM_CONFIG "boost/config/platform/aix.hpp"
|
||||
|
||||
|
@ -22,14 +22,16 @@
|
||||
# define BOOST_NO_STD_WSTREAMBUF
|
||||
#endif
|
||||
|
||||
#if defined(__osf__) && !defined(_REENTRANT) && defined(_GLIBCXX_HAVE_GTHR_DEFAULT)
|
||||
// GCC 3.4 on Tru64 forces the definition of _REENTRANT when any std lib header
|
||||
#if defined(__osf__) && !defined(_REENTRANT) \
|
||||
&& ( defined(_GLIBCXX_HAVE_GTHR_DEFAULT) || defined(_GLIBCPP_HAVE_GTHR_DEFAULT) )
|
||||
// GCC 3 on Tru64 forces the definition of _REENTRANT when any std lib header
|
||||
// file is included, therefore for consistency we define it here as well.
|
||||
# define _REENTRANT
|
||||
#endif
|
||||
|
||||
#ifdef __GLIBCXX__ // gcc 3.4 and greater:
|
||||
# ifdef _GLIBCXX_HAVE_GTHR_DEFAULT
|
||||
# if defined(_GLIBCXX_HAVE_GTHR_DEFAULT) \
|
||||
|| defined(_GLIBCXX__PTHREADS)
|
||||
//
|
||||
// If the std lib has thread support turned on, then turn it on in Boost
|
||||
// as well. We do this because some gcc-3.4 std lib headers define _REENTANT
|
||||
@ -39,6 +41,17 @@
|
||||
# else
|
||||
# define BOOST_DISABLE_THREADS
|
||||
# endif
|
||||
#elif defined(__GLIBCPP__) \
|
||||
&& !defined(_GLIBCPP_HAVE_GTHR_DEFAULT) \
|
||||
&& !defined(_GLIBCPP__PTHREADS)
|
||||
// disable thread support if the std lib was built single threaded:
|
||||
# define BOOST_DISABLE_THREADS
|
||||
#endif
|
||||
|
||||
#if (defined(linux) || defined(__linux) || defined(__linux__)) && defined(__arm__) && defined(_GLIBCPP_HAVE_GTHR_DEFAULT)
|
||||
// linux on arm apparently doesn't define _REENTRANT
|
||||
// so just turn on threading support whenever the std lib is thread safe:
|
||||
# define BOOST_HAS_THREADS
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -41,6 +41,11 @@
|
||||
# define BOOST_HAS_THREADS
|
||||
#endif
|
||||
|
||||
#ifdef _MSL_NO_EXPLICIT_FUNC_TEMPLATE_ARG
|
||||
# define BOOST_NO_STD_USE_FACET
|
||||
# define BOOST_HAS_TWO_ARG_USE_FACET
|
||||
#endif
|
||||
|
||||
|
||||
#define BOOST_STDLIB "Metrowerks Standard Library version " BOOST_STRINGIZE(__MSL_CPP__)
|
||||
|
||||
|
@ -119,5 +119,9 @@
|
||||
# define BOOST_NO_STD_OUTPUT_ITERATOR_ASSIGN
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Disable BOOST_HAS_LONG_LONG when the library has no support for it.
|
||||
//
|
||||
#if !defined(_RWSTD_LONG_LONG) && defined(BOOST_HAS_LONG_LONG)
|
||||
# undef BOOST_HAS_LONG_LONG
|
||||
#endif
|
||||
|
@ -52,7 +52,7 @@
|
||||
// then the io stream facets are not available in namespace std::
|
||||
//
|
||||
#ifdef _STLPORT_VERSION
|
||||
# if !defined(_STLP_OWN_IOSTREAMS) && defined(_STLP_USE_NAMESPACES) && defined(BOOST_NO_USING_TEMPLATE) && !defined(__BORLANDC__)
|
||||
# if !(_STLPORT_VERSION >= 0x500) && !defined(_STLP_OWN_IOSTREAMS) && defined(_STLP_USE_NAMESPACES) && defined(BOOST_NO_USING_TEMPLATE) && !defined(__BORLANDC__)
|
||||
# define BOOST_NO_STD_LOCALE
|
||||
# endif
|
||||
#else
|
||||
@ -74,7 +74,7 @@
|
||||
//
|
||||
#define BOOST_HAS_PARTIAL_STD_ALLOCATOR
|
||||
|
||||
#if !defined(_STLP_MEMBER_TEMPLATE_CLASSES)
|
||||
#if !defined(_STLP_MEMBER_TEMPLATE_CLASSES) || defined(_STLP_DONT_SUPPORT_REBIND_MEMBER_TEMPLATE)
|
||||
# define BOOST_NO_STD_ALLOCATOR
|
||||
#endif
|
||||
|
||||
|
@ -32,11 +32,15 @@
|
||||
//
|
||||
#include <limits.h>
|
||||
# if !defined(BOOST_HAS_LONG_LONG) \
|
||||
&& !(defined(BOOST_MSVC) && BOOST_MSVC <=1300) && !defined(__BORLANDC__) \
|
||||
&& !defined(BOOST_MSVC) && !defined(__BORLANDC__) \
|
||||
&& (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX))
|
||||
# define BOOST_HAS_LONG_LONG
|
||||
#endif
|
||||
#if !defined(BOOST_HAS_LONG_LONG) && !defined(BOOST_NO_INTEGRAL_INT64_T)
|
||||
|
||||
// TODO: Remove the following lines after the 1.33 release because the presence
|
||||
// of an integral 64 bit type has nothing to do with support for long long.
|
||||
|
||||
#if !defined(BOOST_HAS_LONG_LONG) && !defined(BOOST_NO_INTEGRAL_INT64_T) && !defined(__DECCXX_VER)
|
||||
# define BOOST_NO_INTEGRAL_INT64_T
|
||||
#endif
|
||||
|
||||
|
@ -349,8 +349,12 @@ namespace detail
|
||||
#else
|
||||
BOOST_STATIC_CONSTANT( least, sig_bits = (~( ~(least( 0u )) << Bits )) );
|
||||
#endif
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ == 0 && __GNUC_PATCHLEVEL__ == 2
|
||||
// Work around a weird bug that ICEs the compiler in build_c_cast
|
||||
BOOST_STATIC_CONSTANT( fast, sig_bits_fast = static_cast<fast>(sig_bits) );
|
||||
#else
|
||||
BOOST_STATIC_CONSTANT( fast, sig_bits_fast = fast(sig_bits) );
|
||||
|
||||
#endif
|
||||
}; // boost::detail::mask_uint_t
|
||||
|
||||
template < >
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 1998-2002
|
||||
* Dr John Maddock
|
||||
* John Maddock
|
||||
*
|
||||
* Use, modification and distribution are subject to the
|
||||
* Boost Software License, Version 1.0. (See accompanying file
|
||||
@ -24,11 +24,7 @@
|
||||
#include <boost/regex/config.hpp>
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_REGEX_V3
|
||||
#include <boost/regex/v3/cregex.hpp>
|
||||
#else
|
||||
#include <boost/regex/v4/cregex.hpp>
|
||||
#endif
|
||||
|
||||
#endif /* include guard */
|
||||
|
||||
|
@ -40,8 +40,48 @@
|
||||
# include <inttypes.h>
|
||||
# else
|
||||
# include <stdint.h>
|
||||
|
||||
// There is a bug in Cygwin two _C macros
|
||||
# if defined(__STDC_CONSTANT_MACROS) && defined(__CYGWIN__)
|
||||
# undef INTMAX_C
|
||||
# undef UINTMAX_C
|
||||
# define INTMAX_C(c) c##LL
|
||||
# define UINTMAX_C(c) c##ULL
|
||||
# endif
|
||||
|
||||
# endif
|
||||
|
||||
#ifdef __QNX__
|
||||
|
||||
// QNX (Dinkumware stdlib) defines these as non-standard names.
|
||||
// Reflect to the standard names.
|
||||
|
||||
typedef ::intleast8_t int_least8_t;
|
||||
typedef ::intfast8_t int_fast8_t;
|
||||
typedef ::uintleast8_t uint_least8_t;
|
||||
typedef ::uintfast8_t uint_fast8_t;
|
||||
|
||||
typedef ::intleast16_t int_least16_t;
|
||||
typedef ::intfast16_t int_fast16_t;
|
||||
typedef ::uintleast16_t uint_least16_t;
|
||||
typedef ::uintfast16_t uint_fast16_t;
|
||||
|
||||
typedef ::intleast32_t int_least32_t;
|
||||
typedef ::intfast32_t int_fast32_t;
|
||||
typedef ::uintleast32_t uint_least32_t;
|
||||
typedef ::uintfast32_t uint_fast32_t;
|
||||
|
||||
# ifndef BOOST_NO_INT64_T
|
||||
|
||||
typedef ::intleast64_t int_least64_t;
|
||||
typedef ::intfast64_t int_fast64_t;
|
||||
typedef ::uintleast64_t uint_least64_t;
|
||||
typedef ::uintfast64_t uint_fast64_t;
|
||||
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
|
@ -73,9 +73,6 @@
|
||||
// are called driven by smart_ptr interface...
|
||||
//
|
||||
|
||||
// Note: atomic_count_linux.hpp has been disabled by default; see the
|
||||
// comments inside for more info.
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#ifndef BOOST_HAS_THREADS
|
||||
@ -92,13 +89,11 @@ typedef long atomic_count;
|
||||
|
||||
}
|
||||
|
||||
#elif defined(BOOST_USE_ASM_ATOMIC_H)
|
||||
# include <boost/detail/atomic_count_linux.hpp>
|
||||
#elif defined(BOOST_AC_USE_PTHREADS)
|
||||
# include <boost/detail/atomic_count_pthreads.hpp>
|
||||
#elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
|
||||
# include <boost/detail/atomic_count_win32.hpp>
|
||||
#elif defined(__GLIBCPP__)
|
||||
#elif defined(__GLIBCPP__) || defined(__GLIBCXX__)
|
||||
# include <boost/detail/atomic_count_gcc.hpp>
|
||||
#elif defined(BOOST_HAS_PTHREADS)
|
||||
# define BOOST_AC_USE_PTHREADS
|
||||
|
@ -10,6 +10,7 @@
|
||||
//
|
||||
// Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.
|
||||
// Copyright (c) 2002 Lars Gullik Bjønnes <larsbj@lyx.org>
|
||||
// Copyright 2003-2005 Peter Dimov
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
@ -24,6 +25,13 @@ namespace boost
|
||||
namespace detail
|
||||
{
|
||||
|
||||
#if defined(__GLIBCXX__) // g++ 3.4+
|
||||
|
||||
using __gnu_cxx::__atomic_add;
|
||||
using __gnu_cxx::__exchange_and_add;
|
||||
|
||||
#endif
|
||||
|
||||
class atomic_count
|
||||
{
|
||||
public:
|
||||
|
@ -1,69 +0,0 @@
|
||||
#ifndef BOOST_DETAIL_ATOMIC_COUNT_LINUX_HPP_INCLUDED
|
||||
#define BOOST_DETAIL_ATOMIC_COUNT_LINUX_HPP_INCLUDED
|
||||
|
||||
//
|
||||
// boost/detail/atomic_count_linux.hpp
|
||||
//
|
||||
// Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.
|
||||
//
|
||||
// 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)
|
||||
//
|
||||
|
||||
//
|
||||
// This implementation uses <asm/atomic.h>. This is a kernel header;
|
||||
// using kernel headers in a user program may cause a number of problems,
|
||||
// and not all flavors of Linux provide the atomic instructions.
|
||||
//
|
||||
// This file is only provided because the performance of this implementation
|
||||
// is significantly higher than the pthreads version. Use at your own risk
|
||||
// (by defining BOOST_USE_ASM_ATOMIC_H.)
|
||||
//
|
||||
|
||||
#include <asm/atomic.h>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
class atomic_count
|
||||
{
|
||||
public:
|
||||
|
||||
explicit atomic_count(long v)
|
||||
{
|
||||
atomic_t init = ATOMIC_INIT(v);
|
||||
value_ = init;
|
||||
}
|
||||
|
||||
void operator++()
|
||||
{
|
||||
atomic_inc(&value_);
|
||||
}
|
||||
|
||||
long operator--()
|
||||
{
|
||||
return !atomic_dec_and_test(&value_);
|
||||
}
|
||||
|
||||
operator long() const
|
||||
{
|
||||
return atomic_read(&value_);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
atomic_count(atomic_count const &);
|
||||
atomic_count & operator=(atomic_count const &);
|
||||
|
||||
atomic_t value_;
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_DETAIL_ATOMIC_COUNT_LINUX_HPP_INCLUDED
|
@ -10,16 +10,14 @@
|
||||
//
|
||||
// boost/detail/atomic_count_win32.hpp
|
||||
//
|
||||
// Copyright (c) 2001, 2002, 2003 Peter Dimov
|
||||
// Copyright (c) 2001-2005 Peter Dimov
|
||||
//
|
||||
// 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)
|
||||
//
|
||||
|
||||
#ifdef BOOST_USE_WINDOWS_H
|
||||
# include <windows.h>
|
||||
#endif
|
||||
#include <boost/detail/interlocked.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
@ -27,67 +25,35 @@ namespace boost
|
||||
namespace detail
|
||||
{
|
||||
|
||||
#ifndef BOOST_USE_WINDOWS_H
|
||||
|
||||
#ifdef _WIN64
|
||||
|
||||
// Intel 6.0 on Win64 version, posted by Tim Fenders to [boost-users]
|
||||
|
||||
extern "C" long_type __cdecl _InterlockedIncrement(long volatile *);
|
||||
extern "C" long_type __cdecl _InterlockedDecrement(long volatile *);
|
||||
|
||||
#pragma intrinsic(_InterlockedIncrement)
|
||||
#pragma intrinsic(_InterlockedDecrement)
|
||||
|
||||
inline long InterlockedIncrement(long volatile * lp)
|
||||
{
|
||||
return _InterlockedIncrement(lp);
|
||||
}
|
||||
|
||||
inline long InterlockedDecrement(long volatile* lp)
|
||||
{
|
||||
return _InterlockedDecrement(lp);
|
||||
}
|
||||
|
||||
#else // _WIN64
|
||||
|
||||
extern "C" __declspec(dllimport) long __stdcall InterlockedIncrement(long volatile *);
|
||||
extern "C" __declspec(dllimport) long __stdcall InterlockedDecrement(long volatile *);
|
||||
|
||||
#endif // _WIN64
|
||||
|
||||
#endif // #ifndef BOOST_USE_WINDOWS_H
|
||||
|
||||
class atomic_count
|
||||
{
|
||||
public:
|
||||
|
||||
explicit atomic_count(long v): value_(v)
|
||||
explicit atomic_count( long v ): value_( v )
|
||||
{
|
||||
}
|
||||
|
||||
long operator++()
|
||||
{
|
||||
// Some older <windows.h> versions do not accept volatile
|
||||
return InterlockedIncrement(const_cast<long*>(&value_));
|
||||
return BOOST_INTERLOCKED_INCREMENT( &value_ );
|
||||
}
|
||||
|
||||
long operator--()
|
||||
{
|
||||
return InterlockedDecrement(const_cast<long*>(&value_));
|
||||
return BOOST_INTERLOCKED_DECREMENT( &value_ );
|
||||
}
|
||||
|
||||
operator long() const
|
||||
{
|
||||
return value_;
|
||||
return static_cast<long const volatile &>( value_ );
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
atomic_count(atomic_count const &);
|
||||
atomic_count & operator=(atomic_count const &);
|
||||
atomic_count( atomic_count const & );
|
||||
atomic_count & operator=( atomic_count const & );
|
||||
|
||||
volatile long value_;
|
||||
long value_;
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
59
boost/boost/detail/bad_weak_ptr.hpp
Normal file
59
boost/boost/detail/bad_weak_ptr.hpp
Normal file
@ -0,0 +1,59 @@
|
||||
#ifndef BOOST_BAD_WEAK_PTR_HPP_INCLUDED
|
||||
#define BOOST_BAD_WEAK_PTR_HPP_INCLUDED
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
//
|
||||
// detail/bad_weak_ptr.hpp
|
||||
//
|
||||
// Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd.
|
||||
//
|
||||
// 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)
|
||||
//
|
||||
|
||||
#include <exception>
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
# pragma warn -8026 // Functions with excep. spec. are not expanded inline
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
// The standard library that comes with Borland C++ 5.5.1, 5.6.4
|
||||
// defines std::exception and its members as having C calling
|
||||
// convention (-pc). When the definition of bad_weak_ptr
|
||||
// is compiled with -ps, the compiler issues an error.
|
||||
// Hence, the temporary #pragma option -pc below.
|
||||
|
||||
#if defined(__BORLANDC__) && __BORLANDC__ <= 0x564
|
||||
# pragma option push -pc
|
||||
#endif
|
||||
|
||||
class bad_weak_ptr: public std::exception
|
||||
{
|
||||
public:
|
||||
|
||||
virtual char const * what() const throw()
|
||||
{
|
||||
return "boost::bad_weak_ptr";
|
||||
}
|
||||
};
|
||||
|
||||
#if defined(__BORLANDC__) && __BORLANDC__ <= 0x564
|
||||
# pragma option pop
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
# pragma warn .8026 // Functions with excep. spec. are not expanded inline
|
||||
#endif
|
||||
|
||||
#endif // #ifndef BOOST_BAD_WEAK_PTR_HPP_INCLUDED
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
||||
|
@ -11,6 +11,7 @@
|
||||
# include <boost/type_traits/is_const.hpp>
|
||||
# include <boost/type_traits/is_volatile.hpp>
|
||||
# include <boost/type_traits/is_member_function_pointer.hpp>
|
||||
# include <boost/type_traits/is_member_pointer.hpp>
|
||||
# include <boost/type_traits/remove_cv.hpp>
|
||||
# include <boost/type_traits/remove_reference.hpp>
|
||||
# include <boost/type_traits/remove_pointer.hpp>
|
||||
@ -18,6 +19,7 @@
|
||||
# include <boost/type_traits/detail/ice_and.hpp>
|
||||
# include <boost/detail/workaround.hpp>
|
||||
|
||||
# include <boost/mpl/eval_if.hpp>
|
||||
# include <boost/mpl/if.hpp>
|
||||
# include <boost/mpl/bool.hpp>
|
||||
# include <boost/mpl/and.hpp>
|
||||
@ -251,6 +253,7 @@ struct is_reference_to_function_aux
|
||||
static T t;
|
||||
BOOST_STATIC_CONSTANT(
|
||||
bool, value = sizeof(detail::is_function_ref_tester(t,0)) == sizeof(::boost::type_traits::yes_type));
|
||||
typedef mpl::bool_<value> type;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
@ -330,6 +333,8 @@ struct is_reference_to_non_const_helper1
|
||||
BOOST_STATIC_CONSTANT(
|
||||
bool, value
|
||||
= sizeof(reference_to_const_helper(t)) == sizeof(inner_no_type));
|
||||
|
||||
typedef mpl::bool_<value> type;
|
||||
};
|
||||
};
|
||||
|
||||
@ -343,6 +348,7 @@ template <class T>
|
||||
struct is_reference_to_non_const
|
||||
: is_reference_to_non_const_helper1<is_reference<T>::value>::template apply<T>
|
||||
{
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_non_const,(T))
|
||||
};
|
||||
|
||||
|
||||
@ -361,6 +367,7 @@ struct is_reference_to_volatile_helper1
|
||||
BOOST_STATIC_CONSTANT(
|
||||
bool, value
|
||||
= sizeof(reference_to_volatile_helper(t)) == sizeof(inner_yes_type));
|
||||
typedef mpl::bool_<value> type;
|
||||
};
|
||||
};
|
||||
|
||||
@ -389,6 +396,10 @@ struct is_reference_to_pointer
|
||||
= (is_reference<T>::value
|
||||
&& sizeof((reference_to_pointer_helper)(t)) == sizeof(inner_yes_type))
|
||||
);
|
||||
|
||||
typedef mpl::bool_<value> type;
|
||||
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_pointer,(T))
|
||||
};
|
||||
|
||||
template <class T>
|
||||
@ -463,6 +474,7 @@ struct is_pointer_to_class
|
||||
= (is_pointer<T>::value
|
||||
&& sizeof(pointer_to_class_helper(t)) == sizeof(inner_yes_type))
|
||||
);
|
||||
typedef mpl::bool_<value> type;
|
||||
};
|
||||
# endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
|
||||
|
@ -4,7 +4,10 @@
|
||||
#ifndef 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/remove_cv.hpp>
|
||||
# include <boost/mpl/aux_/lambda_support.hpp>
|
||||
# include <boost/mpl/bool.hpp>
|
||||
# include <boost/detail/workaround.hpp>
|
||||
|
||||
@ -29,9 +32,27 @@ namespace is_incrementable_
|
||||
struct any { template <class T> any(T const&); };
|
||||
|
||||
// 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&,int);
|
||||
|
||||
# endif
|
||||
|
||||
# if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3202)) \
|
||||
|| BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
|
||||
# define BOOST_comma(a,b) (a)
|
||||
@ -51,7 +72,7 @@ namespace is_incrementable_
|
||||
template <class T>
|
||||
struct impl
|
||||
{
|
||||
static typename remove_cv<T>::type& x;
|
||||
static typename boost::remove_cv<T>::type& x;
|
||||
|
||||
BOOST_STATIC_CONSTANT(
|
||||
bool
|
||||
@ -62,7 +83,7 @@ namespace is_incrementable_
|
||||
template <class T>
|
||||
struct postfix_impl
|
||||
{
|
||||
static typename remove_cv<T>::type& x;
|
||||
static typename boost::remove_cv<T>::type& x;
|
||||
|
||||
BOOST_STATIC_CONSTANT(
|
||||
bool
|
||||
@ -73,18 +94,28 @@ namespace is_incrementable_
|
||||
|
||||
# undef BOOST_comma
|
||||
|
||||
template <class T>
|
||||
template<typename T>
|
||||
struct is_incrementable
|
||||
: mpl::bool_< ::boost::detail::is_incrementable_::impl<T>::value>
|
||||
BOOST_TT_AUX_BOOL_C_BASE(::boost::detail::is_incrementable_::impl<T>::value)
|
||||
{
|
||||
BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(::boost::detail::is_incrementable_::impl<T>::value)
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_incrementable,(T))
|
||||
};
|
||||
|
||||
template <class T>
|
||||
template<typename T>
|
||||
struct is_postfix_incrementable
|
||||
: mpl::bool_< ::boost::detail::is_incrementable_::postfix_impl<T>::value>
|
||||
BOOST_TT_AUX_BOOL_C_BASE(::boost::detail::is_incrementable_::impl<T>::value)
|
||||
{
|
||||
BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(::boost::detail::is_incrementable_::postfix_impl<T>::value)
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_postfix_incrementable,(T))
|
||||
};
|
||||
|
||||
}} // namespace boost::detail
|
||||
} // namespace detail
|
||||
|
||||
BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1, ::boost::detail::is_incrementable)
|
||||
BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1, ::boost::detail::is_postfix_incrementable)
|
||||
|
||||
} // namespace boost
|
||||
|
||||
|
||||
#endif // IS_INCREMENTABLE_DWA200415_HPP
|
||||
|
@ -18,77 +18,21 @@
|
||||
//
|
||||
// typedef <unspecified> boost::detail::lightweight_mutex;
|
||||
//
|
||||
// boost::detail::lightweight_mutex meets a subset of the Mutex concept
|
||||
// requirements: http://www.boost.org/libs/thread/doc/mutex_concept.html#Mutex
|
||||
// boost::detail::lightweight_mutex is a header-only implementation of
|
||||
// a subset of the Mutex concept requirements:
|
||||
//
|
||||
// * Used by the smart pointer library
|
||||
// * Performance oriented
|
||||
// * Header-only implementation
|
||||
// * Small memory footprint
|
||||
// * Not a general purpose mutex, use boost::mutex, CRITICAL_SECTION or
|
||||
// pthread_mutex instead.
|
||||
// * Never spin in a tight lock/do-something/unlock loop, since
|
||||
// lightweight_mutex does not guarantee fairness.
|
||||
// * Never keep a lightweight_mutex locked for long periods.
|
||||
// http://www.boost.org/doc/html/threads/concepts.html#threads.concepts.Mutex
|
||||
//
|
||||
// The current implementation can use a pthread_mutex, a CRITICAL_SECTION,
|
||||
// or a platform-specific spinlock.
|
||||
// It maps to a CRITICAL_SECTION on Windows or a pthread_mutex on POSIX.
|
||||
//
|
||||
// You can force a particular implementation by defining BOOST_LWM_USE_PTHREADS,
|
||||
// BOOST_LWM_USE_CRITICAL_SECTION, or BOOST_LWM_USE_SPINLOCK.
|
||||
//
|
||||
// If neither macro has been defined, the default is to use a spinlock on Win32,
|
||||
// and a pthread_mutex otherwise.
|
||||
//
|
||||
// Note that a spinlock is not a general synchronization primitive. In particular,
|
||||
// it is not guaranteed to be a memory barrier, and it is possible to "livelock"
|
||||
// if a lower-priority thread has acquired the spinlock but a higher-priority
|
||||
// thread is spinning trying to acquire the same lock.
|
||||
//
|
||||
// For these reasons, spinlocks have been disabled by default except on Windows,
|
||||
// where a spinlock can be several orders of magnitude faster than a CRITICAL_SECTION.
|
||||
|
||||
|
||||
// Note: lwm_linux.hpp has been disabled by default; see the comments
|
||||
// inside for more info.
|
||||
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
// Note to implementors: if you write a platform-specific spinlock
|
||||
// for a platform that supports pthreads, be sure to test its performance
|
||||
// against the pthreads-based version using shared_ptr_timing_test.cpp and
|
||||
// shared_ptr_mt_test.cpp. Custom versions are usually not worth the trouble
|
||||
// _unless_ the performance gains are substantial.
|
||||
//
|
||||
// Be sure to compare against a "real" pthreads library;
|
||||
// shared_ptr_timing_test.cpp will compile succesfully with a stub do-nothing
|
||||
// pthreads library, since it doesn't create any threads.
|
||||
|
||||
#if (defined(WIN32) || defined(_WIN32) || defined(__WIN32__)) && !defined(BOOST_LWM_USE_CRITICAL_SECTION) && !defined(BOOST_LWM_USE_PTHREADS)
|
||||
# define BOOST_LWM_WIN32
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_HAS_THREADS)
|
||||
# if defined(BOOST_LWM_WIN32)
|
||||
# include <boost/detail/lwm_win32_nt.hpp>
|
||||
# else
|
||||
# include <boost/detail/lwm_nop.hpp>
|
||||
# endif
|
||||
#elif defined(BOOST_LWM_USE_SPINLOCK) && defined(BOOST_USE_ASM_ATOMIC_H)
|
||||
# include <boost/detail/lwm_linux.hpp>
|
||||
#elif defined(BOOST_LWM_USE_CRITICAL_SECTION)
|
||||
#elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
|
||||
# include <boost/detail/lwm_win32_cs.hpp>
|
||||
#elif defined(BOOST_LWM_USE_PTHREADS)
|
||||
# include <boost/detail/lwm_pthreads.hpp>
|
||||
#elif defined(BOOST_LWM_WIN32)
|
||||
# include <boost/detail/lwm_win32.hpp>
|
||||
#elif defined(BOOST_LWM_USE_SPINLOCK) && defined(__sgi)
|
||||
# include <boost/detail/lwm_irix.hpp>
|
||||
#elif defined(BOOST_LWM_USE_SPINLOCK) && defined(__GLIBCPP__)
|
||||
# include <boost/detail/lwm_gcc.hpp>
|
||||
#elif defined(BOOST_HAS_PTHREADS)
|
||||
# define BOOST_LWM_USE_PTHREADS
|
||||
# include <boost/detail/lwm_pthreads.hpp>
|
||||
#else
|
||||
// Use #define BOOST_DISABLE_THREADS to avoid the error
|
||||
|
@ -42,21 +42,12 @@
|
||||
#include <climits>
|
||||
#include <cfloat>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/detail/endian.hpp>
|
||||
|
||||
#ifndef BOOST_NO_CWCHAR
|
||||
#include <cwchar> // for WCHAR_MIN and WCHAR_MAX
|
||||
#endif
|
||||
|
||||
// The macros are not named appropriately. We don't care about integer
|
||||
// bit layout, but about floating-point NaN (etc.) bit patterns.
|
||||
#if defined(__sparc) || defined(__sparc__) || defined(__powerpc__) || defined(__ppc__) || defined(__hppa) || defined(_MIPSEB) || defined(_POWER)
|
||||
#define BOOST_BIG_ENDIAN
|
||||
#elif defined(__i386__) || defined(__alpha__) || defined(__ia64) || defined(__ia64__)
|
||||
#define BOOST_LITTLE_ENDIAN
|
||||
#else
|
||||
#error The file boost/detail/limits.hpp needs to be set up for your CPU type.
|
||||
#endif
|
||||
|
||||
namespace std {
|
||||
|
||||
enum float_round_style {
|
||||
|
@ -1,77 +0,0 @@
|
||||
#ifndef BOOST_DETAIL_LWM_GCC_HPP_INCLUDED
|
||||
#define BOOST_DETAIL_LWM_GCC_HPP_INCLUDED
|
||||
|
||||
//
|
||||
// boost/detail/lwm_gcc.hpp
|
||||
//
|
||||
// lightweight_mutex for GNU libstdc++ v3
|
||||
//
|
||||
// http://gcc.gnu.org/onlinedocs/porting/Thread-safety.html
|
||||
//
|
||||
// Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
|
||||
// Copyright (c) 2002 Lars Gullik Bjønnes <larsbj@lyx.org>
|
||||
//
|
||||
// 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)
|
||||
//
|
||||
|
||||
#include <bits/atomicity.h>
|
||||
#include <sched.h>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
class lightweight_mutex
|
||||
{
|
||||
private:
|
||||
|
||||
_Atomic_word a_;
|
||||
|
||||
lightweight_mutex(lightweight_mutex const &);
|
||||
lightweight_mutex & operator=(lightweight_mutex const &);
|
||||
|
||||
public:
|
||||
|
||||
lightweight_mutex(): a_(0)
|
||||
{
|
||||
}
|
||||
|
||||
class scoped_lock;
|
||||
friend class scoped_lock;
|
||||
|
||||
class scoped_lock
|
||||
{
|
||||
private:
|
||||
|
||||
lightweight_mutex & m_;
|
||||
|
||||
scoped_lock(scoped_lock const &);
|
||||
scoped_lock & operator=(scoped_lock const &);
|
||||
|
||||
public:
|
||||
|
||||
explicit scoped_lock(lightweight_mutex & m): m_(m)
|
||||
{
|
||||
while( __exchange_and_add(&m_.a_, 1) )
|
||||
{
|
||||
__atomic_add(&m_.a_, -1);
|
||||
sched_yield();
|
||||
}
|
||||
}
|
||||
|
||||
~scoped_lock()
|
||||
{
|
||||
__atomic_add(&m_.a_, -1);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_DETAIL_LWM_GCC_HPP_INCLUDED
|
@ -1,73 +0,0 @@
|
||||
#ifndef BOOST_DETAIL_LWM_IRIX_HPP_INCLUDED
|
||||
#define BOOST_DETAIL_LWM_IRIX_HPP_INCLUDED
|
||||
|
||||
//
|
||||
// boost/detail/lwm_irix.hpp
|
||||
//
|
||||
// Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
|
||||
// Copyright (c) 2002 Dan Gohman
|
||||
//
|
||||
// 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)
|
||||
//
|
||||
|
||||
#include <sgidefs.h>
|
||||
#include <mutex.h>
|
||||
#include <sched.h>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
class lightweight_mutex
|
||||
{
|
||||
private:
|
||||
|
||||
__uint32_t l_;
|
||||
|
||||
lightweight_mutex(lightweight_mutex const &);
|
||||
lightweight_mutex & operator=(lightweight_mutex const &);
|
||||
|
||||
public:
|
||||
|
||||
lightweight_mutex(): l_(0)
|
||||
{
|
||||
}
|
||||
|
||||
class scoped_lock;
|
||||
friend class scoped_lock;
|
||||
|
||||
class scoped_lock
|
||||
{
|
||||
private:
|
||||
|
||||
lightweight_mutex & m_;
|
||||
|
||||
scoped_lock(scoped_lock const &);
|
||||
scoped_lock & operator=(scoped_lock const &);
|
||||
|
||||
public:
|
||||
|
||||
explicit scoped_lock(lightweight_mutex & m): m_(m)
|
||||
{
|
||||
while( test_and_set32(&m_.l_, 1) )
|
||||
{
|
||||
sched_yield();
|
||||
}
|
||||
}
|
||||
|
||||
~scoped_lock()
|
||||
{
|
||||
m_.l_ = 0;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_DETAIL_LWM_IRIX_HPP_INCLUDED
|
@ -1,84 +0,0 @@
|
||||
#ifndef BOOST_DETAIL_LWM_LINUX_HPP_INCLUDED
|
||||
#define BOOST_DETAIL_LWM_LINUX_HPP_INCLUDED
|
||||
|
||||
//
|
||||
// boost/detail/lwm_linux.hpp
|
||||
//
|
||||
// Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
|
||||
//
|
||||
// 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)
|
||||
//
|
||||
|
||||
//
|
||||
// This implementation uses <asm/atomic.h>. This is a kernel header;
|
||||
// using kernel headers in a user program may cause a number of problems,
|
||||
// and not all flavors of Linux provide the atomic instructions.
|
||||
//
|
||||
// This file is only provided because the performance of this implementation
|
||||
// is about 3.5 times higher than the pthreads version. Use at your own risk
|
||||
// (by defining BOOST_USE_ASM_ATOMIC_H.)
|
||||
//
|
||||
|
||||
#include <asm/atomic.h>
|
||||
#include <sched.h>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
class lightweight_mutex
|
||||
{
|
||||
private:
|
||||
|
||||
atomic_t a_;
|
||||
|
||||
lightweight_mutex(lightweight_mutex const &);
|
||||
lightweight_mutex & operator=(lightweight_mutex const &);
|
||||
|
||||
public:
|
||||
|
||||
lightweight_mutex()
|
||||
{
|
||||
atomic_t a = ATOMIC_INIT(1);
|
||||
a_ = a;
|
||||
}
|
||||
|
||||
class scoped_lock;
|
||||
friend class scoped_lock;
|
||||
|
||||
class scoped_lock
|
||||
{
|
||||
private:
|
||||
|
||||
lightweight_mutex & m_;
|
||||
|
||||
scoped_lock(scoped_lock const &);
|
||||
scoped_lock & operator=(scoped_lock const &);
|
||||
|
||||
public:
|
||||
|
||||
explicit scoped_lock(lightweight_mutex & m): m_(m)
|
||||
{
|
||||
while( !atomic_dec_and_test(&m_.a_) )
|
||||
{
|
||||
atomic_inc(&m_.a_);
|
||||
sched_yield();
|
||||
}
|
||||
}
|
||||
|
||||
~scoped_lock()
|
||||
{
|
||||
atomic_inc(&m_.a_);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_DETAIL_LWM_LINUX_HPP_INCLUDED
|
@ -1,122 +0,0 @@
|
||||
#ifndef BOOST_DETAIL_LWM_WIN32_HPP_INCLUDED
|
||||
#define BOOST_DETAIL_LWM_WIN32_HPP_INCLUDED
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
//
|
||||
// boost/detail/lwm_win32.hpp
|
||||
//
|
||||
// Copyright (c) 2002, 2003 Peter Dimov
|
||||
//
|
||||
// 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)
|
||||
//
|
||||
|
||||
#ifdef BOOST_USE_WINDOWS_H
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
# pragma warn -8027 // Functions containing while are not expanded inline
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
#ifndef BOOST_USE_WINDOWS_H
|
||||
|
||||
#ifdef _WIN64
|
||||
|
||||
// Intel 6.0 on Win64 version, posted by Tim Fenders to [boost-users]
|
||||
|
||||
extern "C" long_type __cdecl _InterlockedExchange(long volatile *, long);
|
||||
|
||||
#pragma intrinsic(_InterlockedExchange)
|
||||
|
||||
inline long InterlockedExchange(long volatile* lp, long l)
|
||||
{
|
||||
return _InterlockedExchange(lp, l);
|
||||
}
|
||||
|
||||
#else // _WIN64
|
||||
|
||||
extern "C" __declspec(dllimport) long __stdcall InterlockedExchange(long volatile *, long);
|
||||
|
||||
#endif // _WIN64
|
||||
|
||||
extern "C" __declspec(dllimport) void __stdcall Sleep(unsigned long);
|
||||
|
||||
#endif // #ifndef BOOST_USE_WINDOWS_H
|
||||
|
||||
class lightweight_mutex
|
||||
{
|
||||
private:
|
||||
|
||||
long l_;
|
||||
|
||||
lightweight_mutex(lightweight_mutex const &);
|
||||
lightweight_mutex & operator=(lightweight_mutex const &);
|
||||
|
||||
public:
|
||||
|
||||
lightweight_mutex(): l_(0)
|
||||
{
|
||||
}
|
||||
|
||||
class scoped_lock;
|
||||
friend class scoped_lock;
|
||||
|
||||
class scoped_lock
|
||||
{
|
||||
private:
|
||||
|
||||
lightweight_mutex & m_;
|
||||
|
||||
scoped_lock(scoped_lock const &);
|
||||
scoped_lock & operator=(scoped_lock const &);
|
||||
|
||||
public:
|
||||
|
||||
explicit scoped_lock(lightweight_mutex & m): m_(m)
|
||||
{
|
||||
while( InterlockedExchange(&m_.l_, 1) )
|
||||
{
|
||||
// Note: changed to Sleep(1) from Sleep(0).
|
||||
// According to MSDN, Sleep(0) will never yield
|
||||
// to a lower-priority thread, whereas Sleep(1)
|
||||
// will. Performance seems not to be affected.
|
||||
|
||||
Sleep(1);
|
||||
}
|
||||
}
|
||||
|
||||
~scoped_lock()
|
||||
{
|
||||
InterlockedExchange(&m_.l_, 0);
|
||||
|
||||
// Note: adding a yield here will make
|
||||
// the spinlock more fair and will increase the overall
|
||||
// performance of some applications substantially in
|
||||
// high contention situations, but will penalize the
|
||||
// low contention / single thread case up to 5x
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
# pragma warn .8027 // Functions containing while are not expanded inline
|
||||
#endif
|
||||
|
||||
#endif // #ifndef BOOST_DETAIL_LWM_WIN32_HPP_INCLUDED
|
@ -1,63 +0,0 @@
|
||||
#ifndef BOOST_DETAIL_LWM_WIN32_NT_HPP_INCLUDED
|
||||
#define BOOST_DETAIL_LWM_WIN32_NT_HPP_INCLUDED
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
//
|
||||
// boost/detail/lwm_win32_nt.hpp
|
||||
//
|
||||
// Copyright (c) 2002, 2003 Peter Dimov
|
||||
//
|
||||
// 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)
|
||||
//
|
||||
// "No threads" version of lwm_win32.hpp; binary compatible but no-op.
|
||||
//
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
class lightweight_mutex
|
||||
{
|
||||
private:
|
||||
|
||||
long l_;
|
||||
|
||||
lightweight_mutex(lightweight_mutex const &);
|
||||
lightweight_mutex & operator=(lightweight_mutex const &);
|
||||
|
||||
public:
|
||||
|
||||
lightweight_mutex(): l_(0)
|
||||
{
|
||||
}
|
||||
|
||||
class scoped_lock;
|
||||
friend class scoped_lock;
|
||||
|
||||
class scoped_lock
|
||||
{
|
||||
private:
|
||||
|
||||
scoped_lock(scoped_lock const &);
|
||||
scoped_lock & operator=(scoped_lock const &);
|
||||
|
||||
public:
|
||||
|
||||
explicit scoped_lock(lightweight_mutex &)
|
||||
{
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_DETAIL_LWM_WIN32_NT_HPP_INCLUDED
|
87
boost/boost/detail/no_exceptions_support.hpp
Normal file
87
boost/boost/detail/no_exceptions_support.hpp
Normal file
@ -0,0 +1,87 @@
|
||||
#ifndef BOOST_DETAIL_NO_EXCEPTIONS_SUPPORT_HPP_
|
||||
#define BOOST_DETAIL_NO_EXCEPTIONS_SUPPORT_HPP_
|
||||
|
||||
#if (defined _MSC_VER) && (_MSC_VER >= 1200)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// (C) Copyright 2004 Pavel Vozenilek.
|
||||
// Use, modification and distribution is 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)
|
||||
//
|
||||
//
|
||||
// This file contains helper macros used when exception support may be
|
||||
// disabled (as indicated by macro BOOST_NO_EXCEPTIONS).
|
||||
//
|
||||
// Before picking up these macros you may consider using RAII techniques
|
||||
// to deal with exceptions - their syntax can be always the same with
|
||||
// or without exception support enabled.
|
||||
//
|
||||
|
||||
/* Example of use:
|
||||
|
||||
void foo() {
|
||||
BOOST_TRY {
|
||||
...
|
||||
} BOOST_CATCH(const std::bad_alloc&) {
|
||||
...
|
||||
BOOST_RETHROW
|
||||
} BOOST_CATCH(const std::exception& e) {
|
||||
...
|
||||
}
|
||||
BOOST_CATCH_END
|
||||
}
|
||||
|
||||
With exception support enabled it will expand into:
|
||||
|
||||
void foo() {
|
||||
{ try {
|
||||
...
|
||||
} catch (const std::bad_alloc&) {
|
||||
...
|
||||
throw;
|
||||
} catch (const std::exception& e) {
|
||||
...
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
With exception support disabled it will expand into:
|
||||
|
||||
void foo() {
|
||||
{ if(true) {
|
||||
...
|
||||
} else if (false) {
|
||||
...
|
||||
} else if (false) {
|
||||
...
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
#if !(defined BOOST_NO_EXCEPTIONS)
|
||||
# define BOOST_TRY { try
|
||||
# define BOOST_CATCH(x) catch(x)
|
||||
# define BOOST_RETHROW throw;
|
||||
# define BOOST_CATCH_END }
|
||||
#else
|
||||
# if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
# define BOOST_TRY { if ("")
|
||||
# define BOOST_CATCH(x) else if (!"")
|
||||
# else
|
||||
# define BOOST_TRY { if (true)
|
||||
# define BOOST_CATCH(x) else if (false)
|
||||
# endif
|
||||
# define BOOST_RETHROW
|
||||
# define BOOST_CATCH_END }
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
@ -11,293 +11,35 @@
|
||||
// detail/shared_count.hpp
|
||||
//
|
||||
// Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd.
|
||||
// Copyright 2004-2005 Peter Dimov
|
||||
//
|
||||
// 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)
|
||||
//
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#if defined(BOOST_SP_USE_STD_ALLOCATOR) && defined(BOOST_SP_USE_QUICK_ALLOCATOR)
|
||||
# error BOOST_SP_USE_STD_ALLOCATOR and BOOST_SP_USE_QUICK_ALLOCATOR are incompatible.
|
||||
#ifdef __BORLANDC__
|
||||
# pragma warn -8027 // Functions containing try are not expanded inline
|
||||
#endif
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/checked_delete.hpp>
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/detail/lightweight_mutex.hpp>
|
||||
|
||||
#if defined(BOOST_SP_USE_QUICK_ALLOCATOR)
|
||||
#include <boost/detail/quick_allocator.hpp>
|
||||
#endif
|
||||
#include <boost/detail/bad_weak_ptr.hpp>
|
||||
#include <boost/detail/sp_counted_base.hpp>
|
||||
#include <boost/detail/sp_counted_impl.hpp>
|
||||
|
||||
#include <memory> // std::auto_ptr, std::allocator
|
||||
#include <functional> // std::less
|
||||
#include <exception> // std::exception
|
||||
#include <new> // std::bad_alloc
|
||||
#include <typeinfo> // std::type_info in get_deleter
|
||||
#include <cstddef> // std::size_t
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
# pragma warn -8026 // Functions with excep. spec. are not expanded inline
|
||||
# pragma warn -8027 // Functions containing try are not expanded inline
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
// Debug hooks
|
||||
|
||||
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||
|
||||
void sp_scalar_constructor_hook(void * px, std::size_t size, void * pn);
|
||||
void sp_array_constructor_hook(void * px);
|
||||
void sp_scalar_destructor_hook(void * px, std::size_t size, void * pn);
|
||||
void sp_array_destructor_hook(void * px);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
// The standard library that comes with Borland C++ 5.5.1
|
||||
// defines std::exception and its members as having C calling
|
||||
// convention (-pc). When the definition of bad_weak_ptr
|
||||
// is compiled with -ps, the compiler issues an error.
|
||||
// Hence, the temporary #pragma option -pc below. The version
|
||||
// check is deliberately conservative.
|
||||
|
||||
#if defined(__BORLANDC__) && __BORLANDC__ == 0x551
|
||||
# pragma option push -pc
|
||||
#endif
|
||||
|
||||
class bad_weak_ptr: public std::exception
|
||||
{
|
||||
public:
|
||||
|
||||
virtual char const * what() const throw()
|
||||
{
|
||||
return "boost::bad_weak_ptr";
|
||||
}
|
||||
};
|
||||
|
||||
#if defined(__BORLANDC__) && __BORLANDC__ == 0x551
|
||||
# pragma option pop
|
||||
#endif
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
class sp_counted_base
|
||||
{
|
||||
private:
|
||||
|
||||
typedef detail::lightweight_mutex mutex_type;
|
||||
|
||||
public:
|
||||
|
||||
sp_counted_base(): use_count_(1), weak_count_(1)
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~sp_counted_base() // nothrow
|
||||
{
|
||||
}
|
||||
|
||||
// dispose() is called when use_count_ drops to zero, to release
|
||||
// the resources managed by *this.
|
||||
|
||||
virtual void dispose() = 0; // nothrow
|
||||
|
||||
// destruct() is called when weak_count_ drops to zero.
|
||||
|
||||
virtual void destruct() // nothrow
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
|
||||
virtual void * get_deleter(std::type_info const & ti) = 0;
|
||||
|
||||
void add_ref_copy()
|
||||
{
|
||||
#if defined(BOOST_HAS_THREADS)
|
||||
mutex_type::scoped_lock lock(mtx_);
|
||||
#endif
|
||||
++use_count_;
|
||||
}
|
||||
|
||||
void add_ref_lock()
|
||||
{
|
||||
#if defined(BOOST_HAS_THREADS)
|
||||
mutex_type::scoped_lock lock(mtx_);
|
||||
#endif
|
||||
if(use_count_ == 0) boost::throw_exception(boost::bad_weak_ptr());
|
||||
++use_count_;
|
||||
}
|
||||
|
||||
void release() // nothrow
|
||||
{
|
||||
{
|
||||
#if defined(BOOST_HAS_THREADS)
|
||||
mutex_type::scoped_lock lock(mtx_);
|
||||
#endif
|
||||
long new_use_count = --use_count_;
|
||||
|
||||
if(new_use_count != 0) return;
|
||||
}
|
||||
|
||||
dispose();
|
||||
weak_release();
|
||||
}
|
||||
|
||||
void weak_add_ref() // nothrow
|
||||
{
|
||||
#if defined(BOOST_HAS_THREADS)
|
||||
mutex_type::scoped_lock lock(mtx_);
|
||||
#endif
|
||||
++weak_count_;
|
||||
}
|
||||
|
||||
void weak_release() // nothrow
|
||||
{
|
||||
long new_weak_count;
|
||||
|
||||
{
|
||||
#if defined(BOOST_HAS_THREADS)
|
||||
mutex_type::scoped_lock lock(mtx_);
|
||||
#endif
|
||||
new_weak_count = --weak_count_;
|
||||
}
|
||||
|
||||
if(new_weak_count == 0)
|
||||
{
|
||||
destruct();
|
||||
}
|
||||
}
|
||||
|
||||
long use_count() const // nothrow
|
||||
{
|
||||
#if defined(BOOST_HAS_THREADS)
|
||||
mutex_type::scoped_lock lock(mtx_);
|
||||
#endif
|
||||
return use_count_;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
sp_counted_base(sp_counted_base const &);
|
||||
sp_counted_base & operator= (sp_counted_base const &);
|
||||
|
||||
long use_count_; // #shared
|
||||
long weak_count_; // #weak + (#shared != 0)
|
||||
|
||||
#if defined(BOOST_HAS_THREADS) || defined(BOOST_LWM_WIN32)
|
||||
mutable mutex_type mtx_;
|
||||
#endif
|
||||
};
|
||||
|
||||
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||
|
||||
template<class T> void cbi_call_constructor_hook(sp_counted_base * pn, T * px, checked_deleter<T> const &, int)
|
||||
{
|
||||
boost::sp_scalar_constructor_hook(px, sizeof(T), pn);
|
||||
}
|
||||
|
||||
template<class T> void cbi_call_constructor_hook(sp_counted_base *, T * px, checked_array_deleter<T> const &, int)
|
||||
{
|
||||
boost::sp_array_constructor_hook(px);
|
||||
}
|
||||
|
||||
template<class P, class D> void cbi_call_constructor_hook(sp_counted_base *, P const &, D const &, long)
|
||||
{
|
||||
}
|
||||
|
||||
template<class T> void cbi_call_destructor_hook(sp_counted_base * pn, T * px, checked_deleter<T> const &, int)
|
||||
{
|
||||
boost::sp_scalar_destructor_hook(px, sizeof(T), pn);
|
||||
}
|
||||
|
||||
template<class T> void cbi_call_destructor_hook(sp_counted_base *, T * px, checked_array_deleter<T> const &, int)
|
||||
{
|
||||
boost::sp_array_destructor_hook(px);
|
||||
}
|
||||
|
||||
template<class P, class D> void cbi_call_destructor_hook(sp_counted_base *, P const &, D const &, long)
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//
|
||||
// Borland's Codeguard trips up over the -Vx- option here:
|
||||
//
|
||||
#ifdef __CODEGUARD__
|
||||
# pragma option push -Vx-
|
||||
#endif
|
||||
|
||||
template<class P, class D> class sp_counted_base_impl: public sp_counted_base
|
||||
{
|
||||
private:
|
||||
|
||||
P ptr; // copy constructor must not throw
|
||||
D del; // copy constructor must not throw
|
||||
|
||||
sp_counted_base_impl(sp_counted_base_impl const &);
|
||||
sp_counted_base_impl & operator= (sp_counted_base_impl const &);
|
||||
|
||||
typedef sp_counted_base_impl<P, D> this_type;
|
||||
|
||||
public:
|
||||
|
||||
// pre: initial_use_count <= initial_weak_count, d(p) must not throw
|
||||
|
||||
sp_counted_base_impl(P p, D d): ptr(p), del(d)
|
||||
{
|
||||
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||
detail::cbi_call_constructor_hook(this, p, d, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
virtual void dispose() // nothrow
|
||||
{
|
||||
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||
detail::cbi_call_destructor_hook(this, ptr, del, 0);
|
||||
#endif
|
||||
del(ptr);
|
||||
}
|
||||
|
||||
virtual void * get_deleter(std::type_info const & ti)
|
||||
{
|
||||
return ti == typeid(D)? &del: 0;
|
||||
}
|
||||
|
||||
#if defined(BOOST_SP_USE_STD_ALLOCATOR)
|
||||
|
||||
void * operator new(std::size_t)
|
||||
{
|
||||
return std::allocator<this_type>().allocate(1, static_cast<this_type *>(0));
|
||||
}
|
||||
|
||||
void operator delete(void * p)
|
||||
{
|
||||
std::allocator<this_type>().deallocate(static_cast<this_type *>(p), 1);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_SP_USE_QUICK_ALLOCATOR)
|
||||
|
||||
void * operator new(std::size_t)
|
||||
{
|
||||
return quick_allocator<this_type>::alloc();
|
||||
}
|
||||
|
||||
void operator delete(void * p)
|
||||
{
|
||||
quick_allocator<this_type>::dealloc(p);
|
||||
}
|
||||
|
||||
#endif
|
||||
};
|
||||
|
||||
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||
|
||||
int const shared_count_id = 0x2C35F101;
|
||||
@ -328,6 +70,36 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
template<class Y> explicit shared_count( Y * p ): pi_( 0 )
|
||||
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||
, id_(shared_count_id)
|
||||
#endif
|
||||
{
|
||||
#ifndef BOOST_NO_EXCEPTIONS
|
||||
|
||||
try
|
||||
{
|
||||
pi_ = new sp_counted_impl_p<Y>( p );
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
boost::checked_delete( p );
|
||||
throw;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
pi_ = new sp_counted_impl_p<Y>( p );
|
||||
|
||||
if( pi_ == 0 )
|
||||
{
|
||||
boost::checked_delete( p );
|
||||
boost::throw_exception( std::bad_alloc() );
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
template<class P, class D> shared_count(P p, D d): pi_(0)
|
||||
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||
, id_(shared_count_id)
|
||||
@ -337,7 +109,7 @@ public:
|
||||
|
||||
try
|
||||
{
|
||||
pi_ = new sp_counted_base_impl<P, D>(p, d);
|
||||
pi_ = new sp_counted_impl_pd<P, D>(p, d);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
@ -347,7 +119,7 @@ public:
|
||||
|
||||
#else
|
||||
|
||||
pi_ = new sp_counted_base_impl<P, D>(p, d);
|
||||
pi_ = new sp_counted_impl_pd<P, D>(p, d);
|
||||
|
||||
if(pi_ == 0)
|
||||
{
|
||||
@ -363,11 +135,20 @@ public:
|
||||
// auto_ptr<Y> is special cased to provide the strong guarantee
|
||||
|
||||
template<class Y>
|
||||
explicit shared_count(std::auto_ptr<Y> & r): pi_(new sp_counted_base_impl< Y *, checked_deleter<Y> >(r.get(), checked_deleter<Y>()))
|
||||
explicit shared_count( std::auto_ptr<Y> & r ): pi_( new sp_counted_impl_p<Y>( r.get() ) )
|
||||
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||
, id_(shared_count_id)
|
||||
#endif
|
||||
{
|
||||
#ifdef BOOST_NO_EXCEPTIONS
|
||||
|
||||
if( pi_ == 0 )
|
||||
{
|
||||
boost::throw_exception(std::bad_alloc());
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
r.release();
|
||||
}
|
||||
|
||||
@ -375,7 +156,7 @@ public:
|
||||
|
||||
~shared_count() // nothrow
|
||||
{
|
||||
if(pi_ != 0) pi_->release();
|
||||
if( pi_ != 0 ) pi_->release();
|
||||
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||
id_ = 0;
|
||||
#endif
|
||||
@ -386,7 +167,7 @@ public:
|
||||
, id_(shared_count_id)
|
||||
#endif
|
||||
{
|
||||
if(pi_ != 0) pi_->add_ref_copy();
|
||||
if( pi_ != 0 ) pi_->add_ref_copy();
|
||||
}
|
||||
|
||||
explicit shared_count(weak_count const & r); // throws bad_weak_ptr when r.use_count() == 0
|
||||
@ -395,10 +176,10 @@ public:
|
||||
{
|
||||
sp_counted_base * tmp = r.pi_;
|
||||
|
||||
if(tmp != pi_)
|
||||
if( tmp != pi_ )
|
||||
{
|
||||
if(tmp != 0) tmp->add_ref_copy();
|
||||
if(pi_ != 0) pi_->release();
|
||||
if( tmp != 0 ) tmp->add_ref_copy();
|
||||
if( pi_ != 0 ) pi_->release();
|
||||
pi_ = tmp;
|
||||
}
|
||||
|
||||
@ -429,19 +210,15 @@ public:
|
||||
|
||||
friend inline bool operator<(shared_count const & a, shared_count const & b)
|
||||
{
|
||||
return std::less<sp_counted_base *>()(a.pi_, b.pi_);
|
||||
return std::less<sp_counted_base *>()( a.pi_, b.pi_ );
|
||||
}
|
||||
|
||||
void * get_deleter(std::type_info const & ti) const
|
||||
{
|
||||
return pi_? pi_->get_deleter(ti): 0;
|
||||
return pi_? pi_->get_deleter( ti ): 0;
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef __CODEGUARD__
|
||||
# pragma option pop
|
||||
#endif
|
||||
|
||||
|
||||
class weak_count
|
||||
{
|
||||
@ -531,18 +308,14 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
inline shared_count::shared_count(weak_count const & r): pi_(r.pi_)
|
||||
inline shared_count::shared_count( weak_count const & r ): pi_( r.pi_ )
|
||||
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||
, id_(shared_count_id)
|
||||
#endif
|
||||
{
|
||||
if(pi_ != 0)
|
||||
if( pi_ == 0 || !pi_->add_ref_lock() )
|
||||
{
|
||||
pi_->add_ref_lock();
|
||||
}
|
||||
else
|
||||
{
|
||||
boost::throw_exception(boost::bad_weak_ptr());
|
||||
boost::throw_exception( boost::bad_weak_ptr() );
|
||||
}
|
||||
}
|
||||
|
||||
@ -552,7 +325,6 @@ inline shared_count::shared_count(weak_count const & r): pi_(r.pi_)
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
# pragma warn .8027 // Functions containing try are not expanded inline
|
||||
# pragma warn .8026 // Functions with excep. spec. are not expanded inline
|
||||
#endif
|
||||
|
||||
#endif // #ifndef BOOST_DETAIL_SHARED_COUNT_HPP_INCLUDED
|
||||
|
69
boost/boost/detail/sp_counted_base.hpp
Normal file
69
boost/boost/detail/sp_counted_base.hpp
Normal file
@ -0,0 +1,69 @@
|
||||
#ifndef BOOST_DETAIL_SP_COUNTED_BASE_HPP_INCLUDED
|
||||
#define BOOST_DETAIL_SP_COUNTED_BASE_HPP_INCLUDED
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
//
|
||||
// detail/sp_counted_base.hpp
|
||||
//
|
||||
// Copyright 2005 Peter Dimov
|
||||
//
|
||||
// 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)
|
||||
//
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#if defined( BOOST_SP_DISABLE_THREADS )
|
||||
|
||||
# include <boost/detail/sp_counted_base_nt.hpp>
|
||||
|
||||
#elif defined( BOOST_SP_USE_PTHREADS )
|
||||
|
||||
# include <boost/detail/sp_counted_base_pt.hpp>
|
||||
|
||||
#elif defined( __GNUC__ ) && ( defined( __i386__ ) || defined( __x86_64__ ) )
|
||||
|
||||
# include <boost/detail/sp_counted_base_gcc_x86.hpp>
|
||||
|
||||
//~ #elif defined( __MWERKS__ ) && ( defined( __i386__ ) || defined( __x86_64__ ) )
|
||||
|
||||
//~ # include <boost/detail/sp_counted_base_cw_x86.hpp>
|
||||
|
||||
#elif defined( __GNUC__ ) && defined( __ia64__ ) && !defined( __INTEL_COMPILER )
|
||||
|
||||
# include <boost/detail/sp_counted_base_gcc_ia64.hpp>
|
||||
|
||||
#elif defined( __MWERKS__ ) && defined( __POWERPC__ )
|
||||
|
||||
# include <boost/detail/sp_counted_base_cw_ppc.hpp>
|
||||
|
||||
#elif defined( __GNUC__ ) && ( defined( __powerpc__ ) || defined( __ppc__ ) )
|
||||
|
||||
# include <boost/detail/sp_counted_base_gcc_ppc.hpp>
|
||||
|
||||
#elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ )
|
||||
|
||||
# include <boost/detail/sp_counted_base_w32.hpp>
|
||||
|
||||
#elif !defined( BOOST_HAS_THREADS )
|
||||
|
||||
# include <boost/detail/sp_counted_base_nt.hpp>
|
||||
|
||||
#elif defined( BOOST_HAS_PTHREADS )
|
||||
|
||||
# include <boost/detail/sp_counted_base_pt.hpp>
|
||||
|
||||
#else
|
||||
|
||||
// Use #define BOOST_DISABLE_THREADS to avoid the error
|
||||
# error Unrecognized threading platform
|
||||
|
||||
#endif
|
||||
|
||||
#endif // #ifndef BOOST_DETAIL_SP_COUNTED_BASE_HPP_INCLUDED
|
170
boost/boost/detail/sp_counted_base_cw_ppc.hpp
Normal file
170
boost/boost/detail/sp_counted_base_cw_ppc.hpp
Normal file
@ -0,0 +1,170 @@
|
||||
#ifndef BOOST_DETAIL_SP_COUNTED_BASE_CW_PPC_HPP_INCLUDED
|
||||
#define BOOST_DETAIL_SP_COUNTED_BASE_CW_PPC_HPP_INCLUDED
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
//
|
||||
// detail/sp_counted_base_cw_ppc.hpp - CodeWarrior on PowerPC
|
||||
//
|
||||
// Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd.
|
||||
// Copyright 2004-2005 Peter Dimov
|
||||
//
|
||||
// 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)
|
||||
//
|
||||
//
|
||||
// Lock-free algorithm by Alexander Terekhov
|
||||
//
|
||||
// Thanks to Ben Hitchings for the #weak + (#shared != 0)
|
||||
// formulation
|
||||
//
|
||||
|
||||
#include <typeinfo>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
inline void atomic_increment( register long * pw )
|
||||
{
|
||||
register int a;
|
||||
|
||||
asm
|
||||
{
|
||||
loop:
|
||||
|
||||
lwarx a, 0, pw
|
||||
addi a, a, 1
|
||||
stwcx. a, 0, pw
|
||||
bne- loop
|
||||
}
|
||||
}
|
||||
|
||||
inline long atomic_decrement( register long * pw )
|
||||
{
|
||||
register int a;
|
||||
|
||||
asm
|
||||
{
|
||||
sync
|
||||
|
||||
loop:
|
||||
|
||||
lwarx a, 0, pw
|
||||
addi a, a, -1
|
||||
stwcx. a, 0, pw
|
||||
bne- loop
|
||||
|
||||
isync
|
||||
}
|
||||
|
||||
return a;
|
||||
}
|
||||
|
||||
inline long atomic_conditional_increment( register long * pw )
|
||||
{
|
||||
register int a;
|
||||
|
||||
asm
|
||||
{
|
||||
loop:
|
||||
|
||||
lwarx a, 0, pw
|
||||
cmpwi a, 0
|
||||
beq store
|
||||
|
||||
addi a, a, 1
|
||||
|
||||
store:
|
||||
|
||||
stwcx. a, 0, pw
|
||||
bne- loop
|
||||
}
|
||||
|
||||
return a;
|
||||
}
|
||||
|
||||
class sp_counted_base
|
||||
{
|
||||
private:
|
||||
|
||||
sp_counted_base( sp_counted_base const & );
|
||||
sp_counted_base & operator= ( sp_counted_base const & );
|
||||
|
||||
long use_count_; // #shared
|
||||
long weak_count_; // #weak + (#shared != 0)
|
||||
|
||||
public:
|
||||
|
||||
sp_counted_base(): use_count_( 1 ), weak_count_( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~sp_counted_base() // nothrow
|
||||
{
|
||||
}
|
||||
|
||||
// dispose() is called when use_count_ drops to zero, to release
|
||||
// the resources managed by *this.
|
||||
|
||||
virtual void dispose() = 0; // nothrow
|
||||
|
||||
// destroy() is called when weak_count_ drops to zero.
|
||||
|
||||
virtual void destroy() // nothrow
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
|
||||
virtual void * get_deleter( std::type_info const & ti ) = 0;
|
||||
|
||||
void add_ref_copy()
|
||||
{
|
||||
atomic_increment( &use_count_ );
|
||||
}
|
||||
|
||||
bool add_ref_lock() // true on success
|
||||
{
|
||||
return atomic_conditional_increment( &use_count_ ) != 0;
|
||||
}
|
||||
|
||||
void release() // nothrow
|
||||
{
|
||||
if( atomic_decrement( &use_count_ ) == 0 )
|
||||
{
|
||||
dispose();
|
||||
weak_release();
|
||||
}
|
||||
}
|
||||
|
||||
void weak_add_ref() // nothrow
|
||||
{
|
||||
atomic_increment( &weak_count_ );
|
||||
}
|
||||
|
||||
void weak_release() // nothrow
|
||||
{
|
||||
if( atomic_decrement( &weak_count_ ) == 0 )
|
||||
{
|
||||
destroy();
|
||||
}
|
||||
}
|
||||
|
||||
long use_count() const // nothrow
|
||||
{
|
||||
return static_cast<long const volatile &>( use_count_ );
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_DETAIL_SP_COUNTED_BASE_CW_PPC_HPP_INCLUDED
|
181
boost/boost/detail/sp_counted_base_gcc_ppc.hpp
Normal file
181
boost/boost/detail/sp_counted_base_gcc_ppc.hpp
Normal file
@ -0,0 +1,181 @@
|
||||
#ifndef BOOST_DETAIL_SP_COUNTED_BASE_GCC_PPC_HPP_INCLUDED
|
||||
#define BOOST_DETAIL_SP_COUNTED_BASE_GCC_PPC_HPP_INCLUDED
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
//
|
||||
// detail/sp_counted_base_gcc_ppc.hpp - g++ on PowerPC
|
||||
//
|
||||
// Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd.
|
||||
// Copyright 2004-2005 Peter Dimov
|
||||
//
|
||||
// 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)
|
||||
//
|
||||
//
|
||||
// Lock-free algorithm by Alexander Terekhov
|
||||
//
|
||||
// Thanks to Ben Hitchings for the #weak + (#shared != 0)
|
||||
// formulation
|
||||
//
|
||||
|
||||
#include <typeinfo>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
inline void atomic_increment( int * pw )
|
||||
{
|
||||
// ++*pw;
|
||||
|
||||
int tmp;
|
||||
|
||||
__asm__
|
||||
(
|
||||
"0:\n\t"
|
||||
"lwarx %1, 0, %2\n\t"
|
||||
"addi %1, %1, 1\n\t"
|
||||
"stwcx. %1, 0, %2\n\t"
|
||||
"bne- 0b":
|
||||
|
||||
"=m"( *pw ), "=&b"( tmp ):
|
||||
"r"( pw ):
|
||||
"cc"
|
||||
);
|
||||
}
|
||||
|
||||
inline int atomic_decrement( int * pw )
|
||||
{
|
||||
// return --*pw;
|
||||
|
||||
int rv;
|
||||
|
||||
__asm__ __volatile__
|
||||
(
|
||||
"sync\n\t"
|
||||
"0:\n\t"
|
||||
"lwarx %1, 0, %2\n\t"
|
||||
"addi %1, %1, -1\n\t"
|
||||
"stwcx. %1, 0, %2\n\t"
|
||||
"bne- 0b\n\t"
|
||||
"isync":
|
||||
|
||||
"=m"( *pw ), "=&b"( rv ):
|
||||
"r"( pw ):
|
||||
"memory", "cc"
|
||||
);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
inline int atomic_conditional_increment( int * pw )
|
||||
{
|
||||
// if( *pw != 0 ) ++*pw;
|
||||
// return *pw;
|
||||
|
||||
int rv;
|
||||
|
||||
__asm__
|
||||
(
|
||||
"0:\n\t"
|
||||
"lwarx %1, 0, %2\n\t"
|
||||
"cmpwi %1, 0\n\t"
|
||||
"beq 1f\n\t"
|
||||
"addi %1, %1, 1\n\t"
|
||||
"1:\n\t"
|
||||
"stwcx. %1, 0, %2\n\t"
|
||||
"bne- 0b":
|
||||
|
||||
"=m"( *pw ), "=&b"( rv ):
|
||||
"r"( pw ):
|
||||
"cc"
|
||||
);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
class sp_counted_base
|
||||
{
|
||||
private:
|
||||
|
||||
sp_counted_base( sp_counted_base const & );
|
||||
sp_counted_base & operator= ( sp_counted_base const & );
|
||||
|
||||
int use_count_; // #shared
|
||||
int weak_count_; // #weak + (#shared != 0)
|
||||
|
||||
public:
|
||||
|
||||
sp_counted_base(): use_count_( 1 ), weak_count_( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~sp_counted_base() // nothrow
|
||||
{
|
||||
}
|
||||
|
||||
// dispose() is called when use_count_ drops to zero, to release
|
||||
// the resources managed by *this.
|
||||
|
||||
virtual void dispose() = 0; // nothrow
|
||||
|
||||
// destroy() is called when weak_count_ drops to zero.
|
||||
|
||||
virtual void destroy() // nothrow
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
|
||||
virtual void * get_deleter( std::type_info const & ti ) = 0;
|
||||
|
||||
void add_ref_copy()
|
||||
{
|
||||
atomic_increment( &use_count_ );
|
||||
}
|
||||
|
||||
bool add_ref_lock() // true on success
|
||||
{
|
||||
return atomic_conditional_increment( &use_count_ ) != 0;
|
||||
}
|
||||
|
||||
void release() // nothrow
|
||||
{
|
||||
if( atomic_decrement( &use_count_ ) == 0 )
|
||||
{
|
||||
dispose();
|
||||
weak_release();
|
||||
}
|
||||
}
|
||||
|
||||
void weak_add_ref() // nothrow
|
||||
{
|
||||
atomic_increment( &weak_count_ );
|
||||
}
|
||||
|
||||
void weak_release() // nothrow
|
||||
{
|
||||
if( atomic_decrement( &weak_count_ ) == 0 )
|
||||
{
|
||||
destroy();
|
||||
}
|
||||
}
|
||||
|
||||
long use_count() const // nothrow
|
||||
{
|
||||
return static_cast<int const volatile &>( use_count_ );
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_DETAIL_SP_COUNTED_BASE_GCC_PPC_HPP_INCLUDED
|
173
boost/boost/detail/sp_counted_base_gcc_x86.hpp
Normal file
173
boost/boost/detail/sp_counted_base_gcc_x86.hpp
Normal file
@ -0,0 +1,173 @@
|
||||
#ifndef BOOST_DETAIL_SP_COUNTED_BASE_GCC_X86_HPP_INCLUDED
|
||||
#define BOOST_DETAIL_SP_COUNTED_BASE_GCC_X86_HPP_INCLUDED
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
//
|
||||
// detail/sp_counted_base_gcc_x86.hpp - g++ on 486+ or AMD64
|
||||
//
|
||||
// Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd.
|
||||
// Copyright 2004-2005 Peter Dimov
|
||||
//
|
||||
// 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)
|
||||
//
|
||||
//
|
||||
// Lock-free algorithm by Alexander Terekhov
|
||||
//
|
||||
// Thanks to Ben Hitchings for the #weak + (#shared != 0)
|
||||
// formulation
|
||||
//
|
||||
|
||||
#include <typeinfo>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
inline int atomic_exchange_and_add( int * pw, int dv )
|
||||
{
|
||||
// int r = *pw;
|
||||
// *pw += dv;
|
||||
// return r;
|
||||
|
||||
int r;
|
||||
|
||||
__asm__ __volatile__
|
||||
(
|
||||
"lock\n\t"
|
||||
"xadd %1, %0":
|
||||
"=m"( *pw ), "=r"( r ): // outputs (%0, %1)
|
||||
"m"( *pw ), "1"( dv ): // inputs (%2, %3 == %1)
|
||||
"memory", "cc" // clobbers
|
||||
);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
inline void atomic_increment( int * pw )
|
||||
{
|
||||
//atomic_exchange_and_add( pw, 1 );
|
||||
|
||||
__asm__
|
||||
(
|
||||
"lock\n\t"
|
||||
"incl %0":
|
||||
"=m"( *pw ): // output (%0)
|
||||
"m"( *pw ): // input (%1)
|
||||
"cc" // clobbers
|
||||
);
|
||||
}
|
||||
|
||||
inline int atomic_conditional_increment( int * pw )
|
||||
{
|
||||
// int rv = *pw;
|
||||
// if( rv != 0 ) ++*pw;
|
||||
// return rv;
|
||||
|
||||
int rv, tmp;
|
||||
|
||||
__asm__
|
||||
(
|
||||
"movl %0, %%eax\n\t"
|
||||
"0:\n\t"
|
||||
"test %%eax, %%eax\n\t"
|
||||
"je 1f\n\t"
|
||||
"movl %%eax, %2\n\t"
|
||||
"incl %2\n\t"
|
||||
"lock\n\t"
|
||||
"cmpxchgl %2, %0\n\t"
|
||||
"jne 0b\n\t"
|
||||
"1:":
|
||||
"=m"( *pw ), "=&a"( rv ), "=&r"( tmp ): // outputs (%0, %1, %2)
|
||||
"m"( *pw ): // input (%3)
|
||||
"cc" // clobbers
|
||||
);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
class sp_counted_base
|
||||
{
|
||||
private:
|
||||
|
||||
sp_counted_base( sp_counted_base const & );
|
||||
sp_counted_base & operator= ( sp_counted_base const & );
|
||||
|
||||
int use_count_; // #shared
|
||||
int weak_count_; // #weak + (#shared != 0)
|
||||
|
||||
public:
|
||||
|
||||
sp_counted_base(): use_count_( 1 ), weak_count_( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~sp_counted_base() // nothrow
|
||||
{
|
||||
}
|
||||
|
||||
// dispose() is called when use_count_ drops to zero, to release
|
||||
// the resources managed by *this.
|
||||
|
||||
virtual void dispose() = 0; // nothrow
|
||||
|
||||
// destroy() is called when weak_count_ drops to zero.
|
||||
|
||||
virtual void destroy() // nothrow
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
|
||||
virtual void * get_deleter( std::type_info const & ti ) = 0;
|
||||
|
||||
void add_ref_copy()
|
||||
{
|
||||
atomic_increment( &use_count_ );
|
||||
}
|
||||
|
||||
bool add_ref_lock() // true on success
|
||||
{
|
||||
return atomic_conditional_increment( &use_count_ ) != 0;
|
||||
}
|
||||
|
||||
void release() // nothrow
|
||||
{
|
||||
if( atomic_exchange_and_add( &use_count_, -1 ) == 1 )
|
||||
{
|
||||
dispose();
|
||||
weak_release();
|
||||
}
|
||||
}
|
||||
|
||||
void weak_add_ref() // nothrow
|
||||
{
|
||||
atomic_increment( &weak_count_ );
|
||||
}
|
||||
|
||||
void weak_release() // nothrow
|
||||
{
|
||||
if( atomic_exchange_and_add( &weak_count_, -1 ) == 1 )
|
||||
{
|
||||
destroy();
|
||||
}
|
||||
}
|
||||
|
||||
long use_count() const // nothrow
|
||||
{
|
||||
return static_cast<int const volatile &>( use_count_ );
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_DETAIL_SP_COUNTED_BASE_GCC_X86_HPP_INCLUDED
|
107
boost/boost/detail/sp_counted_base_nt.hpp
Normal file
107
boost/boost/detail/sp_counted_base_nt.hpp
Normal file
@ -0,0 +1,107 @@
|
||||
#ifndef BOOST_DETAIL_SP_COUNTED_BASE_NT_HPP_INCLUDED
|
||||
#define BOOST_DETAIL_SP_COUNTED_BASE_NT_HPP_INCLUDED
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
//
|
||||
// detail/sp_counted_base_nt.hpp
|
||||
//
|
||||
// Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd.
|
||||
// Copyright 2004-2005 Peter Dimov
|
||||
//
|
||||
// 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)
|
||||
//
|
||||
|
||||
#include <typeinfo>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
class sp_counted_base
|
||||
{
|
||||
private:
|
||||
|
||||
sp_counted_base( sp_counted_base const & );
|
||||
sp_counted_base & operator= ( sp_counted_base const & );
|
||||
|
||||
long use_count_; // #shared
|
||||
long weak_count_; // #weak + (#shared != 0)
|
||||
|
||||
public:
|
||||
|
||||
sp_counted_base(): use_count_( 1 ), weak_count_( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~sp_counted_base() // nothrow
|
||||
{
|
||||
}
|
||||
|
||||
// dispose() is called when use_count_ drops to zero, to release
|
||||
// the resources managed by *this.
|
||||
|
||||
virtual void dispose() = 0; // nothrow
|
||||
|
||||
// destroy() is called when weak_count_ drops to zero.
|
||||
|
||||
virtual void destroy() // nothrow
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
|
||||
virtual void * get_deleter( std::type_info const & ti ) = 0;
|
||||
|
||||
void add_ref_copy()
|
||||
{
|
||||
++use_count_;
|
||||
}
|
||||
|
||||
bool add_ref_lock() // true on success
|
||||
{
|
||||
if( use_count_ == 0 ) return false;
|
||||
++use_count_;
|
||||
return true;
|
||||
}
|
||||
|
||||
void release() // nothrow
|
||||
{
|
||||
if( --use_count_ == 0 )
|
||||
{
|
||||
dispose();
|
||||
weak_release();
|
||||
}
|
||||
}
|
||||
|
||||
void weak_add_ref() // nothrow
|
||||
{
|
||||
++weak_count_;
|
||||
}
|
||||
|
||||
void weak_release() // nothrow
|
||||
{
|
||||
if( --weak_count_ == 0 )
|
||||
{
|
||||
destroy();
|
||||
}
|
||||
}
|
||||
|
||||
long use_count() const // nothrow
|
||||
{
|
||||
return use_count_;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_DETAIL_SP_COUNTED_BASE_NT_HPP_INCLUDED
|
135
boost/boost/detail/sp_counted_base_pt.hpp
Normal file
135
boost/boost/detail/sp_counted_base_pt.hpp
Normal file
@ -0,0 +1,135 @@
|
||||
#ifndef BOOST_DETAIL_SP_COUNTED_BASE_PT_HPP_INCLUDED
|
||||
#define BOOST_DETAIL_SP_COUNTED_BASE_PT_HPP_INCLUDED
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
//
|
||||
// detail/sp_counted_base_pt.hpp
|
||||
//
|
||||
// Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd.
|
||||
// Copyright 2004-2005 Peter Dimov
|
||||
//
|
||||
// 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)
|
||||
//
|
||||
|
||||
#include <typeinfo>
|
||||
#include <pthread.h>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
class sp_counted_base
|
||||
{
|
||||
private:
|
||||
|
||||
sp_counted_base( sp_counted_base const & );
|
||||
sp_counted_base & operator= ( sp_counted_base const & );
|
||||
|
||||
long use_count_; // #shared
|
||||
long weak_count_; // #weak + (#shared != 0)
|
||||
|
||||
mutable pthread_mutex_t m_;
|
||||
|
||||
public:
|
||||
|
||||
sp_counted_base(): use_count_( 1 ), weak_count_( 1 )
|
||||
{
|
||||
// HPUX 10.20 / DCE has a nonstandard pthread_mutex_init
|
||||
|
||||
#if defined(__hpux) && defined(_DECTHREADS_)
|
||||
pthread_mutex_init( &m_, pthread_mutexattr_default );
|
||||
#else
|
||||
pthread_mutex_init( &m_, 0 );
|
||||
#endif
|
||||
}
|
||||
|
||||
virtual ~sp_counted_base() // nothrow
|
||||
{
|
||||
pthread_mutex_destroy( &m_ );
|
||||
}
|
||||
|
||||
// dispose() is called when use_count_ drops to zero, to release
|
||||
// the resources managed by *this.
|
||||
|
||||
virtual void dispose() = 0; // nothrow
|
||||
|
||||
// destroy() is called when weak_count_ drops to zero.
|
||||
|
||||
virtual void destroy() // nothrow
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
|
||||
virtual void * get_deleter( std::type_info const & ti ) = 0;
|
||||
|
||||
void add_ref_copy()
|
||||
{
|
||||
pthread_mutex_lock( &m_ );
|
||||
++use_count_;
|
||||
pthread_mutex_unlock( &m_ );
|
||||
}
|
||||
|
||||
bool add_ref_lock() // true on success
|
||||
{
|
||||
pthread_mutex_lock( &m_ );
|
||||
bool r = use_count_ == 0? false: ( ++use_count_, true );
|
||||
pthread_mutex_unlock( &m_ );
|
||||
return r;
|
||||
}
|
||||
|
||||
void release() // nothrow
|
||||
{
|
||||
pthread_mutex_lock( &m_ );
|
||||
long new_use_count = --use_count_;
|
||||
pthread_mutex_unlock( &m_ );
|
||||
|
||||
if( new_use_count == 0 )
|
||||
{
|
||||
dispose();
|
||||
weak_release();
|
||||
}
|
||||
}
|
||||
|
||||
void weak_add_ref() // nothrow
|
||||
{
|
||||
pthread_mutex_lock( &m_ );
|
||||
++weak_count_;
|
||||
pthread_mutex_unlock( &m_ );
|
||||
}
|
||||
|
||||
void weak_release() // nothrow
|
||||
{
|
||||
pthread_mutex_lock( &m_ );
|
||||
long new_weak_count = --weak_count_;
|
||||
pthread_mutex_unlock( &m_ );
|
||||
|
||||
if( new_weak_count == 0 )
|
||||
{
|
||||
destroy();
|
||||
}
|
||||
}
|
||||
|
||||
long use_count() const // nothrow
|
||||
{
|
||||
pthread_mutex_lock( &m_ );
|
||||
long r = use_count_;
|
||||
pthread_mutex_unlock( &m_ );
|
||||
|
||||
return r;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_DETAIL_SP_COUNTED_BASE_PT_HPP_INCLUDED
|
117
boost/boost/detail/sp_counted_base_w32.hpp
Normal file
117
boost/boost/detail/sp_counted_base_w32.hpp
Normal file
@ -0,0 +1,117 @@
|
||||
#ifndef BOOST_DETAIL_SP_COUNTED_BASE_W32_HPP_INCLUDED
|
||||
#define BOOST_DETAIL_SP_COUNTED_BASE_W32_HPP_INCLUDED
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
//
|
||||
// detail/sp_counted_base_w32.hpp
|
||||
//
|
||||
// Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd.
|
||||
// Copyright 2004-2005 Peter Dimov
|
||||
//
|
||||
// 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)
|
||||
//
|
||||
//
|
||||
// Lock-free algorithm by Alexander Terekhov
|
||||
//
|
||||
// Thanks to Ben Hitchings for the #weak + (#shared != 0)
|
||||
// formulation
|
||||
//
|
||||
|
||||
#include <boost/detail/interlocked.hpp>
|
||||
#include <typeinfo>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
class sp_counted_base
|
||||
{
|
||||
private:
|
||||
|
||||
sp_counted_base( sp_counted_base const & );
|
||||
sp_counted_base & operator= ( sp_counted_base const & );
|
||||
|
||||
long use_count_; // #shared
|
||||
long weak_count_; // #weak + (#shared != 0)
|
||||
|
||||
public:
|
||||
|
||||
sp_counted_base(): use_count_( 1 ), weak_count_( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~sp_counted_base() // nothrow
|
||||
{
|
||||
}
|
||||
|
||||
// dispose() is called when use_count_ drops to zero, to release
|
||||
// the resources managed by *this.
|
||||
|
||||
virtual void dispose() = 0; // nothrow
|
||||
|
||||
// destroy() is called when weak_count_ drops to zero.
|
||||
|
||||
virtual void destroy() // nothrow
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
|
||||
virtual void * get_deleter( std::type_info const & ti ) = 0;
|
||||
|
||||
void add_ref_copy()
|
||||
{
|
||||
BOOST_INTERLOCKED_INCREMENT( &use_count_ );
|
||||
}
|
||||
|
||||
bool add_ref_lock() // true on success
|
||||
{
|
||||
for( ;; )
|
||||
{
|
||||
long tmp = static_cast< long const volatile& >( use_count_ );
|
||||
if( tmp == 0 ) return false;
|
||||
if( BOOST_INTERLOCKED_COMPARE_EXCHANGE( &use_count_, tmp + 1, tmp ) == tmp ) return true;
|
||||
}
|
||||
}
|
||||
|
||||
void release() // nothrow
|
||||
{
|
||||
if( BOOST_INTERLOCKED_DECREMENT( &use_count_ ) == 0 )
|
||||
{
|
||||
dispose();
|
||||
weak_release();
|
||||
}
|
||||
}
|
||||
|
||||
void weak_add_ref() // nothrow
|
||||
{
|
||||
BOOST_INTERLOCKED_INCREMENT( &weak_count_ );
|
||||
}
|
||||
|
||||
void weak_release() // nothrow
|
||||
{
|
||||
if( BOOST_INTERLOCKED_DECREMENT( &weak_count_ ) == 0 )
|
||||
{
|
||||
destroy();
|
||||
}
|
||||
}
|
||||
|
||||
long use_count() const // nothrow
|
||||
{
|
||||
return static_cast<long const volatile &>( use_count_ );
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_DETAIL_SP_COUNTED_BASE_W32_HPP_INCLUDED
|
187
boost/boost/detail/sp_counted_impl.hpp
Normal file
187
boost/boost/detail/sp_counted_impl.hpp
Normal file
@ -0,0 +1,187 @@
|
||||
#ifndef BOOST_DETAIL_SP_COUNTED_IMPL_HPP_INCLUDED
|
||||
#define BOOST_DETAIL_SP_COUNTED_IMPL_HPP_INCLUDED
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
//
|
||||
// detail/sp_counted_impl.hpp
|
||||
//
|
||||
// Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd.
|
||||
// Copyright 2004-2005 Peter Dimov
|
||||
//
|
||||
// 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)
|
||||
//
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#if defined(BOOST_SP_USE_STD_ALLOCATOR) && defined(BOOST_SP_USE_QUICK_ALLOCATOR)
|
||||
# error BOOST_SP_USE_STD_ALLOCATOR and BOOST_SP_USE_QUICK_ALLOCATOR are incompatible.
|
||||
#endif
|
||||
|
||||
#include <boost/checked_delete.hpp>
|
||||
#include <boost/detail/sp_counted_base.hpp>
|
||||
|
||||
#if defined(BOOST_SP_USE_QUICK_ALLOCATOR)
|
||||
#include <boost/detail/quick_allocator.hpp>
|
||||
#endif
|
||||
|
||||
#include <memory> // std::allocator
|
||||
#include <typeinfo> // std::type_info in get_deleter
|
||||
#include <cstddef> // std::size_t
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||
|
||||
void sp_scalar_constructor_hook( void * px, std::size_t size, void * pn );
|
||||
void sp_scalar_destructor_hook( void * px, std::size_t size, void * pn );
|
||||
|
||||
#endif
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
template<class X> class sp_counted_impl_p: public sp_counted_base
|
||||
{
|
||||
private:
|
||||
|
||||
X * px_;
|
||||
|
||||
sp_counted_impl_p( sp_counted_impl_p const & );
|
||||
sp_counted_impl_p & operator= ( sp_counted_impl_p const & );
|
||||
|
||||
typedef sp_counted_impl_p<X> this_type;
|
||||
|
||||
public:
|
||||
|
||||
explicit sp_counted_impl_p( X * px ): px_( px )
|
||||
{
|
||||
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||
boost::sp_scalar_constructor_hook( px, sizeof(X), this );
|
||||
#endif
|
||||
}
|
||||
|
||||
virtual void dispose() // nothrow
|
||||
{
|
||||
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||
boost::sp_scalar_destructor_hook( px_, sizeof(X), this );
|
||||
#endif
|
||||
boost::checked_delete( px_ );
|
||||
}
|
||||
|
||||
virtual void * get_deleter( std::type_info const & )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined(BOOST_SP_USE_STD_ALLOCATOR)
|
||||
|
||||
void * operator new( std::size_t )
|
||||
{
|
||||
return std::allocator<this_type>().allocate( 1, static_cast<this_type *>(0) );
|
||||
}
|
||||
|
||||
void operator delete( void * p )
|
||||
{
|
||||
std::allocator<this_type>().deallocate( static_cast<this_type *>(p), 1 );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_SP_USE_QUICK_ALLOCATOR)
|
||||
|
||||
void * operator new( std::size_t )
|
||||
{
|
||||
return quick_allocator<this_type>::alloc();
|
||||
}
|
||||
|
||||
void operator delete( void * p )
|
||||
{
|
||||
quick_allocator<this_type>::dealloc( p );
|
||||
}
|
||||
|
||||
#endif
|
||||
};
|
||||
|
||||
//
|
||||
// Borland's Codeguard trips up over the -Vx- option here:
|
||||
//
|
||||
#ifdef __CODEGUARD__
|
||||
# pragma option push -Vx-
|
||||
#endif
|
||||
|
||||
template<class P, class D> class sp_counted_impl_pd: public sp_counted_base
|
||||
{
|
||||
private:
|
||||
|
||||
P ptr; // copy constructor must not throw
|
||||
D del; // copy constructor must not throw
|
||||
|
||||
sp_counted_impl_pd( sp_counted_impl_pd const & );
|
||||
sp_counted_impl_pd & operator= ( sp_counted_impl_pd const & );
|
||||
|
||||
typedef sp_counted_impl_pd<P, D> this_type;
|
||||
|
||||
public:
|
||||
|
||||
// pre: d(p) must not throw
|
||||
|
||||
sp_counted_impl_pd( P p, D d ): ptr(p), del(d)
|
||||
{
|
||||
}
|
||||
|
||||
virtual void dispose() // nothrow
|
||||
{
|
||||
del( ptr );
|
||||
}
|
||||
|
||||
virtual void * get_deleter( std::type_info const & ti )
|
||||
{
|
||||
return ti == typeid(D)? &del: 0;
|
||||
}
|
||||
|
||||
#if defined(BOOST_SP_USE_STD_ALLOCATOR)
|
||||
|
||||
void * operator new( std::size_t )
|
||||
{
|
||||
return std::allocator<this_type>().allocate( 1, static_cast<this_type *>(0) );
|
||||
}
|
||||
|
||||
void operator delete( void * p )
|
||||
{
|
||||
std::allocator<this_type>().deallocate( static_cast<this_type *>(p), 1 );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_SP_USE_QUICK_ALLOCATOR)
|
||||
|
||||
void * operator new( std::size_t )
|
||||
{
|
||||
return quick_allocator<this_type>::alloc();
|
||||
}
|
||||
|
||||
void operator delete( void * p )
|
||||
{
|
||||
quick_allocator<this_type>::dealloc( p );
|
||||
}
|
||||
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifdef __CODEGUARD__
|
||||
# pragma option pop
|
||||
#endif
|
||||
|
||||
} // namespace detail
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_DETAIL_SP_COUNTED_IMPL_HPP_INCLUDED
|
@ -19,6 +19,10 @@
|
||||
|
||||
// enable dynamic linking on Windows ---------------------------------------//
|
||||
|
||||
# if (defined(BOOST_ALL_DYN_LINK) || defined(BOOST_FILESYSTEM_DYN_LINK)) && defined(__BORLANDC__) && defined(__WIN32__)
|
||||
# error Dynamic linking Boost.Filesystem does not work for Borland; use static linking instead
|
||||
# endif
|
||||
|
||||
#ifdef BOOST_HAS_DECLSPEC // defined in config system
|
||||
// we need to import/export our code only if the user has specifically
|
||||
// asked for it by defining either BOOST_ALL_DYN_LINK if they want all boost
|
||||
|
@ -91,8 +91,8 @@ namespace boost
|
||||
reference dereference() const { return m_name; }
|
||||
bool equal( const iterator & rhs ) const
|
||||
{ return m_path_ptr == rhs.m_path_ptr && m_pos == rhs.m_pos; }
|
||||
void increment();
|
||||
void decrement();
|
||||
BOOST_FILESYSTEM_DECL void increment();
|
||||
BOOST_FILESYSTEM_DECL void decrement();
|
||||
|
||||
std::string m_name; // cache current element.
|
||||
const path * m_path_ptr; // path being iterated over.
|
||||
|
@ -48,6 +48,7 @@ namespace boost {
|
||||
typedef typename compat_traits_type::off_type off_type;
|
||||
typedef Alloc allocator_type;
|
||||
typedef ::std::basic_string<Ch, Tr, Alloc> string_type;
|
||||
typedef typename string_type::size_type size_type;
|
||||
|
||||
typedef ::std::streamsize streamsize;
|
||||
|
||||
@ -75,12 +76,12 @@ namespace boost {
|
||||
|
||||
// 0-copy access :
|
||||
Ch * begin() const;
|
||||
streamsize size() const;
|
||||
streamsize cur_size() const; // stop at current pointer
|
||||
size_type size() const;
|
||||
size_type cur_size() const; // stop at current pointer
|
||||
Ch * pend() const // the highest position reached by pptr() since creation
|
||||
{ return ((putend_ < pptr()) ? pptr() : putend_); }
|
||||
streamsize pcount() const
|
||||
{ return static_cast<streamsize>( pptr() - pbase()) ;}
|
||||
size_type pcount() const
|
||||
{ return static_cast<size_type>( pptr() - pbase()) ;}
|
||||
|
||||
// copy buffer to string :
|
||||
string_type str() const
|
||||
@ -131,6 +132,7 @@ namespace boost {
|
||||
basic_altstringbuf<Ch,Tr, Alloc> > >
|
||||
pbase_type;
|
||||
typedef ::std::basic_string<Ch, Tr, Alloc> string_type;
|
||||
typedef typename string_type::size_type size_type;
|
||||
typedef basic_altstringbuf<Ch, Tr, Alloc> stringbuf_t;
|
||||
public:
|
||||
typedef Alloc allocator_type;
|
||||
@ -151,9 +153,9 @@ namespace boost {
|
||||
// 0-copy access :
|
||||
Ch * begin() const
|
||||
{ return rdbuf()->begin(); }
|
||||
::std::streamsize size() const
|
||||
size_type size() const
|
||||
{ return rdbuf()->size(); }
|
||||
::std::streamsize cur_size() const // stops at current position
|
||||
size_type cur_size() const // stops at current position
|
||||
{ return rdbuf()->cur_size(); }
|
||||
|
||||
// copy buffer to string :
|
||||
@ -161,6 +163,8 @@ namespace boost {
|
||||
{ return rdbuf()->str(); }
|
||||
string_type cur_str() const // [pbase, pptr[
|
||||
{ return rdbuf()->cur_str(); }
|
||||
void str(const string_type& s)
|
||||
{ rdbuf()->str(s); }
|
||||
};
|
||||
|
||||
} // N.S. io
|
||||
|
@ -35,19 +35,19 @@ namespace boost {
|
||||
template<class Ch, class Tr, class Alloc>
|
||||
void basic_altstringbuf<Ch, Tr, Alloc>::
|
||||
str (const string_type& s) {
|
||||
std::size_t sz=s.size();
|
||||
size_type sz=s.size();
|
||||
if(sz != 0 && mode_ & (::std::ios_base::in | ::std::ios_base::out) ) {
|
||||
Ch *new_ptr = alloc_.allocate(sz, is_allocated_? eback() : 0);
|
||||
// if this didnt throw, we're safe, update the buffer
|
||||
dealloc();
|
||||
sz = s.copy(new_ptr);
|
||||
sz = s.copy(new_ptr, sz);
|
||||
putend_ = new_ptr + sz;
|
||||
if(mode_ & ::std::ios_base::in)
|
||||
streambuf_t::setg(new_ptr, new_ptr, new_ptr + sz);
|
||||
if(mode_ & ::std::ios_base::out) {
|
||||
streambuf_t::setp(new_ptr, new_ptr + sz);
|
||||
if(mode_ & (::std::ios_base::app | ::std::ios_base::ate))
|
||||
streambuf_t::pbump(sz);
|
||||
streambuf_t::pbump(static_cast<int>(sz));
|
||||
if(gptr() == NULL)
|
||||
streambuf_t::setg(new_ptr, NULL, new_ptr);
|
||||
}
|
||||
@ -67,18 +67,20 @@ namespace boost {
|
||||
}
|
||||
|
||||
template<class Ch, class Tr, class Alloc>
|
||||
std::streamsize basic_altstringbuf<Ch, Tr, Alloc>::
|
||||
typename std::basic_string<Ch,Tr,Alloc>::size_type
|
||||
basic_altstringbuf<Ch, Tr, Alloc>::
|
||||
size () const {
|
||||
if(mode_ & ::std::ios_base::out && pptr())
|
||||
return static_cast<streamsize>( pend() - pbase());
|
||||
return static_cast<size_type>(pend() - pbase());
|
||||
else if(mode_ & ::std::ios_base::in && gptr())
|
||||
return static_cast<streamsize>( egptr() - eback());
|
||||
return static_cast<size_type>(egptr() - eback());
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
template<class Ch, class Tr, class Alloc>
|
||||
std::streamsize basic_altstringbuf<Ch, Tr, Alloc>::
|
||||
typename std::basic_string<Ch,Tr,Alloc>::size_type
|
||||
basic_altstringbuf<Ch, Tr, Alloc>::
|
||||
cur_size () const {
|
||||
if(mode_ & ::std::ios_base::out && pptr())
|
||||
return static_cast<streamsize>( pptr() - pbase());
|
||||
@ -97,17 +99,18 @@ namespace boost {
|
||||
if(which & ::std::ios_base::in && gptr() != NULL) {
|
||||
// get area
|
||||
if(way == ::std::ios_base::end)
|
||||
off += putend_ - eback();
|
||||
else if(way == ::std::ios_base::cur && (which & ::std::ios_base::out) == 0)
|
||||
off += gptr() - eback();
|
||||
else if(way != ::std::ios_base::beg)
|
||||
off = off_type(-1);
|
||||
if(0 <= off && off <= putend_ - eback()) {
|
||||
off += static_cast<off_type>(putend_ - gptr());
|
||||
else if(way == ::std::ios_base::beg)
|
||||
off += static_cast<off_type>(eback() - gptr());
|
||||
else if(way != ::std::ios_base::cur || (which & ::std::ios_base::out) )
|
||||
// (altering in&out is only supported if way is beg or end, not cur)
|
||||
return pos_type(off_type(-1));
|
||||
if(eback() <= off+gptr() && off+gptr() <= putend_ ) {
|
||||
// set gptr
|
||||
streambuf_t::gbump(off + (eback() - gptr()));
|
||||
streambuf_t::gbump(off);
|
||||
if(which & ::std::ios_base::out && pptr() != NULL)
|
||||
// update pptr to match gptr
|
||||
streambuf_t::pbump(gptr()-pptr());
|
||||
streambuf_t::pbump(static_cast<int>(gptr()-pptr()));
|
||||
}
|
||||
else
|
||||
off = off_type(-1);
|
||||
@ -115,15 +118,14 @@ namespace boost {
|
||||
else if(which & ::std::ios_base::out && pptr() != NULL) {
|
||||
// put area
|
||||
if(way == ::std::ios_base::end)
|
||||
off += putend_ - eback();
|
||||
else if(way == ::std::ios_base::cur)
|
||||
off += pptr() - eback();
|
||||
off += static_cast<off_type>(putend_ - pptr());
|
||||
else if(way == ::std::ios_base::beg)
|
||||
off += static_cast<off_type>(pbase() - pptr());
|
||||
else if(way != ::std::ios_base::beg)
|
||||
off = off_type(-1);
|
||||
|
||||
if(0 <= off && off <= putend_ - eback())
|
||||
return pos_type(off_type(-1));
|
||||
if(pbase() <= off+pptr() && off+pptr() <= putend_)
|
||||
// set pptr
|
||||
streambuf_t::pbump((int)(eback() - pptr() + off));
|
||||
streambuf_t::pbump(off);
|
||||
else
|
||||
off = off_type(-1);
|
||||
}
|
||||
@ -145,10 +147,10 @@ namespace boost {
|
||||
if(which & ::std::ios_base::in && gptr() != NULL) {
|
||||
// get area
|
||||
if(0 <= off && off <= putend_ - eback()) {
|
||||
streambuf_t::gbump((int)(eback() - gptr() + off));
|
||||
streambuf_t::gbump(static_cast<int>(eback() - gptr() + off));
|
||||
if(which & ::std::ios_base::out && pptr() != NULL) {
|
||||
// update pptr to match gptr
|
||||
streambuf_t::pbump(gptr()-pptr());
|
||||
streambuf_t::pbump(static_cast<int>(gptr()-pptr()));
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -157,7 +159,7 @@ namespace boost {
|
||||
else if(which & ::std::ios_base::out && pptr() != NULL) {
|
||||
// put area
|
||||
if(0 <= off && off <= putend_ - eback())
|
||||
streambuf_t::pbump(eback() - pptr() + off);
|
||||
streambuf_t::pbump(static_cast<int>(eback() - pptr() + off));
|
||||
else
|
||||
off = off_type(-1);
|
||||
}
|
||||
@ -262,8 +264,8 @@ namespace boost {
|
||||
}
|
||||
else { // update pointers
|
||||
putend_ = putend_ - oldptr + newptr;
|
||||
int pptr_count = pptr()-pbase();
|
||||
int gptr_count = gptr()-eback();
|
||||
int pptr_count = static_cast<int>(pptr()-pbase());
|
||||
int gptr_count = static_cast<int>(gptr()-eback());
|
||||
streambuf_t::setp(pbase() - oldptr + newptr, newptr + new_size);
|
||||
streambuf_t::pbump(pptr_count);
|
||||
if(mode_ & ::std::ios_base::in)
|
||||
|
@ -42,7 +42,7 @@
|
||||
|| BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT( 0x570 ) ) )
|
||||
// some future __BORLANDC__ >0x564 versions might not need this
|
||||
// 0x570 is Borland's kylix branch
|
||||
#define BOOST_NO_LOCALE_ISIDIGIT
|
||||
#define BOOST_NO_LOCALE_ISDIGIT
|
||||
#endif
|
||||
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570) ) || BOOST_WORKAROUND( BOOST_MSVC, BOOST_TESTED_AT(1300))
|
||||
|
@ -14,7 +14,8 @@
|
||||
#ifndef BOOST_MSVC_DISAMBIGUATER_HPP
|
||||
#define BOOST_MSVC_DISAMBIGUATER_HPP
|
||||
|
||||
#if BOOST_WORKAROUND( BOOST_MSVC, <= 1300)
|
||||
#if BOOST_WORKAROUND( BOOST_MSVC, <= 1300) || \
|
||||
BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590042))
|
||||
// this whole header is specifically for msvc up to 7.0
|
||||
|
||||
#include <boost/format/group.hpp>
|
||||
|
@ -14,8 +14,8 @@
|
||||
#ifdef BOOST_NO_OVERLOAD_FOR_NON_CONST
|
||||
#undef BOOST_NO_OVERLOAD_FOR_NON_CONST
|
||||
#endif
|
||||
#ifdef BOOST_NO_LOCALE_ISIDIGIT
|
||||
#undef BOOST_NO_LOCALE_ISIDIGIT
|
||||
#ifdef BOOST_NO_LOCALE_ISDIGIT
|
||||
#undef BOOST_NO_LOCALE_ISDIGIT
|
||||
#endif
|
||||
#ifdef BOOST_IO_STD
|
||||
#undef BOOST_IO_STD
|
||||
|
@ -29,7 +29,7 @@ namespace detail {
|
||||
template<class Ch, class Tr, class Alloc>
|
||||
void mk_str( std::basic_string<Ch,Tr, Alloc> & res,
|
||||
const Ch * beg,
|
||||
std::streamsize size,
|
||||
typename std::basic_string<Ch,Tr,Alloc>::size_type size,
|
||||
std::streamsize w,
|
||||
const Ch fill_char,
|
||||
std::ios_base::fmtflags f,
|
||||
@ -38,14 +38,18 @@ namespace detail {
|
||||
// applies centered/left/right padding to the string [beg, beg+size[
|
||||
// Effects : the result is placed in res.
|
||||
{
|
||||
typedef typename std::basic_string<Ch,Tr,Alloc>::size_type size_type;
|
||||
res.resize(0);
|
||||
std::streamsize n=w-size-!!prefix_space;
|
||||
std::streamsize n_after = 0, n_before = 0;
|
||||
|
||||
if(n<=0) { // no need to pad.
|
||||
if(w<=0 || static_cast<size_type>(w) <=size) {
|
||||
// no need to pad.
|
||||
res.reserve(size + !!prefix_space);
|
||||
if(prefix_space)
|
||||
res.append(1, prefix_space);
|
||||
res.append(beg, size);
|
||||
}
|
||||
else {
|
||||
std::streamsize n=static_cast<std::streamsize>(w-size-!!prefix_space);
|
||||
std::streamsize n_after = 0, n_before = 0;
|
||||
res.reserve(w); // allocate once for the 2 inserts
|
||||
if(center)
|
||||
n_after = n/2, n_before = n - n_after;
|
||||
@ -54,17 +58,18 @@ namespace detail {
|
||||
n_after = n;
|
||||
else
|
||||
n_before = n;
|
||||
}
|
||||
// now make the res string :
|
||||
if(n_before) res.append(n_before, fill_char);
|
||||
if(prefix_space)
|
||||
res.append(1, prefix_space);
|
||||
res.append(beg, size);
|
||||
if(n_after) res.append(n_after, fill_char);
|
||||
}
|
||||
} // -mk_str(..)
|
||||
|
||||
|
||||
#if BOOST_WORKAROUND( BOOST_MSVC, <= 1300)
|
||||
#if BOOST_WORKAROUND( BOOST_MSVC, <= 1300) || \
|
||||
BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590042))
|
||||
// MSVC needs to be tricked to disambiguate this simple overload..
|
||||
// the trick is in "boost/format/msvc_disambiguater.hpp"
|
||||
|
||||
@ -149,8 +154,8 @@ namespace detail {
|
||||
if(buf.pcount()== 0 ||
|
||||
(res_beg[0] !=oss.widen('+') && res_beg[0] !=oss.widen('-') ))
|
||||
prefix_space = oss.widen(' ');
|
||||
std::streamsize res_size = (std::min)(
|
||||
static_cast<std::streamsize>(specs.truncate_ - !!prefix_space),
|
||||
size_type res_size = (std::min)(
|
||||
static_cast<size_type>(specs.truncate_ - !!prefix_space),
|
||||
buf.pcount() );
|
||||
mk_str(res, res_beg, res_size, w, oss.fill(), fl,
|
||||
prefix_space, (specs.pad_scheme_ & format_item_t::centered) !=0 );
|
||||
@ -161,13 +166,13 @@ namespace detail {
|
||||
// but spacepad or truncate might be mixed with internal (using manipulator)
|
||||
put_last( oss, x); // may pad
|
||||
const Ch * res_beg = buf.pbase();
|
||||
std::streamsize res_size = buf.pcount();
|
||||
size_type res_size = buf.pcount();
|
||||
bool prefix_space=false;
|
||||
if(specs.pad_scheme_ & format_item_t::spacepad)
|
||||
if(buf.pcount()== 0 ||
|
||||
(res_beg[0] !=oss.widen('+') && res_beg[0] !=oss.widen('-') ))
|
||||
prefix_space = true;
|
||||
if(res_size == w && w<=specs.truncate_ && !prefix_space) {
|
||||
if(res_size == static_cast<size_type>(w) && w<=specs.truncate_ && !prefix_space) {
|
||||
// okay, only one thing was printed and padded, so res is fine
|
||||
res.assign(res_beg, res_size);
|
||||
}
|
||||
@ -194,25 +199,28 @@ namespace detail {
|
||||
}
|
||||
// we now have the minimal-length output
|
||||
const Ch * tmp_beg = buf.pbase();
|
||||
std::streamsize tmp_size = (std::min)(static_cast<std::streamsize>(specs.truncate_),
|
||||
size_type tmp_size = (std::min)(static_cast<size_type>(specs.truncate_),
|
||||
buf.pcount() );
|
||||
|
||||
std::streamsize d;
|
||||
if( (d=w - tmp_size) <=0 ) {
|
||||
|
||||
if(static_cast<size_type>(w) <= tmp_size) {
|
||||
// minimal length is already >= w, so no padding (cool!)
|
||||
res.assign(tmp_beg, tmp_size);
|
||||
}
|
||||
else { // hum.. we need to pad (multi_output, or spacepad present)
|
||||
std::streamsize i = prefix_space;
|
||||
//find where we should pad
|
||||
std::streamsize sz = (std::min)(res_size+prefix_space, tmp_size);
|
||||
size_type sz = (std::min)(res_size+prefix_space, tmp_size);
|
||||
size_type i = prefix_space;
|
||||
for(; i<sz && tmp_beg[i] == res[i-prefix_space]; ++i) {}
|
||||
if(i>=tmp_size) i=prefix_space;
|
||||
res.assign(tmp_beg, i);
|
||||
if(d>0) res.append(static_cast<size_type>( d ), oss2.fill());
|
||||
std::streamsize d = w - static_cast<std::streamsize>(tmp_size);
|
||||
BOOST_ASSERT(d>0);
|
||||
res.append(static_cast<size_type>( d ), oss2.fill());
|
||||
res.append(tmp_beg+i, tmp_size-i);
|
||||
BOOST_ASSERT(i+(tmp_size-i)+(std::max)(d,(std::streamsize)0) == w);
|
||||
BOOST_ASSERT(res.size() == (std::size_t)w);
|
||||
BOOST_ASSERT(i+(tmp_size-i)+(std::max)(d,(std::streamsize)0)
|
||||
== static_cast<size_type>(w));
|
||||
BOOST_ASSERT(res.size() == static_cast<size_type>(w));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ namespace boost {
|
||||
#if !defined( BOOST_NO_MEMBER_TEMPLATE_FRIENDS ) \
|
||||
&& !BOOST_WORKAROUND(__BORLANDC__, <= 0x570) \
|
||||
&& !BOOST_WORKAROUND( _CRAYC, != 0) \
|
||||
&& !BOOST_WORKAROUND(__DECCXX_VER, <= 60590041)
|
||||
&& !BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590042))
|
||||
// use friend templates and private members only if supported
|
||||
|
||||
#ifndef BOOST_NO_TEMPLATE_STD_STREAM
|
||||
|
@ -190,9 +190,9 @@ namespace boost {
|
||||
res += item.res_;
|
||||
if( item.argN_ == format_item_t::argN_tabulation) {
|
||||
BOOST_ASSERT( item.pad_scheme_ & format_item_t::tabulation);
|
||||
std::streamsize n = item.fmtstate_.width_ - res.size();
|
||||
if( n > 0 )
|
||||
res.append( n, item.fmtstate_.fill_ );
|
||||
if( static_cast<size_type>(item.fmtstate_.width_) > res.size() )
|
||||
res.append( static_cast<size_type>(item.fmtstate_.width_) - res.size(),
|
||||
item.fmtstate_.fill_ );
|
||||
}
|
||||
res += item.appendix_;
|
||||
}
|
||||
@ -200,19 +200,20 @@ namespace boost {
|
||||
return res;
|
||||
}
|
||||
template< class Ch, class Tr, class Alloc>
|
||||
typename basic_format<Ch, Tr, Alloc>::size_type basic_format<Ch,Tr, Alloc>::
|
||||
typename std::basic_string<Ch, Tr, Alloc>::size_type basic_format<Ch,Tr, Alloc>::
|
||||
size () const {
|
||||
BOOST_USING_STD_MAX();
|
||||
std::streamsize sz = prefix_.size();
|
||||
size_type sz = prefix_.size();
|
||||
unsigned long i;
|
||||
for(i=0; i < items_.size(); ++i) {
|
||||
const format_item_t& item = items_[i];
|
||||
sz += item.res_.size();
|
||||
if( item.argN_ == format_item_t::argN_tabulation)
|
||||
sz = max BOOST_PREVENT_MACRO_SUBSTITUTION (sz, item.fmtstate_.width_);
|
||||
sz += + item.appendix_.size();
|
||||
sz = max BOOST_PREVENT_MACRO_SUBSTITUTION (sz,
|
||||
static_cast<size_type>(item.fmtstate_.width_) );
|
||||
sz += item.appendix_.size();
|
||||
}
|
||||
return static_cast<typename string_type::size_type> (sz);
|
||||
return sz;
|
||||
}
|
||||
|
||||
namespace io {
|
||||
|
@ -44,7 +44,7 @@ namespace detail {
|
||||
|
||||
template<class Ch, class Facet> inline
|
||||
bool wrap_isdigit(const Facet& fac, Ch c) {
|
||||
#if ! defined( BOOST_NO_LOCALE_ISIDIGIT )
|
||||
#if ! defined( BOOST_NO_LOCALE_ISDIGIT )
|
||||
return fac.is(std::ctype<Ch>::digit, c);
|
||||
# else
|
||||
using namespace std;
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include <boost/function/detail/prologue.hpp>
|
||||
|
||||
// Visual Age C++ doesn't handle the file iteration well
|
||||
#if BOOST_WORKAROUND(__IBMCPP__, <= 600)
|
||||
#if BOOST_WORKAROUND(__IBMCPP__, >= 500)
|
||||
# if BOOST_FUNCTION_MAX_ARGS >= 0
|
||||
# include <boost/function/function0.hpp>
|
||||
# endif
|
||||
|
@ -63,11 +63,19 @@ namespace boost { namespace python { namespace objects {
|
||||
# define BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX
|
||||
#endif
|
||||
|
||||
#define BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor,Type) \
|
||||
#if !BOOST_WORKAROUND(__BORLANDC__, < 0x600)
|
||||
# define BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor,Type) \
|
||||
typename ::boost::enable_if_c<(::boost::type_traits::ice_not< \
|
||||
(::boost::is_integral<Functor>::value)>::value), \
|
||||
Type>::type
|
||||
|
||||
#else
|
||||
// BCC doesn't recognize this depends on a template argument and complains
|
||||
// about the use of 'typename'
|
||||
# define BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor,Type) \
|
||||
::boost::enable_if_c<(::boost::type_traits::ice_not< \
|
||||
(::boost::is_integral<Functor>::value)>::value), \
|
||||
Type>::type
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX)
|
||||
namespace boost {
|
||||
@ -414,7 +422,12 @@ public:
|
||||
}
|
||||
|
||||
template<typename Functor>
|
||||
|
||||
#if defined(BOOST_MSVC) && BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
const Functor* target( Functor * = 0 ) const
|
||||
#else
|
||||
const Functor* target() const
|
||||
#endif
|
||||
{
|
||||
if (!manager) return 0;
|
||||
|
||||
@ -424,14 +437,23 @@ public:
|
||||
if (!result.obj_ptr) return 0;
|
||||
else {
|
||||
typedef typename detail::function::get_function_tag<Functor>::type tag;
|
||||
|
||||
#if defined(BOOST_MSVC) && BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
return get_functor_pointer(tag(), 0, (Functor*)0);
|
||||
#else
|
||||
return get_functor_pointer<Functor>(tag(), 0);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
template<typename F>
|
||||
bool contains(const F& f) const
|
||||
{
|
||||
#if defined(BOOST_MSVC) && BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
if (const F* fp = this->target( (F*)0 )) {
|
||||
#else
|
||||
if (const F* fp = this->template target<F>()) {
|
||||
#endif
|
||||
return function_equal(*fp, f);
|
||||
} else {
|
||||
return false;
|
||||
@ -469,20 +491,36 @@ public: // should be protected, but GCC 2.95.3 will fail to allow access
|
||||
|
||||
private:
|
||||
template<typename Functor>
|
||||
#if defined(BOOST_MSVC) && BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
Functor* get_functor_pointer(detail::function::function_ptr_tag, int, Functor * = 0)
|
||||
#else
|
||||
Functor* get_functor_pointer(detail::function::function_ptr_tag, int)
|
||||
#endif
|
||||
{ return reinterpret_cast<Functor*>(&functor.func_ptr); }
|
||||
|
||||
template<typename Functor, typename Tag>
|
||||
#if defined(BOOST_MSVC) && BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
Functor* get_functor_pointer(Tag, long, Functor * = 0)
|
||||
#else
|
||||
Functor* get_functor_pointer(Tag, long)
|
||||
#endif
|
||||
{ return static_cast<Functor*>(functor.obj_ptr); }
|
||||
|
||||
template<typename Functor>
|
||||
const Functor*
|
||||
#if defined(BOOST_MSVC) && BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
get_functor_pointer(detail::function::function_ptr_tag, int, Functor * = 0) const
|
||||
#else
|
||||
get_functor_pointer(detail::function::function_ptr_tag, int) const
|
||||
#endif
|
||||
{ return reinterpret_cast<const Functor*>(&functor.func_ptr); }
|
||||
|
||||
template<typename Functor, typename Tag>
|
||||
#if defined(BOOST_MSVC) && BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
const Functor* get_functor_pointer(Tag, long, Functor * = 0) const
|
||||
#else
|
||||
const Functor* get_functor_pointer(Tag, long) const
|
||||
#endif
|
||||
{ return static_cast<const Functor*>(functor.const_obj_ptr); }
|
||||
};
|
||||
|
||||
|
@ -61,6 +61,14 @@
|
||||
#define BOOST_FUNCTION_GET_STATELESS_FUNCTION_OBJ_INVOKER \
|
||||
BOOST_JOIN(get_stateless_function_obj_invoker,BOOST_FUNCTION_NUM_ARGS)
|
||||
|
||||
#ifndef BOOST_NO_VOID_RETURNS
|
||||
# define BOOST_FUNCTION_VOID_RETURN_TYPE void
|
||||
# define BOOST_FUNCTION_RETURN(X) X
|
||||
#else
|
||||
# define BOOST_FUNCTION_VOID_RETURN_TYPE ::boost::detail::function::unusable
|
||||
# define BOOST_FUNCTION_RETURN(X) X; return BOOST_FUNCTION_VOID_RETURN_TYPE ()
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace function {
|
||||
@ -86,13 +94,13 @@ namespace boost {
|
||||
>
|
||||
struct BOOST_FUNCTION_VOID_FUNCTION_INVOKER
|
||||
{
|
||||
static unusable invoke(any_pointer function_ptr BOOST_FUNCTION_COMMA
|
||||
static BOOST_FUNCTION_VOID_RETURN_TYPE
|
||||
invoke(any_pointer function_ptr BOOST_FUNCTION_COMMA
|
||||
BOOST_FUNCTION_PARMS)
|
||||
|
||||
{
|
||||
FunctionPtr f = reinterpret_cast<FunctionPtr>(function_ptr.func_ptr);
|
||||
f(BOOST_FUNCTION_ARGS);
|
||||
return unusable();
|
||||
BOOST_FUNCTION_RETURN(f(BOOST_FUNCTION_ARGS));
|
||||
}
|
||||
};
|
||||
|
||||
@ -119,14 +127,13 @@ namespace boost {
|
||||
>
|
||||
struct BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER
|
||||
{
|
||||
static unusable invoke(any_pointer function_obj_ptr
|
||||
BOOST_FUNCTION_COMMA
|
||||
static BOOST_FUNCTION_VOID_RETURN_TYPE
|
||||
invoke(any_pointer function_obj_ptr BOOST_FUNCTION_COMMA
|
||||
BOOST_FUNCTION_PARMS)
|
||||
|
||||
{
|
||||
FunctionObj* f = (FunctionObj*)(function_obj_ptr.obj_ptr);
|
||||
(*f)(BOOST_FUNCTION_ARGS);
|
||||
return unusable();
|
||||
BOOST_FUNCTION_RETURN((*f)(BOOST_FUNCTION_ARGS));
|
||||
}
|
||||
};
|
||||
|
||||
@ -151,13 +158,12 @@ namespace boost {
|
||||
>
|
||||
struct BOOST_FUNCTION_STATELESS_VOID_FUNCTION_OBJ_INVOKER
|
||||
{
|
||||
static unusable invoke(any_pointer BOOST_FUNCTION_COMMA
|
||||
BOOST_FUNCTION_PARMS)
|
||||
static BOOST_FUNCTION_VOID_RETURN_TYPE
|
||||
invoke(any_pointer BOOST_FUNCTION_COMMA BOOST_FUNCTION_PARMS)
|
||||
|
||||
{
|
||||
FunctionObj f = FunctionObj();
|
||||
f(BOOST_FUNCTION_ARGS);
|
||||
return unusable();
|
||||
BOOST_FUNCTION_RETURN(f(BOOST_FUNCTION_ARGS));
|
||||
}
|
||||
};
|
||||
|
||||
@ -235,8 +241,12 @@ namespace boost {
|
||||
class BOOST_FUNCTION_FUNCTION : public function_base
|
||||
{
|
||||
public:
|
||||
#ifndef BOOST_NO_VOID_RETURNS
|
||||
typedef R result_type;
|
||||
#else
|
||||
typedef typename detail::function::function_return_type<R>::type
|
||||
internal_result_type;
|
||||
result_type;
|
||||
#endif // BOOST_NO_VOID_RETURNS
|
||||
|
||||
private:
|
||||
struct clear_type {};
|
||||
@ -248,7 +258,7 @@ namespace boost {
|
||||
template<typename Args>
|
||||
struct sig
|
||||
{
|
||||
typedef internal_result_type type;
|
||||
typedef result_type type;
|
||||
};
|
||||
|
||||
#if BOOST_FUNCTION_NUM_ARGS == 1
|
||||
@ -261,11 +271,6 @@ namespace boost {
|
||||
BOOST_STATIC_CONSTANT(int, arity = BOOST_FUNCTION_NUM_ARGS);
|
||||
BOOST_FUNCTION_ARG_TYPES
|
||||
|
||||
#ifndef BOOST_NO_VOID_RETURNS
|
||||
typedef R result_type;
|
||||
#else
|
||||
typedef internal_result_type result_type;
|
||||
#endif // BOOST_NO_VOID_RETURNS
|
||||
typedef Allocator allocator_type;
|
||||
typedef BOOST_FUNCTION_FUNCTION self_type;
|
||||
|
||||
@ -315,15 +320,7 @@ namespace boost {
|
||||
if (this->empty())
|
||||
boost::throw_exception(bad_function_call());
|
||||
|
||||
internal_result_type result = invoker(this->functor
|
||||
BOOST_FUNCTION_COMMA
|
||||
BOOST_FUNCTION_ARGS);
|
||||
|
||||
#ifndef BOOST_NO_VOID_RETURNS
|
||||
return static_cast<result_type>(result);
|
||||
#else
|
||||
return result;
|
||||
#endif // BOOST_NO_VOID_RETURNS
|
||||
return invoker(this->functor BOOST_FUNCTION_COMMA BOOST_FUNCTION_ARGS);
|
||||
}
|
||||
#else
|
||||
result_type operator()(BOOST_FUNCTION_PARMS) const;
|
||||
@ -470,7 +467,7 @@ namespace boost {
|
||||
template<typename FunctionObj>
|
||||
void assign_to(FunctionObj f, detail::function::function_obj_tag)
|
||||
{
|
||||
if (!detail::function::has_empty_target(addressof(f))) {
|
||||
if (!detail::function::has_empty_target(boost::addressof(f))) {
|
||||
typedef
|
||||
typename detail::function::BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER<
|
||||
FunctionObj,
|
||||
@ -539,7 +536,7 @@ namespace boost {
|
||||
this->functor = detail::function::make_any_pointer(this);
|
||||
}
|
||||
|
||||
typedef internal_result_type (*invoker_type)(detail::function::any_pointer
|
||||
typedef result_type (*invoker_type)(detail::function::any_pointer
|
||||
BOOST_FUNCTION_COMMA
|
||||
BOOST_FUNCTION_TEMPLATE_ARGS);
|
||||
|
||||
@ -576,15 +573,7 @@ namespace boost {
|
||||
if (this->empty())
|
||||
boost::throw_exception(bad_function_call());
|
||||
|
||||
internal_result_type result = invoker(this->functor
|
||||
BOOST_FUNCTION_COMMA
|
||||
BOOST_FUNCTION_ARGS);
|
||||
|
||||
# ifndef BOOST_NO_VOID_RETURNS
|
||||
return static_cast<result_type>(result);
|
||||
# else
|
||||
return result;
|
||||
# endif // BOOST_NO_VOID_RETURNS
|
||||
return invoker(this->functor BOOST_FUNCTION_COMMA BOOST_FUNCTION_ARGS);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -719,3 +708,5 @@ public:
|
||||
#undef BOOST_FUNCTION_ARGS
|
||||
#undef BOOST_FUNCTION_ARG_TYPE
|
||||
#undef BOOST_FUNCTION_ARG_TYPES
|
||||
#undef BOOST_FUNCTION_VOID_RETURN_TYPE
|
||||
#undef BOOST_FUNCTION_RETURN
|
||||
|
@ -1,6 +1,9 @@
|
||||
// Copyright Douglas Gregor 2004. Use, modification and
|
||||
// distribution is subject to the Boost Software License, Version
|
||||
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// Copyright Douglas Gregor 2004.
|
||||
// Copyright 2005 Peter Dimov
|
||||
|
||||
// Use, modification and distribution is 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)
|
||||
|
||||
// For more information, see http://www.boost.org
|
||||
@ -9,15 +12,16 @@
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace detail {
|
||||
template<typename F, typename G>
|
||||
template<typename F, typename G>
|
||||
bool function_equal_impl(const F& f, const G& g, long)
|
||||
{ return f == g; }
|
||||
} // end namespace boost::function
|
||||
|
||||
// function_equal_impl needs to be unqualified to pick
|
||||
// user overloads on two-phase compilers
|
||||
|
||||
template<typename F, typename G>
|
||||
bool function_equal(const F& f, const G& g)
|
||||
{ return ::boost::detail::function_equal_impl(f, g, 0); }
|
||||
{ return function_equal_impl(f, g, 0); }
|
||||
|
||||
} // end namespace boost
|
||||
|
||||
|
35
boost/boost/implicit_cast.hpp
Normal file
35
boost/boost/implicit_cast.hpp
Normal file
@ -0,0 +1,35 @@
|
||||
// Copyright David Abrahams 2003.
|
||||
// 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 IMPLICIT_CAST_DWA200356_HPP
|
||||
# define IMPLICIT_CAST_DWA200356_HPP
|
||||
|
||||
# include <boost/mpl/identity.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
// implementation originally suggested by C. Green in
|
||||
// http://lists.boost.org/MailArchives/boost/msg00886.php
|
||||
|
||||
// The use of identity creates a non-deduced form, so that the
|
||||
// explicit template argument must be supplied
|
||||
template <typename T>
|
||||
inline T implicit_cast (typename mpl::identity<T>::type x) {
|
||||
return x;
|
||||
}
|
||||
|
||||
// incomplete return type now is here
|
||||
//template <typename T>
|
||||
//void implicit_cast (...);
|
||||
|
||||
// Macro for when you need a constant expression (Gennaro Prota)
|
||||
#define BOOST_IMPLICIT_CAST(dst_type, expr) \
|
||||
( sizeof( implicit_cast<dst_type>(expr) ) \
|
||||
, \
|
||||
static_cast<dst_type>(expr) \
|
||||
)
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // IMPLICIT_CAST_DWA200356_HPP
|
@ -1,11 +1,15 @@
|
||||
// Copyright David Abrahams 2004. Use, modification and distribution is
|
||||
// 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)
|
||||
#ifndef INDIRECT_REFERENCE_DWA200415_HPP
|
||||
# define INDIRECT_REFERENCE_DWA200415_HPP
|
||||
|
||||
// dereferenceable_traits provides access to the value_type and
|
||||
// reference of a Dereferenceable type.
|
||||
//
|
||||
// Copyright David Abrahams 2004. Use, modification and distribution is
|
||||
// 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)
|
||||
//
|
||||
// typename indirect_reference<P>::type provides the type of *p.
|
||||
//
|
||||
// http://www.boost.org/libs/iterator/doc/pointee.html
|
||||
//
|
||||
|
||||
# include <boost/detail/is_incrementable.hpp>
|
||||
# include <boost/iterator/iterator_traits.hpp>
|
||||
|
@ -5,7 +5,7 @@
|
||||
* accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
*
|
||||
* $Id: integer_traits.hpp,v 1.25 2004/09/04 10:34:47 johnmaddock Exp $
|
||||
* $Id: integer_traits.hpp,v 1.27.2.1 2005/08/24 15:45:17 johnmaddock Exp $
|
||||
*
|
||||
* Idea by Beman Dawes, Ed Brey, Steve Cleary, and Nathan Myers
|
||||
*/
|
||||
@ -21,7 +21,9 @@
|
||||
|
||||
// These are an implementation detail and not part of the interface
|
||||
#include <limits.h>
|
||||
#if !defined(BOOST_NO_INTRINSIC_WCHAR_T) && !defined(BOOST_NO_CWCHAR)
|
||||
// we need wchar.h for WCHAR_MAX/MIN but not all platforms provide it,
|
||||
// and some may have <wchar.h> but not <cwchar> ...
|
||||
#if !defined(BOOST_NO_INTRINSIC_WCHAR_T) && (!defined(BOOST_NO_CWCHAR) || defined(sun) || defined(__sun))
|
||||
#include <wchar.h>
|
||||
#endif
|
||||
|
||||
@ -86,7 +88,9 @@ class integer_traits<unsigned char>
|
||||
template<>
|
||||
class integer_traits<wchar_t>
|
||||
: public std::numeric_limits<wchar_t>,
|
||||
#if defined(WCHAR_MIN) && defined(WCHAR_MAX)
|
||||
// Don't trust WCHAR_MIN and WCHAR_MAX with Mac OS X's native
|
||||
// library: they are wrong!
|
||||
#if defined(WCHAR_MIN) && defined(WCHAR_MAX) && !defined(__APPLE__)
|
||||
public detail::integer_traits_base<wchar_t, WCHAR_MIN, WCHAR_MAX>
|
||||
#elif defined(__BORLANDC__) || defined(__CYGWIN__) || defined(__MINGW32__) || (defined(__BEOS__) && defined(__GNUC__))
|
||||
// No WCHAR_MIN and WCHAR_MAX, whar_t is short and unsigned:
|
||||
|
@ -22,7 +22,11 @@
|
||||
# define BOOST_ITERATOR_CONFIG_DEF
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
|
||||
// We enable this always now. Otherwise, the simple case in
|
||||
// libs/iterator/test/constant_iterator_arrow.cpp fails to compile
|
||||
// because the operator-> return is improperly deduced as a non-const
|
||||
// pointer.
|
||||
#if 1 || defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
|
||||
|| BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x531))
|
||||
|
||||
// Recall that in general, compilers without partial specialization
|
||||
@ -36,7 +40,7 @@
|
||||
// end up using a proxy for operator[] when we otherwise shouldn't.
|
||||
// Using reference constness gives it an extra hint that it can
|
||||
// return the value_type from operator[] directly, but is not
|
||||
// strictly neccessary. Not sure how best to resolve this one.
|
||||
// strictly necessary. Not sure how best to resolve this one.
|
||||
|
||||
# define BOOST_ITERATOR_REF_CONSTNESS_KILLS_WRITABILITY 1
|
||||
|
||||
@ -44,7 +48,8 @@
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) \
|
||||
|| BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x531)) \
|
||||
|| (BOOST_WORKAROUND(BOOST_INTEL_CXX_VERSION, <= 700) && defined(_MSC_VER))
|
||||
|| (BOOST_WORKAROUND(BOOST_INTEL_CXX_VERSION, <= 700) && defined(_MSC_VER)) \
|
||||
|| BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590042))
|
||||
# define BOOST_NO_LVALUE_RETURN_DETECTION
|
||||
|
||||
# if 0 // test code
|
||||
|
@ -31,9 +31,9 @@ namespace boost
|
||||
, typename mpl::if_<
|
||||
is_convertible<
|
||||
typename iterator_traversal<Iterator>::type
|
||||
, bidirectional_traversal_tag
|
||||
, random_access_traversal_tag
|
||||
>
|
||||
, forward_traversal_tag
|
||||
, bidirectional_traversal_tag
|
||||
, use_default
|
||||
>::type
|
||||
> type;
|
||||
|
@ -278,6 +278,8 @@ namespace boost
|
||||
{
|
||||
}
|
||||
|
||||
typedef Base base_type;
|
||||
|
||||
Base const& base() const
|
||||
{ return m_iterator; }
|
||||
|
||||
|
@ -7,8 +7,6 @@
|
||||
#ifndef BOOST_ITERATOR_FACADE_23022003THW_HPP
|
||||
#define BOOST_ITERATOR_FACADE_23022003THW_HPP
|
||||
|
||||
#include <boost/static_assert.hpp>
|
||||
|
||||
#include <boost/iterator.hpp>
|
||||
#include <boost/iterator/interoperable.hpp>
|
||||
#include <boost/iterator/iterator_traits.hpp>
|
||||
@ -16,6 +14,9 @@
|
||||
#include <boost/iterator/detail/facade_iterator_category.hpp>
|
||||
#include <boost/iterator/detail/enable_if.hpp>
|
||||
|
||||
#include <boost/implicit_cast.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#include <boost/type_traits/add_const.hpp>
|
||||
#include <boost/type_traits/add_pointer.hpp>
|
||||
@ -106,7 +107,7 @@ namespace boost
|
||||
|
||||
typedef typename mpl::eval_if<
|
||||
detail::iterator_writability_disabled<ValueParam,Reference>
|
||||
, add_pointer<typename add_const<value_type>::type>
|
||||
, add_pointer<const value_type>
|
||||
, add_pointer<value_type>
|
||||
>::type pointer;
|
||||
|
||||
@ -270,7 +271,7 @@ namespace boost
|
||||
: mpl::eval_if<
|
||||
mpl::and_<
|
||||
// A proxy is only needed for readable iterators
|
||||
is_convertible<Reference,Value>
|
||||
is_convertible<Reference,Value const&>
|
||||
|
||||
// No multipass iterator can have values that disappear
|
||||
// before positions can be re-visited
|
||||
@ -322,7 +323,7 @@ namespace boost
|
||||
|
||||
static type make(Reference x)
|
||||
{
|
||||
return type(&x);
|
||||
return implicit_cast<type>(&x);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -12,8 +12,9 @@
|
||||
// with additional fixes and suggestions from Gennaro Prota,
|
||||
// Beman Dawes, Dave Abrahams, Daryle Walker, Peter Dimov,
|
||||
// and other Boosters
|
||||
// when: November 2000, March 2003
|
||||
// when: November 2000, March 2003, June 2005
|
||||
|
||||
#include <cstddef>
|
||||
#include <string>
|
||||
#include <typeinfo>
|
||||
#include <boost/config.hpp>
|
||||
@ -29,8 +30,7 @@
|
||||
|
||||
#if defined(BOOST_NO_STRINGSTREAM) || \
|
||||
defined(BOOST_NO_STD_WSTRING) || \
|
||||
defined(BOOST_NO_STD_LOCALE) || \
|
||||
defined(BOOST_NO_INTRINSIC_WCHAR_T)
|
||||
defined(BOOST_NO_STD_LOCALE)
|
||||
#define DISABLE_WIDE_CHAR_SUPPORT
|
||||
#endif
|
||||
|
||||
@ -45,9 +45,9 @@ namespace boost
|
||||
{
|
||||
}
|
||||
bad_lexical_cast(
|
||||
const std::type_info &s,
|
||||
const std::type_info &t) :
|
||||
source(&s), target(&t)
|
||||
const std::type_info &source_type,
|
||||
const std::type_info &target_type) :
|
||||
source(&source_type), target(&target_type)
|
||||
{
|
||||
}
|
||||
const std::type_info &source_type() const
|
||||
@ -80,11 +80,13 @@ namespace boost
|
||||
};
|
||||
|
||||
#ifndef DISABLE_WIDE_CHAR_SUPPORT
|
||||
#if !defined(BOOST_NO_INTRINSIC_WCHAR_T)
|
||||
template<>
|
||||
struct stream_char<wchar_t>
|
||||
{
|
||||
typedef wchar_t type;
|
||||
};
|
||||
#endif
|
||||
|
||||
template<>
|
||||
struct stream_char<wchar_t *>
|
||||
@ -123,6 +125,11 @@ namespace boost
|
||||
template<typename Target, typename Source>
|
||||
class lexical_stream
|
||||
{
|
||||
private:
|
||||
typedef typename widest_char<
|
||||
typename stream_char<Target>::type,
|
||||
typename stream_char<Source>::type>::type char_type;
|
||||
|
||||
public:
|
||||
lexical_stream()
|
||||
{
|
||||
@ -148,7 +155,16 @@ namespace boost
|
||||
{
|
||||
return !is_pointer<InputStreamable>::value &&
|
||||
stream >> output &&
|
||||
(stream >> std::ws).eof();
|
||||
stream.get() ==
|
||||
#if defined(__GNUC__) && (__GNUC__<3) && defined(BOOST_NO_STD_WSTRING)
|
||||
// GCC 2.9x lacks std::char_traits<>::eof().
|
||||
// We use BOOST_NO_STD_WSTRING to filter out STLport and libstdc++-v3
|
||||
// configurations, which do provide std::char_traits<>::eof().
|
||||
|
||||
EOF;
|
||||
#else
|
||||
std::char_traits<char_type>::eof();
|
||||
#endif
|
||||
}
|
||||
bool operator>>(std::string &output)
|
||||
{
|
||||
@ -166,10 +182,6 @@ namespace boost
|
||||
}
|
||||
#endif
|
||||
private:
|
||||
typedef typename widest_char<
|
||||
typename stream_char<Target>::type,
|
||||
typename stream_char<Source>::type>::type char_type;
|
||||
|
||||
#if defined(BOOST_NO_STRINGSTREAM)
|
||||
std::strstream stream;
|
||||
#elif defined(BOOST_NO_STD_LOCALE)
|
||||
@ -180,6 +192,42 @@ namespace boost
|
||||
};
|
||||
}
|
||||
|
||||
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
|
||||
// call-by-const reference version
|
||||
|
||||
namespace detail
|
||||
{
|
||||
template<class T>
|
||||
struct array_to_pointer_decay
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
template<class T, std::size_t N>
|
||||
struct array_to_pointer_decay<T[N]>
|
||||
{
|
||||
typedef const T * type;
|
||||
};
|
||||
}
|
||||
|
||||
template<typename Target, typename Source>
|
||||
Target lexical_cast(const Source &arg)
|
||||
{
|
||||
typedef typename detail::array_to_pointer_decay<Source>::type NewSource;
|
||||
|
||||
detail::lexical_stream<Target, NewSource> interpreter;
|
||||
Target result;
|
||||
|
||||
if(!(interpreter << arg && interpreter >> result))
|
||||
throw_exception(bad_lexical_cast(typeid(NewSource), typeid(Target)));
|
||||
return result;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
// call-by-value fallback version (deprecated)
|
||||
|
||||
template<typename Target, typename Source>
|
||||
Target lexical_cast(Source arg)
|
||||
{
|
||||
@ -187,12 +235,14 @@ namespace boost
|
||||
Target result;
|
||||
|
||||
if(!(interpreter << arg && interpreter >> result))
|
||||
throw_exception(bad_lexical_cast(typeid(Target), typeid(Source)));
|
||||
throw_exception(bad_lexical_cast(typeid(Source), typeid(Target)));
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
// Copyright Kevlin Henney, 2000-2003. All rights reserved.
|
||||
// Copyright Kevlin Henney, 2000-2005. All rights reserved.
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
@ -200,4 +250,3 @@ namespace boost
|
||||
|
||||
#undef DISABLE_WIDE_CHAR_SUPPORT
|
||||
#endif
|
||||
|
||||
|
@ -12,6 +12,7 @@
|
||||
//
|
||||
// Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.
|
||||
// Copyright (c) 2001 David Abrahams
|
||||
// Copyright (c) 2003-2005 Peter Dimov
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
@ -48,6 +49,18 @@ template<class V> struct mf
|
||||
#undef BOOST_MEM_FN_CC
|
||||
#undef BOOST_MEM_FN_NAME
|
||||
|
||||
#ifdef BOOST_MEM_FN_ENABLE_CDECL
|
||||
|
||||
#define BOOST_MEM_FN_NAME(X) inner_##X##_cdecl
|
||||
#define BOOST_MEM_FN_CC __cdecl
|
||||
|
||||
#include <boost/bind/mem_fn_template.hpp>
|
||||
|
||||
#undef BOOST_MEM_FN_CC
|
||||
#undef BOOST_MEM_FN_NAME
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_MEM_FN_ENABLE_STDCALL
|
||||
|
||||
#define BOOST_MEM_FN_NAME(X) inner_##X##_stdcall
|
||||
@ -89,6 +102,18 @@ template<> struct mf<void>
|
||||
#undef BOOST_MEM_FN_CC
|
||||
#undef BOOST_MEM_FN_NAME
|
||||
|
||||
#ifdef BOOST_MEM_FN_ENABLE_CDECL
|
||||
|
||||
#define BOOST_MEM_FN_NAME(X) inner_##X##_cdecl
|
||||
#define BOOST_MEM_FN_CC __cdecl
|
||||
|
||||
#include <boost/bind/mem_fn_template.hpp>
|
||||
|
||||
#undef BOOST_MEM_FN_CC
|
||||
#undef BOOST_MEM_FN_NAME
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_MEM_FN_ENABLE_STDCALL
|
||||
|
||||
#define BOOST_MEM_FN_NAME(X) inner_##X##_stdcall
|
||||
@ -130,6 +155,20 @@ template<> struct mf<void>
|
||||
#undef BOOST_MEM_FN_NAME2
|
||||
#undef BOOST_MEM_FN_CC
|
||||
|
||||
#ifdef BOOST_MEM_FN_ENABLE_CDECL
|
||||
|
||||
#define BOOST_MEM_FN_NAME(X) X##_cdecl
|
||||
#define BOOST_MEM_FN_NAME2(X) inner_##X##_cdecl
|
||||
#define BOOST_MEM_FN_CC __cdecl
|
||||
|
||||
#include <boost/bind/mem_fn_vw.hpp>
|
||||
|
||||
#undef BOOST_MEM_FN_NAME
|
||||
#undef BOOST_MEM_FN_NAME2
|
||||
#undef BOOST_MEM_FN_CC
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_MEM_FN_ENABLE_STDCALL
|
||||
|
||||
#define BOOST_MEM_FN_NAME(X) X##_stdcall
|
||||
@ -178,6 +217,18 @@ namespace _mfi
|
||||
#undef BOOST_MEM_FN_CC
|
||||
#undef BOOST_MEM_FN_NAME
|
||||
|
||||
#ifdef BOOST_MEM_FN_ENABLE_CDECL
|
||||
|
||||
#define BOOST_MEM_FN_NAME(X) X##_cdecl
|
||||
#define BOOST_MEM_FN_CC __cdecl
|
||||
|
||||
#include <boost/bind/mem_fn_template.hpp>
|
||||
|
||||
#undef BOOST_MEM_FN_CC
|
||||
#undef BOOST_MEM_FN_NAME
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_MEM_FN_ENABLE_STDCALL
|
||||
|
||||
#define BOOST_MEM_FN_NAME(X) X##_stdcall
|
||||
@ -219,6 +270,18 @@ namespace _mfi
|
||||
#undef BOOST_MEM_FN_NAME
|
||||
#undef BOOST_MEM_FN_CC
|
||||
|
||||
#ifdef BOOST_MEM_FN_ENABLE_CDECL
|
||||
|
||||
#define BOOST_MEM_FN_NAME(X) X##_cdecl
|
||||
#define BOOST_MEM_FN_CC __cdecl
|
||||
|
||||
#include <boost/bind/mem_fn_cc.hpp>
|
||||
|
||||
#undef BOOST_MEM_FN_NAME
|
||||
#undef BOOST_MEM_FN_CC
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_MEM_FN_ENABLE_STDCALL
|
||||
|
||||
#define BOOST_MEM_FN_NAME(X) X##_stdcall
|
||||
@ -294,7 +357,7 @@ public:
|
||||
return call(u, &u);
|
||||
}
|
||||
|
||||
#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) && !BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003))
|
||||
#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) && !BOOST_WORKAROUND(__MWERKS__, < 0x3200)
|
||||
|
||||
R & operator()(T & t) const
|
||||
{
|
||||
|
@ -11,8 +11,8 @@
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
// $Source: /cvsroot/boost/boost/boost/mpl/aux_/arity_spec.hpp,v $
|
||||
// $Date: 2004/10/30 06:10:35 $
|
||||
// $Revision: 1.5.2.2 $
|
||||
// $Date: 2004/11/28 02:04:02 $
|
||||
// $Revision: 1.7 $
|
||||
|
||||
#include <boost/mpl/int.hpp>
|
||||
#include <boost/mpl/limits/arity.hpp>
|
||||
|
@ -11,8 +11,8 @@
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
// $Source: /cvsroot/boost/boost/boost/mpl/aux_/lambda_support.hpp,v $
|
||||
// $Date: 2004/10/30 08:21:50 $
|
||||
// $Revision: 1.11.2.1 $
|
||||
// $Date: 2004/11/28 01:37:05 $
|
||||
// $Revision: 1.12 $
|
||||
|
||||
#include <boost/mpl/aux_/config/lambda.hpp>
|
||||
|
||||
|
@ -11,8 +11,8 @@
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
// $Source: /cvsroot/boost/boost/boost/mpl/aux_/msvc_eti_base.hpp,v $
|
||||
// $Date: 2004/11/10 23:38:09 $
|
||||
// $Revision: 1.6.2.1 $
|
||||
// $Date: 2004/11/28 01:37:05 $
|
||||
// $Revision: 1.7 $
|
||||
|
||||
#include <boost/mpl/aux_/is_msvc_eti_arg.hpp>
|
||||
#include <boost/mpl/aux_/config/eti.hpp>
|
||||
|
@ -11,8 +11,8 @@
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
// $Source: /cvsroot/boost/boost/boost/mpl/aux_/na.hpp,v $
|
||||
// $Date: 2004/10/30 08:21:50 $
|
||||
// $Revision: 1.5.2.1 $
|
||||
// $Date: 2004/11/28 01:37:30 $
|
||||
// $Revision: 1.6 $
|
||||
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/aux_/na_fwd.hpp>
|
||||
|
@ -11,14 +11,15 @@
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
// $Source: /cvsroot/boost/boost/boost/mpl/aux_/na_assert.hpp,v $
|
||||
// $Date: 2004/09/28 13:56:59 $
|
||||
// $Revision: 1.2 $
|
||||
// $Date: 2005/07/13 13:13:38 $
|
||||
// $Revision: 1.6 $
|
||||
|
||||
#include <boost/mpl/aux_/na.hpp>
|
||||
#include <boost/mpl/aux_/config/msvc.hpp>
|
||||
#include <boost/mpl/aux_/config/workaround.hpp>
|
||||
|
||||
#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
#if !BOOST_WORKAROUND(_MSC_FULL_VER, <= 140050601) \
|
||||
&& !BOOST_WORKAROUND(__EDG_VERSION__, <= 243)
|
||||
# include <boost/mpl/assert.hpp>
|
||||
# define BOOST_MPL_AUX_ASSERT_NOT_NA(x) \
|
||||
BOOST_MPL_ASSERT_NOT((boost::mpl::is_na<type>)) \
|
||||
|
@ -10,9 +10,9 @@
|
||||
//
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
// $Source: /cvsroot/boost/boost/boost/mpl/aux_/Attic/na_fwd.hpp,v $
|
||||
// $Date: 2004/10/30 08:22:23 $
|
||||
// $Revision: 1.1.2.1 $
|
||||
// $Source: /cvsroot/boost/boost/boost/mpl/aux_/na_fwd.hpp,v $
|
||||
// $Date: 2004/11/28 01:37:30 $
|
||||
// $Revision: 1.2 $
|
||||
|
||||
#include <boost/mpl/aux_/adl_barrier.hpp>
|
||||
|
||||
|
@ -11,8 +11,8 @@
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
// $Source: /cvsroot/boost/boost/boost/mpl/aux_/na_spec.hpp,v $
|
||||
// $Date: 2004/11/08 18:23:49 $
|
||||
// $Revision: 1.2.2.1 $
|
||||
// $Date: 2004/11/28 01:38:15 $
|
||||
// $Revision: 1.3 $
|
||||
|
||||
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
|
||||
# include <boost/mpl/lambda_fwd.hpp>
|
||||
|
@ -11,14 +11,16 @@
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
// $Source: /cvsroot/boost/boost/boost/mpl/aux_/nttp_decl.hpp,v $
|
||||
// $Date: 2004/09/02 15:40:44 $
|
||||
// $Revision: 1.1 $
|
||||
// $Date: 2004/12/16 22:43:05 $
|
||||
// $Revision: 1.2 $
|
||||
|
||||
#include <boost/mpl/aux_/config/nttp.hpp>
|
||||
|
||||
#if defined(BOOST_MPL_CFG_NTTP_BUG)
|
||||
|
||||
typedef bool _mpl_nttp_bool;
|
||||
typedef int _mpl_nttp_int;
|
||||
typedef unsigned _mpl_nttp_unsigned;
|
||||
typedef long _mpl_nttp_long;
|
||||
|
||||
# include <boost/preprocessor/cat.hpp>
|
||||
|
@ -6,7 +6,7 @@
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
// Preprocessed version of "boost/mpl/Attic/deque.hpp" header
|
||||
// Preprocessed version of "boost/mpl/deque.hpp" header
|
||||
// -- DO NOT modify by hand!
|
||||
|
||||
namespace boost { namespace mpl {
|
||||
|
@ -65,6 +65,7 @@ template<
|
||||
, typename BOOST_MPL_AUX_NA_PARAM(N2)
|
||||
>
|
||||
struct equal_to
|
||||
|
||||
: equal_to_impl<
|
||||
typename equal_to_tag<N1>::type
|
||||
, typename equal_to_tag<N2>::type
|
||||
|
@ -65,6 +65,7 @@ template<
|
||||
, typename BOOST_MPL_AUX_NA_PARAM(N2)
|
||||
>
|
||||
struct greater
|
||||
|
||||
: greater_impl<
|
||||
typename greater_tag<N1>::type
|
||||
, typename greater_tag<N2>::type
|
||||
|
@ -65,6 +65,7 @@ template<
|
||||
, typename BOOST_MPL_AUX_NA_PARAM(N2)
|
||||
>
|
||||
struct greater_equal
|
||||
|
||||
: greater_equal_impl<
|
||||
typename greater_equal_tag<N1>::type
|
||||
, typename greater_equal_tag<N2>::type
|
||||
|
@ -65,6 +65,7 @@ template<
|
||||
, typename BOOST_MPL_AUX_NA_PARAM(N2)
|
||||
>
|
||||
struct less
|
||||
|
||||
: less_impl<
|
||||
typename less_tag<N1>::type
|
||||
, typename less_tag<N2>::type
|
||||
|
@ -65,6 +65,7 @@ template<
|
||||
, typename BOOST_MPL_AUX_NA_PARAM(N2)
|
||||
>
|
||||
struct less_equal
|
||||
|
||||
: less_equal_impl<
|
||||
typename less_equal_tag<N1>::type
|
||||
, typename less_equal_tag<N2>::type
|
||||
|
@ -65,6 +65,7 @@ template<
|
||||
, typename BOOST_MPL_AUX_NA_PARAM(N2)
|
||||
>
|
||||
struct modulus
|
||||
|
||||
: modulus_impl<
|
||||
typename modulus_tag<N1>::type
|
||||
, typename modulus_tag<N2>::type
|
||||
|
@ -65,6 +65,7 @@ template<
|
||||
, typename BOOST_MPL_AUX_NA_PARAM(N2)
|
||||
>
|
||||
struct not_equal_to
|
||||
|
||||
: not_equal_to_impl<
|
||||
typename not_equal_to_tag<N1>::type
|
||||
, typename not_equal_to_tag<N2>::type
|
||||
|
@ -6,7 +6,7 @@
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
// Preprocessed version of "boost/mpl/Attic/set_c.hpp" header
|
||||
// Preprocessed version of "boost/mpl/set_c.hpp" header
|
||||
// -- DO NOT modify by hand!
|
||||
|
||||
namespace boost { namespace mpl {
|
||||
|
@ -66,6 +66,7 @@ template<
|
||||
, typename BOOST_MPL_AUX_NA_PARAM(N2)
|
||||
>
|
||||
struct shift_left
|
||||
|
||||
: shift_left_impl<
|
||||
typename shift_left_tag<N1>::type
|
||||
, typename shift_left_tag<N2>::type
|
||||
|
@ -66,6 +66,7 @@ template<
|
||||
, typename BOOST_MPL_AUX_NA_PARAM(N2)
|
||||
>
|
||||
struct shift_right
|
||||
|
||||
: shift_right_impl<
|
||||
typename shift_right_tag<N1>::type
|
||||
, typename shift_right_tag<N2>::type
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user