diff options
author | Remko Tronçon <git@el-tramo.be> | 2009-06-01 08:48:42 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2009-06-01 09:24:28 (GMT) |
commit | 2812bddd81f8a1b804c7460f4e14cd0aa393d129 (patch) | |
tree | d46294f35150c4f0f43deaf2d31fceaf945ae715 /3rdParty/Boost/boost/detail | |
download | swift-2812bddd81f8a1b804c7460f4e14cd0aa393d129.zip swift-2812bddd81f8a1b804c7460f4e14cd0aa393d129.tar.bz2 |
Import.
Diffstat (limited to '3rdParty/Boost/boost/detail')
-rw-r--r-- | 3rdParty/Boost/boost/detail/atomic_count.hpp | 21 | ||||
-rw-r--r-- | 3rdParty/Boost/boost/detail/call_traits.hpp | 164 | ||||
-rw-r--r-- | 3rdParty/Boost/boost/detail/container_fwd.hpp | 99 | ||||
-rw-r--r-- | 3rdParty/Boost/boost/detail/endian.hpp | 73 | ||||
-rw-r--r-- | 3rdParty/Boost/boost/detail/indirect_traits.hpp | 487 | ||||
-rw-r--r-- | 3rdParty/Boost/boost/detail/interlocked.hpp | 130 | ||||
-rw-r--r-- | 3rdParty/Boost/boost/detail/is_function_ref_tester.hpp | 135 | ||||
-rw-r--r-- | 3rdParty/Boost/boost/detail/iterator.hpp | 494 | ||||
-rw-r--r-- | 3rdParty/Boost/boost/detail/lcast_precision.hpp | 184 | ||||
-rw-r--r-- | 3rdParty/Boost/boost/detail/lightweight_mutex.hpp | 22 | ||||
-rw-r--r-- | 3rdParty/Boost/boost/detail/limits.hpp | 449 | ||||
-rw-r--r-- | 3rdParty/Boost/boost/detail/ob_call_traits.hpp | 168 | ||||
-rw-r--r-- | 3rdParty/Boost/boost/detail/reference_content.hpp | 141 | ||||
-rw-r--r-- | 3rdParty/Boost/boost/detail/sp_typeinfo.hpp | 83 | ||||
-rw-r--r-- | 3rdParty/Boost/boost/detail/utf8_codecvt_facet.hpp | 197 | ||||
-rw-r--r-- | 3rdParty/Boost/boost/detail/workaround.hpp | 262 |
16 files changed, 3109 insertions, 0 deletions
diff --git a/3rdParty/Boost/boost/detail/atomic_count.hpp b/3rdParty/Boost/boost/detail/atomic_count.hpp new file mode 100644 index 0000000..5411c7a --- /dev/null +++ b/3rdParty/Boost/boost/detail/atomic_count.hpp @@ -0,0 +1,21 @@ +#ifndef BOOST_DETAIL_ATOMIC_COUNT_HPP_INCLUDED +#define BOOST_DETAIL_ATOMIC_COUNT_HPP_INCLUDED + +// MS compatible compilers support #pragma once + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +// +// boost/detail/atomic_count.hpp - thread/SMP safe reference counter +// +// 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 + +#include <boost/smart_ptr/detail/atomic_count.hpp> + +#endif // #ifndef BOOST_DETAIL_ATOMIC_COUNT_HPP_INCLUDED diff --git a/3rdParty/Boost/boost/detail/call_traits.hpp b/3rdParty/Boost/boost/detail/call_traits.hpp new file mode 100644 index 0000000..6ad646e --- /dev/null +++ b/3rdParty/Boost/boost/detail/call_traits.hpp @@ -0,0 +1,164 @@ +// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). +// +// See http://www.boost.org/libs/utility for most recent version including documentation. + +// call_traits: defines typedefs for function usage +// (see libs/utility/call_traits.htm) + +/* Release notes: + 23rd July 2000: + Fixed array specialization. (JM) + Added Borland specific fixes for reference types + (issue raised by Steve Cleary). +*/ + +#ifndef BOOST_DETAIL_CALL_TRAITS_HPP +#define BOOST_DETAIL_CALL_TRAITS_HPP + +#ifndef BOOST_CONFIG_HPP +#include <boost/config.hpp> +#endif +#include <cstddef> + +#include <boost/type_traits/is_arithmetic.hpp> +#include <boost/type_traits/is_pointer.hpp> +#include <boost/detail/workaround.hpp> + +namespace boost{ + +namespace detail{ + +template <typename T, bool small_> +struct ct_imp2 +{ + typedef const T& param_type; +}; + +template <typename T> +struct ct_imp2<T, true> +{ + typedef const T param_type; +}; + +template <typename T, bool isp, bool b1> +struct ct_imp +{ + typedef const T& param_type; +}; + +template <typename T, bool isp> +struct ct_imp<T, isp, true> +{ + typedef typename ct_imp2<T, sizeof(T) <= sizeof(void*)>::param_type param_type; +}; + +template <typename T, bool b1> +struct ct_imp<T, true, b1> +{ + typedef const T param_type; +}; + +} + +template <typename T> +struct call_traits +{ +public: + typedef T value_type; + typedef T& reference; + typedef const T& const_reference; + // + // C++ Builder workaround: we should be able to define a compile time + // constant and pass that as a single template parameter to ct_imp<T,bool>, + // however compiler bugs prevent this - instead pass three bool's to + // ct_imp<T,bool,bool,bool> and add an extra partial specialisation + // of ct_imp to handle the logic. (JM) + typedef typename boost::detail::ct_imp< + T, + ::boost::is_pointer<T>::value, + ::boost::is_arithmetic<T>::value + >::param_type param_type; +}; + +template <typename T> +struct call_traits<T&> +{ + typedef T& value_type; + typedef T& reference; + typedef const T& const_reference; + typedef T& param_type; // hh removed const +}; + +#if BOOST_WORKAROUND( __BORLANDC__, < 0x5A0 ) +// these are illegal specialisations; cv-qualifies applied to +// references have no effect according to [8.3.2p1], +// C++ Builder requires them though as it treats cv-qualified +// references as distinct types... +template <typename T> +struct call_traits<T&const> +{ + typedef T& value_type; + typedef T& reference; + typedef const T& const_reference; + typedef T& param_type; // hh removed const +}; +template <typename T> +struct call_traits<T&volatile> +{ + typedef T& value_type; + typedef T& reference; + typedef const T& const_reference; + typedef T& param_type; // hh removed const +}; +template <typename T> +struct call_traits<T&const volatile> +{ + typedef T& value_type; + typedef T& reference; + typedef const T& const_reference; + typedef T& param_type; // hh removed const +}; + +template <typename T> +struct call_traits< T * > +{ + typedef T * value_type; + typedef T * & reference; + typedef T * const & const_reference; + typedef T * const param_type; // hh removed const +}; +#endif +#if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS) +template <typename T, std::size_t N> +struct call_traits<T [N]> +{ +private: + typedef T array_type[N]; +public: + // degrades array to pointer: + typedef const T* value_type; + typedef array_type& reference; + typedef const array_type& const_reference; + typedef const T* const param_type; +}; + +template <typename T, std::size_t N> +struct call_traits<const T [N]> +{ +private: + typedef const T array_type[N]; +public: + // degrades array to pointer: + typedef const T* value_type; + typedef array_type& reference; + typedef const array_type& const_reference; + typedef const T* const param_type; +}; +#endif + +} + +#endif // BOOST_DETAIL_CALL_TRAITS_HPP diff --git a/3rdParty/Boost/boost/detail/container_fwd.hpp b/3rdParty/Boost/boost/detail/container_fwd.hpp new file mode 100644 index 0000000..f54dedb --- /dev/null +++ b/3rdParty/Boost/boost/detail/container_fwd.hpp @@ -0,0 +1,99 @@ + +// Copyright 2005-2008 Daniel James. +// 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) + +#if !defined(BOOST_DETAIL_CONTAINER_FWD_HPP) +#define BOOST_DETAIL_CONTAINER_FWD_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +#include <boost/config.hpp> +#include <boost/detail/workaround.hpp> + +#if BOOST_WORKAROUND(__GNUC__, < 3) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) +#define BOOST_HASH_CHAR_TRAITS string_char_traits +#else +#define BOOST_HASH_CHAR_TRAITS char_traits +#endif + +#if ((defined(__GLIBCPP__) || defined(__GLIBCXX__)) && defined(_GLIBCXX_DEBUG)) \ + || BOOST_WORKAROUND(__BORLANDC__, > 0x551) \ + || BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x842)) \ + || (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) + +#include <deque> +#include <list> +#include <vector> +#include <map> +#include <set> +#include <bitset> +#include <string> +#include <complex> + +#else + +#include <cstddef> + +#if !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) && \ + defined(__STL_CONFIG_H) + +#define BOOST_CONTAINER_FWD_BAD_BITSET + +#if !defined(__STL_NON_TYPE_TMPL_PARAM_BUG) +#define BOOST_CONTAINER_FWD_BAD_DEQUE +#endif + +#endif + +#if defined(BOOST_CONTAINER_FWD_BAD_DEQUE) +#include <deque> +#endif + +#if defined(BOOST_CONTAINER_FWD_BAD_BITSET) +#include <bitset> +#endif + +#if defined(BOOST_MSVC) +#pragma warning(push) +#pragma warning(disable:4099) // struct/class mismatch in fwd declarations +#endif + +namespace std +{ + template <class T> class allocator; + template <class charT, class traits, class Allocator> class basic_string; + template <class charT> struct BOOST_HASH_CHAR_TRAITS; + template <class T> class complex; +} + +// gcc 3.4 and greater +namespace std +{ +#if !defined(BOOST_CONTAINER_FWD_BAD_DEQUE) + template <class T, class Allocator> class deque; +#endif + + template <class T, class Allocator> class list; + template <class T, class Allocator> class vector; + template <class Key, class T, class Compare, class Allocator> class map; + template <class Key, class T, class Compare, class Allocator> + class multimap; + template <class Key, class Compare, class Allocator> class set; + template <class Key, class Compare, class Allocator> class multiset; + +#if !defined(BOOST_CONTAINER_FWD_BAD_BITSET) + template <size_t N> class bitset; +#endif + template <class T1, class T2> struct pair; +} + +#if defined(BOOST_MSVC) +#pragma warning(pop) +#endif + +#endif + +#endif diff --git a/3rdParty/Boost/boost/detail/endian.hpp b/3rdParty/Boost/boost/detail/endian.hpp new file mode 100644 index 0000000..803d7e2 --- /dev/null +++ b/3rdParty/Boost/boost/detail/endian.hpp @@ -0,0 +1,73 @@ +// Copyright 2005 Caleb Epstein +// Copyright 2006 John Maddock +// Distributed under the Boost Software License, Version 1.0. (See accompany- +// ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +/* + * Copyright (c) 1997 + * Silicon Graphics Computer Systems, Inc. + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Silicon Graphics makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + */ + +/* + * Copyright notice reproduced from <boost/detail/limits.hpp>, from + * which this code was originally taken. + * + * Modified by Caleb Epstein to use <endian.h> with GNU libc and to + * defined the BOOST_ENDIAN macro. + */ + +#ifndef BOOST_DETAIL_ENDIAN_HPP +#define BOOST_DETAIL_ENDIAN_HPP + +// GNU libc offers the helpful header <endian.h> which defines +// __BYTE_ORDER + +#if defined (__GLIBC__) +# include <endian.h> +# if (__BYTE_ORDER == __LITTLE_ENDIAN) +# define BOOST_LITTLE_ENDIAN +# elif (__BYTE_ORDER == __BIG_ENDIAN) +# define BOOST_BIG_ENDIAN +# elif (__BYTE_ORDER == __PDP_ENDIAN) +# define BOOST_PDP_ENDIAN +# else +# error Unknown machine endianness detected. +# endif +# define BOOST_BYTE_ORDER __BYTE_ORDER +#elif defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN) +# define BOOST_BIG_ENDIAN +# define BOOST_BYTE_ORDER 4321 +#elif defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN) +# define BOOST_LITTLE_ENDIAN +# define BOOST_BYTE_ORDER 1234 +#elif defined(__sparc) || defined(__sparc__) \ + || defined(_POWER) || defined(__powerpc__) \ + || defined(__ppc__) || defined(__hpux) \ + || defined(_MIPSEB) || defined(_POWER) \ + || defined(__s390__) +# define BOOST_BIG_ENDIAN +# define BOOST_BYTE_ORDER 4321 +#elif defined(__i386__) || defined(__alpha__) \ + || defined(__ia64) || defined(__ia64__) \ + || defined(_M_IX86) || defined(_M_IA64) \ + || defined(_M_ALPHA) || defined(__amd64) \ + || defined(__amd64__) || defined(_M_AMD64) \ + || defined(__x86_64) || defined(__x86_64__) \ + || defined(_M_X64) || defined(__bfin__) + +# define BOOST_LITTLE_ENDIAN +# define BOOST_BYTE_ORDER 1234 +#else +# error The file boost/detail/endian.hpp needs to be set up for your CPU type. +#endif + + +#endif diff --git a/3rdParty/Boost/boost/detail/indirect_traits.hpp b/3rdParty/Boost/boost/detail/indirect_traits.hpp new file mode 100644 index 0000000..f9c0cd6 --- /dev/null +++ b/3rdParty/Boost/boost/detail/indirect_traits.hpp @@ -0,0 +1,487 @@ +// Copyright David Abrahams 2002. +// 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 INDIRECT_TRAITS_DWA2002131_HPP +# define INDIRECT_TRAITS_DWA2002131_HPP +# include <boost/type_traits/is_function.hpp> +# include <boost/type_traits/is_reference.hpp> +# include <boost/type_traits/is_pointer.hpp> +# include <boost/type_traits/is_class.hpp> +# 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> + +# 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> +# include <boost/mpl/not.hpp> +# include <boost/mpl/aux_/lambda_support.hpp> + +# ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +# include <boost/detail/is_function_ref_tester.hpp> +# endif + +namespace boost { namespace detail { + +namespace indirect_traits { + +# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +template <class T> +struct is_reference_to_const : mpl::false_ +{ +}; + +template <class T> +struct is_reference_to_const<T const&> : mpl::true_ +{ +}; + +# if defined(BOOST_MSVC) && _MSC_FULL_VER <= 13102140 // vc7.01 alpha workaround +template<class T> +struct is_reference_to_const<T const volatile&> : mpl::true_ +{ +}; +# endif + +template <class T> +struct is_reference_to_function : mpl::false_ +{ +}; + +template <class T> +struct is_reference_to_function<T&> : is_function<T> +{ +}; + +template <class T> +struct is_pointer_to_function : mpl::false_ +{ +}; + +// There's no such thing as a pointer-to-cv-function, so we don't need +// specializations for those +template <class T> +struct is_pointer_to_function<T*> : is_function<T> +{ +}; + +template <class T> +struct is_reference_to_member_function_pointer_impl : mpl::false_ +{ +}; + +template <class T> +struct is_reference_to_member_function_pointer_impl<T&> + : is_member_function_pointer<typename remove_cv<T>::type> +{ +}; + + +template <class T> +struct is_reference_to_member_function_pointer + : is_reference_to_member_function_pointer_impl<T> +{ + BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_member_function_pointer,(T)) +}; + +template <class T> +struct is_reference_to_function_pointer_aux + : mpl::and_< + is_reference<T> + , is_pointer_to_function< + typename remove_cv< + typename remove_reference<T>::type + >::type + > + > +{ + // There's no such thing as a pointer-to-cv-function, so we don't need specializations for those +}; + +template <class T> +struct is_reference_to_function_pointer + : mpl::if_< + is_reference_to_function<T> + , mpl::false_ + , is_reference_to_function_pointer_aux<T> + >::type +{ +}; + +template <class T> +struct is_reference_to_non_const + : mpl::and_< + is_reference<T> + , mpl::not_< + is_reference_to_const<T> + > + > +{ +}; + +template <class T> +struct is_reference_to_volatile : mpl::false_ +{ +}; + +template <class T> +struct is_reference_to_volatile<T volatile&> : mpl::true_ +{ +}; + +# if defined(BOOST_MSVC) && _MSC_FULL_VER <= 13102140 // vc7.01 alpha workaround +template <class T> +struct is_reference_to_volatile<T const volatile&> : mpl::true_ +{ +}; +# endif + + +template <class T> +struct is_reference_to_pointer : mpl::false_ +{ +}; + +template <class T> +struct is_reference_to_pointer<T*&> : mpl::true_ +{ +}; + +template <class T> +struct is_reference_to_pointer<T* const&> : mpl::true_ +{ +}; + +template <class T> +struct is_reference_to_pointer<T* volatile&> : mpl::true_ +{ +}; + +template <class T> +struct is_reference_to_pointer<T* const volatile&> : mpl::true_ +{ +}; + +template <class T> +struct is_reference_to_class + : mpl::and_< + is_reference<T> + , is_class< + typename remove_cv< + typename remove_reference<T>::type + >::type + > + > +{ + BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_class,(T)) +}; + +template <class T> +struct is_pointer_to_class + : mpl::and_< + is_pointer<T> + , is_class< + typename remove_cv< + typename remove_pointer<T>::type + >::type + > + > +{ + BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_pointer_to_class,(T)) +}; + +# else + +using namespace boost::detail::is_function_ref_tester_; + +typedef char (&inner_yes_type)[3]; +typedef char (&inner_no_type)[2]; +typedef char (&outer_no_type)[1]; + +template <typename V> +struct is_const_help +{ + typedef typename mpl::if_< + is_const<V> + , inner_yes_type + , inner_no_type + >::type type; +}; + +template <typename V> +struct is_volatile_help +{ + typedef typename mpl::if_< + is_volatile<V> + , inner_yes_type + , inner_no_type + >::type type; +}; + +template <typename V> +struct is_pointer_help +{ + typedef typename mpl::if_< + is_pointer<V> + , inner_yes_type + , inner_no_type + >::type type; +}; + +template <typename V> +struct is_class_help +{ + typedef typename mpl::if_< + is_class<V> + , inner_yes_type + , inner_no_type + >::type type; +}; + +template <class T> +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> +struct is_reference_to_function + : mpl::if_<is_reference<T>, is_reference_to_function_aux<T>, mpl::bool_<false> >::type +{ +}; + +template <class T> +struct is_pointer_to_function_aux +{ + static T t; + BOOST_STATIC_CONSTANT( + bool, value + = sizeof(::boost::type_traits::is_function_ptr_tester(t)) == sizeof(::boost::type_traits::yes_type)); + typedef mpl::bool_<value> type; +}; + +template <class T> +struct is_pointer_to_function + : mpl::if_<is_pointer<T>, is_pointer_to_function_aux<T>, mpl::bool_<false> >::type +{ + BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_pointer_to_function,(T)) +}; + +struct false_helper1 +{ + template <class T> + struct apply : mpl::false_ + { + }; +}; + +template <typename V> +typename is_const_help<V>::type reference_to_const_helper(V&); +outer_no_type +reference_to_const_helper(...); + +struct true_helper1 +{ + template <class T> + struct apply + { + static T t; + BOOST_STATIC_CONSTANT( + bool, value + = sizeof(reference_to_const_helper(t)) == sizeof(inner_yes_type)); + typedef mpl::bool_<value> type; + }; +}; + +template <bool ref = true> +struct is_reference_to_const_helper1 : true_helper1 +{ +}; + +template <> +struct is_reference_to_const_helper1<false> : false_helper1 +{ +}; + + +template <class T> +struct is_reference_to_const + : is_reference_to_const_helper1<is_reference<T>::value>::template apply<T> +{ +}; + + +template <bool ref = true> +struct is_reference_to_non_const_helper1 +{ + template <class T> + struct apply + { + static T t; + BOOST_STATIC_CONSTANT( + bool, value + = sizeof(reference_to_const_helper(t)) == sizeof(inner_no_type)); + + typedef mpl::bool_<value> type; + }; +}; + +template <> +struct is_reference_to_non_const_helper1<false> : false_helper1 +{ +}; + + +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)) +}; + + +template <typename V> +typename is_volatile_help<V>::type reference_to_volatile_helper(V&); +outer_no_type +reference_to_volatile_helper(...); + +template <bool ref = true> +struct is_reference_to_volatile_helper1 +{ + template <class T> + struct apply + { + static T t; + BOOST_STATIC_CONSTANT( + bool, value + = sizeof(reference_to_volatile_helper(t)) == sizeof(inner_yes_type)); + typedef mpl::bool_<value> type; + }; +}; + +template <> +struct is_reference_to_volatile_helper1<false> : false_helper1 +{ +}; + + +template <class T> +struct is_reference_to_volatile + : is_reference_to_volatile_helper1<is_reference<T>::value>::template apply<T> +{ +}; + +template <typename V> +typename is_pointer_help<V>::type reference_to_pointer_helper(V&); +outer_no_type reference_to_pointer_helper(...); + +template <class T> +struct reference_to_pointer_impl +{ + static T t; + BOOST_STATIC_CONSTANT( + bool, value + = (sizeof((reference_to_pointer_helper)(t)) == sizeof(inner_yes_type)) + ); + + typedef mpl::bool_<value> type; +}; + +template <class T> +struct is_reference_to_pointer + : mpl::eval_if<is_reference<T>, reference_to_pointer_impl<T>, mpl::false_>::type +{ + BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_pointer,(T)) +}; + +template <class T> +struct is_reference_to_function_pointer + : mpl::eval_if<is_reference<T>, is_pointer_to_function_aux<T>, mpl::false_>::type +{ + BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_function_pointer,(T)) +}; + + +template <class T> +struct is_member_function_pointer_help + : mpl::if_<is_member_function_pointer<T>, inner_yes_type, inner_no_type> +{}; + +template <typename V> +typename is_member_function_pointer_help<V>::type member_function_pointer_helper(V&); +outer_no_type member_function_pointer_helper(...); + +template <class T> +struct is_pointer_to_member_function_aux +{ + static T t; + BOOST_STATIC_CONSTANT( + bool, value + = sizeof((member_function_pointer_helper)(t)) == sizeof(inner_yes_type)); + typedef mpl::bool_<value> type; +}; + +template <class T> +struct is_reference_to_member_function_pointer + : mpl::if_< + is_reference<T> + , is_pointer_to_member_function_aux<T> + , mpl::bool_<false> + >::type +{ + BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_member_function_pointer,(T)) +}; + +template <typename V> +typename is_class_help<V>::type reference_to_class_helper(V const volatile&); +outer_no_type reference_to_class_helper(...); + +template <class T> +struct is_reference_to_class +{ + static T t; + BOOST_STATIC_CONSTANT( + bool, value + = (is_reference<T>::value + & (sizeof(reference_to_class_helper(t)) == sizeof(inner_yes_type))) + ); + typedef mpl::bool_<value> type; + BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_class,(T)) +}; + +template <typename V> +typename is_class_help<V>::type pointer_to_class_helper(V const volatile*); +outer_no_type pointer_to_class_helper(...); + +template <class T> +struct is_pointer_to_class +{ + static T t; + BOOST_STATIC_CONSTANT( + bool, value + = (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 + +} + +using namespace indirect_traits; + +}} // namespace boost::python::detail + +#endif // INDIRECT_TRAITS_DWA2002131_HPP diff --git a/3rdParty/Boost/boost/detail/interlocked.hpp b/3rdParty/Boost/boost/detail/interlocked.hpp new file mode 100644 index 0000000..b6c8d75 --- /dev/null +++ b/3rdParty/Boost/boost/detail/interlocked.hpp @@ -0,0 +1,130 @@ +#ifndef BOOST_DETAIL_INTERLOCKED_HPP_INCLUDED +#define BOOST_DETAIL_INTERLOCKED_HPP_INCLUDED + +// MS compatible compilers support #pragma once + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +// +// boost/detail/interlocked.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_USE_WINDOWS_H ) + +# include <windows.h> + +# define BOOST_INTERLOCKED_INCREMENT InterlockedIncrement +# define BOOST_INTERLOCKED_DECREMENT InterlockedDecrement +# define BOOST_INTERLOCKED_COMPARE_EXCHANGE InterlockedCompareExchange +# define BOOST_INTERLOCKED_EXCHANGE InterlockedExchange +# define BOOST_INTERLOCKED_EXCHANGE_ADD InterlockedExchangeAdd +# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER InterlockedCompareExchangePointer +# define BOOST_INTERLOCKED_EXCHANGE_POINTER InterlockedExchangePointer + +#elif defined(_WIN32_WCE) + +// under Windows CE we still have old-style Interlocked* functions + +extern "C" long __cdecl InterlockedIncrement( long* ); +extern "C" long __cdecl InterlockedDecrement( long* ); +extern "C" long __cdecl InterlockedCompareExchange( long*, long, long ); +extern "C" long __cdecl InterlockedExchange( long*, long ); +extern "C" long __cdecl InterlockedExchangeAdd( long*, long ); + +# define BOOST_INTERLOCKED_INCREMENT InterlockedIncrement +# define BOOST_INTERLOCKED_DECREMENT InterlockedDecrement +# define BOOST_INTERLOCKED_COMPARE_EXCHANGE InterlockedCompareExchange +# define BOOST_INTERLOCKED_EXCHANGE InterlockedExchange +# define BOOST_INTERLOCKED_EXCHANGE_ADD InterlockedExchangeAdd + +# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \ + ((void*)BOOST_INTERLOCKED_COMPARE_EXCHANGE((long*)(dest),(long)(exchange),(long)(compare))) +# define BOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \ + ((void*)BOOST_INTERLOCKED_EXCHANGE((long*)(dest),(long)(exchange))) + +#elif defined( BOOST_MSVC ) || defined( BOOST_INTEL_WIN ) + +extern "C" long __cdecl _InterlockedIncrement( long volatile * ); +extern "C" long __cdecl _InterlockedDecrement( long volatile * ); +extern "C" long __cdecl _InterlockedCompareExchange( long volatile *, long, long ); +extern "C" long __cdecl _InterlockedExchange( long volatile *, long); +extern "C" long __cdecl _InterlockedExchangeAdd( long volatile *, long); + +# pragma intrinsic( _InterlockedIncrement ) +# pragma intrinsic( _InterlockedDecrement ) +# pragma intrinsic( _InterlockedCompareExchange ) +# pragma intrinsic( _InterlockedExchange ) +# pragma intrinsic( _InterlockedExchangeAdd ) + +# if defined(_M_IA64) || defined(_M_AMD64) + +extern "C" void* __cdecl _InterlockedCompareExchangePointer( void* volatile *, void*, void* ); +extern "C" void* __cdecl _InterlockedExchangePointer( void* volatile *, void* ); + +# pragma intrinsic( _InterlockedCompareExchangePointer ) +# pragma intrinsic( _InterlockedExchangePointer ) + +# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER _InterlockedCompareExchangePointer +# define BOOST_INTERLOCKED_EXCHANGE_POINTER _InterlockedExchangePointer + +# else + +# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \ + ((void*)BOOST_INTERLOCKED_COMPARE_EXCHANGE((long volatile*)(dest),(long)(exchange),(long)(compare))) +# define BOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \ + ((void*)BOOST_INTERLOCKED_EXCHANGE((long volatile*)(dest),(long)(exchange))) + +# endif + +# define BOOST_INTERLOCKED_INCREMENT _InterlockedIncrement +# define BOOST_INTERLOCKED_DECREMENT _InterlockedDecrement +# define BOOST_INTERLOCKED_COMPARE_EXCHANGE _InterlockedCompareExchange +# define BOOST_INTERLOCKED_EXCHANGE _InterlockedExchange +# define BOOST_INTERLOCKED_EXCHANGE_ADD _InterlockedExchangeAdd + +#elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) || defined( __CYGWIN__ ) + +namespace boost +{ + +namespace detail +{ + +extern "C" __declspec(dllimport) long __stdcall InterlockedIncrement( long volatile * ); +extern "C" __declspec(dllimport) long __stdcall InterlockedDecrement( long volatile * ); +extern "C" __declspec(dllimport) long __stdcall InterlockedCompareExchange( long volatile *, long, long ); +extern "C" __declspec(dllimport) long __stdcall InterlockedExchange( long volatile *, long ); +extern "C" __declspec(dllimport) long __stdcall InterlockedExchangeAdd( long volatile *, long ); + +} // namespace detail + +} // namespace boost + +# define BOOST_INTERLOCKED_INCREMENT ::boost::detail::InterlockedIncrement +# define BOOST_INTERLOCKED_DECREMENT ::boost::detail::InterlockedDecrement +# define BOOST_INTERLOCKED_COMPARE_EXCHANGE ::boost::detail::InterlockedCompareExchange +# define BOOST_INTERLOCKED_EXCHANGE ::boost::detail::InterlockedExchange +# define BOOST_INTERLOCKED_EXCHANGE_ADD ::boost::detail::InterlockedExchangeAdd + +# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \ + ((void*)BOOST_INTERLOCKED_COMPARE_EXCHANGE((long volatile*)(dest),(long)(exchange),(long)(compare))) +# define BOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \ + ((void*)BOOST_INTERLOCKED_EXCHANGE((long volatile*)(dest),(long)(exchange))) + +#else + +# error "Interlocked intrinsics not available" + +#endif + +#endif // #ifndef BOOST_DETAIL_INTERLOCKED_HPP_INCLUDED diff --git a/3rdParty/Boost/boost/detail/is_function_ref_tester.hpp b/3rdParty/Boost/boost/detail/is_function_ref_tester.hpp new file mode 100644 index 0000000..5f367ea --- /dev/null +++ b/3rdParty/Boost/boost/detail/is_function_ref_tester.hpp @@ -0,0 +1,135 @@ + +// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, +// Aleksey Gurtovoy, Howard Hinnant & John Maddock 2000. +// 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) + +#if !defined(BOOST_PP_IS_ITERATING) + +///// header body + +#ifndef BOOST_DETAIL_IS_FUNCTION_REF_TESTER_HPP_INCLUDED +#define BOOST_DETAIL_IS_FUNCTION_REF_TESTER_HPP_INCLUDED + +#include "boost/type_traits/detail/yes_no_type.hpp" +#include "boost/type_traits/config.hpp" + +#if defined(BOOST_TT_PREPROCESSING_MODE) +# include "boost/preprocessor/iterate.hpp" +# include "boost/preprocessor/enum_params.hpp" +# include "boost/preprocessor/comma_if.hpp" +#endif + +namespace boost { +namespace detail { +namespace is_function_ref_tester_ { + +template <class T> +boost::type_traits::no_type BOOST_TT_DECL is_function_ref_tester(T& ...); + +#if !defined(BOOST_TT_PREPROCESSING_MODE) +// preprocessor-generated part, don't edit by hand! + +template <class R> +boost::type_traits::yes_type is_function_ref_tester(R (&)(), int); + +template <class R,class T0 > +boost::type_traits::yes_type is_function_ref_tester(R (&)(T0), int); + +template <class R,class T0,class T1 > +boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1), int); + +template <class R,class T0,class T1,class T2 > +boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2), int); + +template <class R,class T0,class T1,class T2,class T3 > +boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3), int); + +template <class R,class T0,class T1,class T2,class T3,class T4 > +boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4), int); + +template <class R,class T0,class T1,class T2,class T3,class T4,class T5 > +boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5), int); + +template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6 > +boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6), int); + +template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7 > +boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7), int); + +template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8 > +boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8), int); + +template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9 > +boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9), int); + +template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10 > +boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10), int); + +template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11 > +boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11), int); + +template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12 > +boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12), int); + +template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13 > +boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13), int); + +template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14 > +boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14), int); + +template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15 > +boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15), int); + +template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15,class T16 > +boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16), int); + +template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15,class T16,class T17 > +boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17), int); + +template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15,class T16,class T17,class T18 > +boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18), int); + +template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15,class T16,class T17,class T18,class T19 > +boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19), int); + +template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15,class T16,class T17,class T18,class T19,class T20 > +boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20), int); + +template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15,class T16,class T17,class T18,class T19,class T20,class T21 > +boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21), int); + +template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15,class T16,class T17,class T18,class T19,class T20,class T21,class T22 > +boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22), int); + +template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15,class T16,class T17,class T18,class T19,class T20,class T21,class T22,class T23 > +boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23), int); + +template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15,class T16,class T17,class T18,class T19,class T20,class T21,class T22,class T23,class T24 > +boost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24), int); + +#else + +#define BOOST_PP_ITERATION_PARAMS_1 \ + (3, (0, 25, "boost/type_traits/detail/is_function_ref_tester.hpp")) +#include BOOST_PP_ITERATE() + +#endif // BOOST_TT_PREPROCESSING_MODE + +} // namespace detail +} // namespace python +} // namespace boost + +#endif // BOOST_DETAIL_IS_FUNCTION_REF_TESTER_HPP_INCLUDED + +///// iteration + +#else +#define i BOOST_PP_FRAME_ITERATION(1) + +template <class R BOOST_PP_COMMA_IF(i) BOOST_PP_ENUM_PARAMS(i,class T) > +boost::type_traits::yes_type is_function_ref_tester(R (&)(BOOST_PP_ENUM_PARAMS(i,T)), int); + +#undef i +#endif // BOOST_PP_IS_ITERATING diff --git a/3rdParty/Boost/boost/detail/iterator.hpp b/3rdParty/Boost/boost/detail/iterator.hpp new file mode 100644 index 0000000..5bb9c62 --- /dev/null +++ b/3rdParty/Boost/boost/detail/iterator.hpp @@ -0,0 +1,494 @@ +// (C) Copyright David Abrahams 2002. +// 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) + +// Boost versions of +// +// std::iterator_traits<>::iterator_category +// std::iterator_traits<>::difference_type +// std::distance() +// +// ...for all compilers and iterators +// +// Additionally, if X is a pointer +// std::iterator_traits<X>::pointer + +// Otherwise, if partial specialization is supported or X is not a pointer +// std::iterator_traits<X>::value_type +// std::iterator_traits<X>::pointer +// std::iterator_traits<X>::reference +// +// See http://www.boost.org for most recent version including documentation. + +// Revision History +// 04 Mar 2001 - More attempted fixes for Intel C++ (David Abrahams) +// 03 Mar 2001 - Put all implementation into namespace +// boost::detail::iterator_traits_. Some progress made on fixes +// for Intel compiler. (David Abrahams) +// 02 Mar 2001 - Changed BOOST_MSVC to BOOST_MSVC_STD_ITERATOR in a few +// places. (Jeremy Siek) +// 19 Feb 2001 - Improved workarounds for stock MSVC6; use yes_type and +// no_type from type_traits.hpp; stopped trying to remove_cv +// before detecting is_pointer, in honor of the new type_traits +// semantics. (David Abrahams) +// 13 Feb 2001 - Make it work with nearly all standard-conforming iterators +// under raw VC6. The one category remaining which will fail is +// that of iterators derived from std::iterator but not +// boost::iterator and which redefine difference_type. +// 11 Feb 2001 - Clean away code which can never be used (David Abrahams) +// 09 Feb 2001 - Always have a definition for each traits member, even if it +// can't be properly deduced. These will be incomplete types in +// some cases (undefined<void>), but it helps suppress MSVC errors +// elsewhere (David Abrahams) +// 07 Feb 2001 - Support for more of the traits members where possible, making +// this useful as a replacement for std::iterator_traits<T> when +// used as a default template parameter. +// 06 Feb 2001 - Removed useless #includes of standard library headers +// (David Abrahams) + +#ifndef ITERATOR_DWA122600_HPP_ +# define ITERATOR_DWA122600_HPP_ + +# include <boost/config.hpp> +# include <iterator> + +// STLPort 4.0 and betas have a bug when debugging is enabled and there is no +// partial specialization: instead of an iterator_category typedef, the standard +// container iterators have _Iterator_category. +// +// Also, whether debugging is enabled or not, there is a broken specialization +// of std::iterator<output_iterator_tag,void,void,void,void> which has no +// typedefs but iterator_category. +# if defined(__SGI_STL_PORT) + +# if (__SGI_STL_PORT <= 0x410) && !defined(__STL_CLASS_PARTIAL_SPECIALIZATION) && defined(__STL_DEBUG) +# define BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF +# endif + +# define BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION + +# endif // STLPort <= 4.1b4 && no partial specialization + +# if !defined(BOOST_NO_STD_ITERATOR_TRAITS) \ + && !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ + && !defined(BOOST_MSVC_STD_ITERATOR) + +namespace boost { namespace detail { + +// Define a new template so it can be specialized +template <class Iterator> +struct iterator_traits + : std::iterator_traits<Iterator> +{}; +using std::distance; + +}} // namespace boost::detail + +# else + +# if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ + && !defined(BOOST_MSVC_STD_ITERATOR) + +// This is the case where everything conforms except BOOST_NO_STD_ITERATOR_TRAITS + +namespace boost { namespace detail { + +// Rogue Wave Standard Library fools itself into thinking partial +// specialization is missing on some platforms (e.g. Sun), so fails to +// supply iterator_traits! +template <class Iterator> +struct iterator_traits +{ + typedef typename Iterator::value_type value_type; + typedef typename Iterator::reference reference; + typedef typename Iterator::pointer pointer; + typedef typename Iterator::difference_type difference_type; + typedef typename Iterator::iterator_category iterator_category; +}; + +template <class T> +struct iterator_traits<T*> +{ + typedef T value_type; + typedef T& reference; + typedef T* pointer; + typedef std::ptrdiff_t difference_type; + typedef std::random_access_iterator_tag iterator_category; +}; + +template <class T> +struct iterator_traits<T const*> +{ + typedef T value_type; + typedef T const& reference; + typedef T const* pointer; + typedef std::ptrdiff_t difference_type; + typedef std::random_access_iterator_tag iterator_category; +}; + +}} // namespace boost::detail + +# else + +# include <boost/type_traits/remove_const.hpp> +# include <boost/type_traits/detail/yes_no_type.hpp> +# include <boost/type_traits/is_pointer.hpp> + +# ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +# include <boost/type_traits/is_same.hpp> +# include <boost/type_traits/remove_pointer.hpp> +# endif +# ifdef BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION +# include <boost/type_traits/is_base_and_derived.hpp> +# endif + +# include <boost/mpl/if.hpp> +# include <boost/mpl/has_xxx.hpp> +# include <cstddef> + +// should be the last #include +# include "boost/type_traits/detail/bool_trait_def.hpp" + +namespace boost { namespace detail { + +BOOST_MPL_HAS_XXX_TRAIT_DEF(value_type) +BOOST_MPL_HAS_XXX_TRAIT_DEF(reference) +BOOST_MPL_HAS_XXX_TRAIT_DEF(pointer) +BOOST_MPL_HAS_XXX_TRAIT_DEF(difference_type) +BOOST_MPL_HAS_XXX_TRAIT_DEF(iterator_category) + +// is_mutable_iterator -- +// +// A metafunction returning true iff T is a mutable iterator type +// with a nested value_type. Will only work portably with iterators +// whose operator* returns a reference, but that seems to be OK for +// the iterators supplied by Dinkumware. Some input iterators may +// compile-time if they arrive here, and if the compiler is strict +// about not taking the address of an rvalue. + +// This one detects ordinary mutable iterators - the result of +// operator* is convertible to the value_type. +template <class T> +type_traits::yes_type is_mutable_iterator_helper(T const*, BOOST_DEDUCED_TYPENAME T::value_type*); + +// Since you can't take the address of an rvalue, the guts of +// is_mutable_iterator_impl will fail if we use &*t directly. This +// makes sure we can still work with non-lvalue iterators. +template <class T> T* mutable_iterator_lvalue_helper(T& x); +int mutable_iterator_lvalue_helper(...); + + +// This one detects output iterators such as ostream_iterator which +// return references to themselves. +template <class T> +type_traits::yes_type is_mutable_iterator_helper(T const*, T const*); + +type_traits::no_type is_mutable_iterator_helper(...); + +template <class T> +struct is_mutable_iterator_impl +{ + static T t; + + BOOST_STATIC_CONSTANT( + bool, value = sizeof( + detail::is_mutable_iterator_helper( + (T*)0 + , mutable_iterator_lvalue_helper(*t) // like &*t + )) + == sizeof(type_traits::yes_type) + ); +}; + +BOOST_TT_AUX_BOOL_TRAIT_DEF1( + is_mutable_iterator,T,::boost::detail::is_mutable_iterator_impl<T>::value) + + +// is_full_iterator_traits -- +// +// A metafunction returning true iff T has all the requisite nested +// types to satisfy the requirements for a fully-conforming +// iterator_traits implementation. +template <class T> +struct is_full_iterator_traits_impl +{ + enum { value = + has_value_type<T>::value + & has_reference<T>::value + & has_pointer<T>::value + & has_difference_type<T>::value + & has_iterator_category<T>::value + }; +}; + +BOOST_TT_AUX_BOOL_TRAIT_DEF1( + is_full_iterator_traits,T,::boost::detail::is_full_iterator_traits_impl<T>::value) + + +# ifdef BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF +BOOST_MPL_HAS_XXX_TRAIT_DEF(_Iterator_category) + +// is_stlport_40_debug_iterator -- +// +// A metafunction returning true iff T has all the requisite nested +// types to satisfy the requirements of an STLPort 4.0 debug iterator +// iterator_traits implementation. +template <class T> +struct is_stlport_40_debug_iterator_impl +{ + enum { value = + has_value_type<T>::value + & has_reference<T>::value + & has_pointer<T>::value + & has_difference_type<T>::value + & has__Iterator_category<T>::value + }; +}; + +BOOST_TT_AUX_BOOL_TRAIT_DEF1( + is_stlport_40_debug_iterator,T,::boost::detail::is_stlport_40_debug_iterator_impl<T>::value) + +template <class T> +struct stlport_40_debug_iterator_traits +{ + typedef typename T::value_type value_type; + typedef typename T::reference reference; + typedef typename T::pointer pointer; + typedef typename T::difference_type difference_type; + typedef typename T::_Iterator_category iterator_category; +}; +# endif // BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF + +template <class T> struct pointer_iterator_traits; + +# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +template <class T> +struct pointer_iterator_traits<T*> +{ + typedef typename remove_const<T>::type value_type; + typedef T* pointer; + typedef T& reference; + typedef std::random_access_iterator_tag iterator_category; + typedef std::ptrdiff_t difference_type; +}; +# else + +// In case of no template partial specialization, and if T is a +// pointer, iterator_traits<T>::value_type can still be computed. For +// some basic types, remove_pointer is manually defined in +// type_traits/broken_compiler_spec.hpp. For others, do it yourself. + +template<class P> class please_invoke_BOOST_TT_BROKEN_COMPILER_SPEC_on_cv_unqualified_pointee; + +template<class P> +struct pointer_value_type + : mpl::if_< + is_same<P, typename remove_pointer<P>::type> + , please_invoke_BOOST_TT_BROKEN_COMPILER_SPEC_on_cv_unqualified_pointee<P> + , typename remove_const< + typename remove_pointer<P>::type + >::type + > +{ +}; + + +template<class P> +struct pointer_reference + : mpl::if_< + is_same<P, typename remove_pointer<P>::type> + , please_invoke_BOOST_TT_BROKEN_COMPILER_SPEC_on_cv_unqualified_pointee<P> + , typename remove_pointer<P>::type& + > +{ +}; + +template <class T> +struct pointer_iterator_traits +{ + typedef T pointer; + typedef std::random_access_iterator_tag iterator_category; + typedef std::ptrdiff_t difference_type; + + typedef typename pointer_value_type<T>::type value_type; + typedef typename pointer_reference<T>::type reference; +}; + +# endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +// We'll sort iterator types into one of these classifications, from which we +// can determine the difference_type, pointer, reference, and value_type +template <class Iterator> +struct standard_iterator_traits +{ + typedef typename Iterator::difference_type difference_type; + typedef typename Iterator::value_type value_type; + typedef typename Iterator::pointer pointer; + typedef typename Iterator::reference reference; + typedef typename Iterator::iterator_category iterator_category; +}; + +template <class Iterator> +struct msvc_stdlib_mutable_traits + : std::iterator_traits<Iterator> +{ + typedef typename std::iterator_traits<Iterator>::distance_type difference_type; + typedef typename std::iterator_traits<Iterator>::value_type* pointer; + typedef typename std::iterator_traits<Iterator>::value_type& reference; +}; + +template <class Iterator> +struct msvc_stdlib_const_traits + : std::iterator_traits<Iterator> +{ + typedef typename std::iterator_traits<Iterator>::distance_type difference_type; + typedef const typename std::iterator_traits<Iterator>::value_type* pointer; + typedef const typename std::iterator_traits<Iterator>::value_type& reference; +}; + +# ifdef BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION +template <class Iterator> +struct is_bad_output_iterator + : is_base_and_derived< + std::iterator<std::output_iterator_tag,void,void,void,void> + , Iterator> +{ +}; + +struct bad_output_iterator_traits +{ + typedef void value_type; + typedef void difference_type; + typedef std::output_iterator_tag iterator_category; + typedef void pointer; + typedef void reference; +}; +# endif + +// If we're looking at an MSVC6 (old Dinkumware) ``standard'' +// iterator, this will generate an appropriate traits class. +template <class Iterator> +struct msvc_stdlib_iterator_traits + : mpl::if_< + is_mutable_iterator<Iterator> + , msvc_stdlib_mutable_traits<Iterator> + , msvc_stdlib_const_traits<Iterator> + >::type +{}; + +template <class Iterator> +struct non_pointer_iterator_traits + : mpl::if_< + // if the iterator contains all the right nested types... + is_full_iterator_traits<Iterator> + // Use a standard iterator_traits implementation + , standard_iterator_traits<Iterator> +# ifdef BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF + // Check for STLPort 4.0 broken _Iterator_category type + , mpl::if_< + is_stlport_40_debug_iterator<Iterator> + , stlport_40_debug_iterator_traits<Iterator> +# endif + // Otherwise, assume it's a Dinkum iterator + , msvc_stdlib_iterator_traits<Iterator> +# ifdef BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF + >::type +# endif + >::type +{ +}; + +template <class Iterator> +struct iterator_traits_aux + : mpl::if_< + is_pointer<Iterator> + , pointer_iterator_traits<Iterator> + , non_pointer_iterator_traits<Iterator> + >::type +{ +}; + +template <class Iterator> +struct iterator_traits +{ + // Explicit forwarding from base class needed to keep MSVC6 happy + // under some circumstances. + private: +# ifdef BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION + typedef + typename mpl::if_< + is_bad_output_iterator<Iterator> + , bad_output_iterator_traits + , iterator_traits_aux<Iterator> + >::type base; +# else + typedef iterator_traits_aux<Iterator> base; +# endif + public: + typedef typename base::value_type value_type; + typedef typename base::pointer pointer; + typedef typename base::reference reference; + typedef typename base::difference_type difference_type; + typedef typename base::iterator_category iterator_category; +}; + +// This specialization cuts off ETI (Early Template Instantiation) for MSVC. +template <> struct iterator_traits<int> +{ + typedef int value_type; + typedef int pointer; + typedef int reference; + typedef int difference_type; + typedef int iterator_category; +}; + +}} // namespace boost::detail + +# endif // workarounds + +namespace boost { namespace detail { + +namespace iterator_traits_ +{ + template <class Iterator, class Difference> + struct distance_select + { + static Difference execute(Iterator i1, const Iterator i2, ...) + { + Difference result = 0; + while (i1 != i2) + { + ++i1; + ++result; + } + return result; + } + + static Difference execute(Iterator i1, const Iterator i2, std::random_access_iterator_tag*) + { + return i2 - i1; + } + }; +} // namespace boost::detail::iterator_traits_ + +template <class Iterator> +inline typename iterator_traits<Iterator>::difference_type +distance(Iterator first, Iterator last) +{ + typedef typename iterator_traits<Iterator>::difference_type diff_t; + typedef typename ::boost::detail::iterator_traits<Iterator>::iterator_category iterator_category; + + return iterator_traits_::distance_select<Iterator,diff_t>::execute( + first, last, (iterator_category*)0); +} + +}} + +# endif + + +# undef BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF +# undef BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION + +#endif // ITERATOR_DWA122600_HPP_ diff --git a/3rdParty/Boost/boost/detail/lcast_precision.hpp b/3rdParty/Boost/boost/detail/lcast_precision.hpp new file mode 100644 index 0000000..d40ca21 --- /dev/null +++ b/3rdParty/Boost/boost/detail/lcast_precision.hpp @@ -0,0 +1,184 @@ +// Copyright Alexander Nasonov & Paul A. Bristow 2006. + +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_DETAIL_LCAST_PRECISION_HPP_INCLUDED +#define BOOST_DETAIL_LCAST_PRECISION_HPP_INCLUDED + +#include <climits> +#include <ios> +#include <limits> + +#include <boost/config.hpp> +#include <boost/integer_traits.hpp> + +#ifndef BOOST_NO_IS_ABSTRACT +// Fix for SF:1358600 - lexical_cast & pure virtual functions & VC 8 STL +#include <boost/mpl/if.hpp> +#include <boost/type_traits/is_abstract.hpp> +#endif + +#if defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS) || \ + (defined(BOOST_MSVC) && (BOOST_MSVC<1310)) + +#define BOOST_LCAST_NO_COMPILE_TIME_PRECISION +#endif + +#ifdef BOOST_LCAST_NO_COMPILE_TIME_PRECISION +#include <boost/assert.hpp> +#else +#include <boost/static_assert.hpp> +#endif + +namespace boost { namespace detail { + +class lcast_abstract_stub {}; + +#ifndef BOOST_LCAST_NO_COMPILE_TIME_PRECISION +// Calculate an argument to pass to std::ios_base::precision from +// lexical_cast. See alternative implementation for broken standard +// libraries in lcast_get_precision below. Keep them in sync, please. +template<class T> +struct lcast_precision +{ +#ifdef BOOST_NO_IS_ABSTRACT + typedef std::numeric_limits<T> limits; // No fix for SF:1358600. +#else + typedef BOOST_DEDUCED_TYPENAME boost::mpl::if_< + boost::is_abstract<T> + , std::numeric_limits<lcast_abstract_stub> + , std::numeric_limits<T> + >::type limits; +#endif + + BOOST_STATIC_CONSTANT(bool, use_default_precision = + !limits::is_specialized || limits::is_exact + ); + + BOOST_STATIC_CONSTANT(bool, is_specialized_bin = + !use_default_precision && + limits::radix == 2 && limits::digits > 0 + ); + + BOOST_STATIC_CONSTANT(bool, is_specialized_dec = + !use_default_precision && + limits::radix == 10 && limits::digits10 > 0 + ); + + BOOST_STATIC_CONSTANT(std::streamsize, streamsize_max = + boost::integer_traits<std::streamsize>::const_max + ); + + BOOST_STATIC_CONSTANT(unsigned int, precision_dec = limits::digits10 + 1U); + + BOOST_STATIC_ASSERT(!is_specialized_dec || + precision_dec <= streamsize_max + 0UL + ); + + BOOST_STATIC_CONSTANT(unsigned long, precision_bin = + 2UL + limits::digits * 30103UL / 100000UL + ); + + BOOST_STATIC_ASSERT(!is_specialized_bin || + (limits::digits + 0UL < ULONG_MAX / 30103UL && + precision_bin > limits::digits10 + 0UL && + precision_bin <= streamsize_max + 0UL) + ); + + BOOST_STATIC_CONSTANT(std::streamsize, value = + is_specialized_bin ? precision_bin + : is_specialized_dec ? precision_dec : 6 + ); +}; +#endif + +template<class T> +inline std::streamsize lcast_get_precision(T* = 0) +{ +#ifndef BOOST_LCAST_NO_COMPILE_TIME_PRECISION + return lcast_precision<T>::value; +#else // Follow lcast_precision algorithm at run-time: + +#ifdef BOOST_NO_IS_ABSTRACT + typedef std::numeric_limits<T> limits; // No fix for SF:1358600. +#else + typedef BOOST_DEDUCED_TYPENAME boost::mpl::if_< + boost::is_abstract<T> + , std::numeric_limits<lcast_abstract_stub> + , std::numeric_limits<T> + >::type limits; +#endif + + bool const use_default_precision = + !limits::is_specialized || limits::is_exact; + + if(!use_default_precision) + { // Includes all built-in floating-point types, float, double ... + // and UDT types for which digits (significand bits) is defined (not zero) + + bool const is_specialized_bin = + limits::radix == 2 && limits::digits > 0; + bool const is_specialized_dec = + limits::radix == 10 && limits::digits10 > 0; + std::streamsize const streamsize_max = + (boost::integer_traits<std::streamsize>::max)(); + + if(is_specialized_bin) + { // Floating-point types with + // limits::digits defined by the specialization. + + unsigned long const digits = limits::digits; + unsigned long const precision = 2UL + digits * 30103UL / 100000UL; + // unsigned long is selected because it is at least 32-bits + // and thus ULONG_MAX / 30103UL is big enough for all types. + BOOST_ASSERT( + digits < ULONG_MAX / 30103UL && + precision > limits::digits10 + 0UL && + precision <= streamsize_max + 0UL + ); + return precision; + } + else if(is_specialized_dec) + { // Decimal Floating-point type, most likely a User Defined Type + // rather than a real floating-point hardware type. + unsigned int const precision = limits::digits10 + 1U; + BOOST_ASSERT(precision <= streamsize_max + 0UL); + return precision; + } + } + + // Integral type (for which precision has no effect) + // or type T for which limits is NOT specialized, + // so assume stream precision remains the default 6 decimal digits. + // Warning: if your User-defined Floating-point type T is NOT specialized, + // then you may lose accuracy by only using 6 decimal digits. + // To avoid this, you need to specialize T with either + // radix == 2 and digits == the number of significand bits, + // OR + // radix = 10 and digits10 == the number of decimal digits. + + return 6; +#endif +} + +template<class T> +inline void lcast_set_precision(std::ios_base& stream, T*) +{ + stream.precision(lcast_get_precision<T>()); +} + +template<class Source, class Target> +inline void lcast_set_precision(std::ios_base& stream, Source*, Target*) +{ + std::streamsize const s = lcast_get_precision((Source*)0); + std::streamsize const t = lcast_get_precision((Target*)0); + stream.precision(s > t ? s : t); +} + +}} + +#endif // BOOST_DETAIL_LCAST_PRECISION_HPP_INCLUDED + diff --git a/3rdParty/Boost/boost/detail/lightweight_mutex.hpp b/3rdParty/Boost/boost/detail/lightweight_mutex.hpp new file mode 100644 index 0000000..b7a7f6d --- /dev/null +++ b/3rdParty/Boost/boost/detail/lightweight_mutex.hpp @@ -0,0 +1,22 @@ +#ifndef BOOST_DETAIL_LIGHTWEIGHT_MUTEX_HPP_INCLUDED +#define BOOST_DETAIL_LIGHTWEIGHT_MUTEX_HPP_INCLUDED + +// MS compatible compilers support #pragma once + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +// +// boost/detail/lightweight_mutex.hpp - lightweight mutex +// +// Copyright (c) 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 <boost/smart_ptr/detail/lightweight_mutex.hpp> + +#endif // #ifndef BOOST_DETAIL_LIGHTWEIGHT_MUTEX_HPP_INCLUDED diff --git a/3rdParty/Boost/boost/detail/limits.hpp b/3rdParty/Boost/boost/detail/limits.hpp new file mode 100644 index 0000000..6f018df --- /dev/null +++ b/3rdParty/Boost/boost/detail/limits.hpp @@ -0,0 +1,449 @@ +// Copyright 2001 John Maddock +// Distributed under the Boost Software License, Version 1.0. (See accompany- +// ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +/* + * Copyright (c) 1997 + * Silicon Graphics Computer Systems, Inc. + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Silicon Graphics makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + */ + +/* NOTE: This is not portable code. Parts of numeric_limits<> are + * inherently machine-dependent, and this file is written for the MIPS + * architecture and the SGI MIPSpro C++ compiler. Parts of it (in + * particular, some of the characteristics of floating-point types) + * are almost certainly incorrect for any other platform. + */ + +/* The above comment is almost certainly out of date. This file works + * on systems other than SGI MIPSpro C++ now. + */ + +/* + * Revision history: + * 21 Sep 2001: + * Only include <cwchar> if BOOST_NO_CWCHAR is defined. (Darin Adler) + * 10 Aug 2001: + * Added MIPS (big endian) to the big endian family. (Jens Maurer) + * 13 Apr 2001: + * Added powerpc to the big endian family. (Jeremy Siek) + * 5 Apr 2001: + * Added sparc (big endian) processor support (John Maddock). + * Initial sub: + * Modified by Jens Maurer for gcc 2.95 on x86. + */ + +#ifndef BOOST_SGI_CPP_LIMITS +#define BOOST_SGI_CPP_LIMITS + +#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 + +namespace std { + +enum float_round_style { + round_indeterminate = -1, + round_toward_zero = 0, + round_to_nearest = 1, + round_toward_infinity = 2, + round_toward_neg_infinity = 3 +}; + +enum float_denorm_style { + denorm_indeterminate = -1, + denorm_absent = 0, + denorm_present = 1 +}; + +// The C++ standard (section 18.2.1) requires that some of the members of +// numeric_limits be static const data members that are given constant- +// initializers within the class declaration. On compilers where the +// BOOST_NO_INCLASS_MEMBER_INITIALIZATION macro is defined, it is impossible to write +// a standard-conforming numeric_limits class. +// +// There are two possible workarounds: either initialize the data +// members outside the class, or change them from data members to +// enums. Neither workaround is satisfactory: the former makes it +// impossible to use the data members in constant-expressions, and the +// latter means they have the wrong type and that it is impossible to +// take their addresses. We choose the former workaround. + +#ifdef BOOST_NO_INCLASS_MEMBER_INITIALIZATION +# define BOOST_STL_DECLARE_LIMITS_MEMBER(__mem_type, __mem_name, __mem_value) \ + enum { __mem_name = __mem_value } +#else /* BOOST_NO_INCLASS_MEMBER_INITIALIZATION */ +# define BOOST_STL_DECLARE_LIMITS_MEMBER(__mem_type, __mem_name, __mem_value) \ + static const __mem_type __mem_name = __mem_value +#endif /* BOOST_NO_INCLASS_MEMBER_INITIALIZATION */ + +// Base class for all specializations of numeric_limits. +template <class __number> +class _Numeric_limits_base { +public: + BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_specialized, false); + + static __number min BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return __number(); } + static __number max BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return __number(); } + + BOOST_STL_DECLARE_LIMITS_MEMBER(int, digits, 0); + BOOST_STL_DECLARE_LIMITS_MEMBER(int, digits10, 0); + + BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_signed, false); + BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_integer, false); + BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_exact, false); + + BOOST_STL_DECLARE_LIMITS_MEMBER(int, radix, 0); + + static __number epsilon() throw() { return __number(); } + static __number round_error() throw() { return __number(); } + + BOOST_STL_DECLARE_LIMITS_MEMBER(int, min_exponent, 0); + BOOST_STL_DECLARE_LIMITS_MEMBER(int, min_exponent10, 0); + BOOST_STL_DECLARE_LIMITS_MEMBER(int, max_exponent, 0); + BOOST_STL_DECLARE_LIMITS_MEMBER(int, max_exponent10, 0); + + BOOST_STL_DECLARE_LIMITS_MEMBER(bool, has_infinity, false); + BOOST_STL_DECLARE_LIMITS_MEMBER(bool, has_quiet_NaN, false); + BOOST_STL_DECLARE_LIMITS_MEMBER(bool, has_signaling_NaN, false); + BOOST_STL_DECLARE_LIMITS_MEMBER(float_denorm_style, + has_denorm, + denorm_absent); + BOOST_STL_DECLARE_LIMITS_MEMBER(bool, has_denorm_loss, false); + + static __number infinity() throw() { return __number(); } + static __number quiet_NaN() throw() { return __number(); } + static __number signaling_NaN() throw() { return __number(); } + static __number denorm_min() throw() { return __number(); } + + BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_iec559, false); + BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_bounded, false); + BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_modulo, false); + + BOOST_STL_DECLARE_LIMITS_MEMBER(bool, traps, false); + BOOST_STL_DECLARE_LIMITS_MEMBER(bool, tinyness_before, false); + BOOST_STL_DECLARE_LIMITS_MEMBER(float_round_style, + round_style, + round_toward_zero); +}; + +// Base class for integers. + +template <class _Int, + _Int __imin, + _Int __imax, + int __idigits = -1> +class _Integer_limits : public _Numeric_limits_base<_Int> +{ +public: + BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_specialized, true); + + static _Int min BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return __imin; } + static _Int max BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return __imax; } + + BOOST_STL_DECLARE_LIMITS_MEMBER(int, + digits, + (__idigits < 0) ? (int)(sizeof(_Int) * CHAR_BIT) + - (__imin == 0 ? 0 : 1) + : __idigits); + BOOST_STL_DECLARE_LIMITS_MEMBER(int, digits10, (digits * 301) / 1000); + // log 2 = 0.301029995664... + + BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_signed, __imin != 0); + BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_integer, true); + BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_exact, true); + BOOST_STL_DECLARE_LIMITS_MEMBER(int, radix, 2); + + BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_bounded, true); + BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_modulo, true); +}; + +#if defined(BOOST_BIG_ENDIAN) + + template<class Number, unsigned int Word> + struct float_helper{ + static Number get_word() throw() { + // sizeof(long double) == 16 + const unsigned int _S_word[4] = { Word, 0, 0, 0 }; + return *reinterpret_cast<const Number*>(&_S_word); + } +}; + +#else + + template<class Number, unsigned int Word> + struct float_helper{ + static Number get_word() throw() { + // sizeof(long double) == 12, but only 10 bytes significant + const unsigned int _S_word[4] = { 0, 0, 0, Word }; + return *reinterpret_cast<const Number*>( + reinterpret_cast<const char *>(&_S_word)+16- + (sizeof(Number) == 12 ? 10 : sizeof(Number))); + } +}; + +#endif + +// Base class for floating-point numbers. +template <class __number, + int __Digits, int __Digits10, + int __MinExp, int __MaxExp, + int __MinExp10, int __MaxExp10, + unsigned int __InfinityWord, + unsigned int __QNaNWord, unsigned int __SNaNWord, + bool __IsIEC559, + float_round_style __RoundStyle> +class _Floating_limits : public _Numeric_limits_base<__number> +{ +public: + BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_specialized, true); + + BOOST_STL_DECLARE_LIMITS_MEMBER(int, digits, __Digits); + BOOST_STL_DECLARE_LIMITS_MEMBER(int, digits10, __Digits10); + + BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_signed, true); + + BOOST_STL_DECLARE_LIMITS_MEMBER(int, radix, 2); + + BOOST_STL_DECLARE_LIMITS_MEMBER(int, min_exponent, __MinExp); + BOOST_STL_DECLARE_LIMITS_MEMBER(int, max_exponent, __MaxExp); + BOOST_STL_DECLARE_LIMITS_MEMBER(int, min_exponent10, __MinExp10); + BOOST_STL_DECLARE_LIMITS_MEMBER(int, max_exponent10, __MaxExp10); + + BOOST_STL_DECLARE_LIMITS_MEMBER(bool, has_infinity, true); + BOOST_STL_DECLARE_LIMITS_MEMBER(bool, has_quiet_NaN, true); + BOOST_STL_DECLARE_LIMITS_MEMBER(bool, has_signaling_NaN, true); + BOOST_STL_DECLARE_LIMITS_MEMBER(float_denorm_style, + has_denorm, + denorm_indeterminate); + BOOST_STL_DECLARE_LIMITS_MEMBER(bool, has_denorm_loss, false); + + + static __number infinity() throw() { + return float_helper<__number, __InfinityWord>::get_word(); + } + static __number quiet_NaN() throw() { + return float_helper<__number,__QNaNWord>::get_word(); + } + static __number signaling_NaN() throw() { + return float_helper<__number,__SNaNWord>::get_word(); + } + + BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_iec559, __IsIEC559); + BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_bounded, true); + BOOST_STL_DECLARE_LIMITS_MEMBER(bool, traps, false /* was: true */ ); + BOOST_STL_DECLARE_LIMITS_MEMBER(bool, tinyness_before, false); + + BOOST_STL_DECLARE_LIMITS_MEMBER(float_round_style, round_style, __RoundStyle); +}; + +// Class numeric_limits + +// The unspecialized class. + +template<class T> +class numeric_limits : public _Numeric_limits_base<T> {}; + +// Specializations for all built-in integral types. + +template<> +class numeric_limits<bool> + : public _Integer_limits<bool, false, true, 0> +{}; + +template<> +class numeric_limits<char> + : public _Integer_limits<char, CHAR_MIN, CHAR_MAX> +{}; + +template<> +class numeric_limits<signed char> + : public _Integer_limits<signed char, SCHAR_MIN, SCHAR_MAX> +{}; + +template<> +class numeric_limits<unsigned char> + : public _Integer_limits<unsigned char, 0, UCHAR_MAX> +{}; + +#ifndef BOOST_NO_INTRINSIC_WCHAR_T +template<> +class numeric_limits<wchar_t> +#if !defined(WCHAR_MAX) || !defined(WCHAR_MIN) +#if defined(_WIN32) || defined(__CYGWIN__) + : public _Integer_limits<wchar_t, 0, USHRT_MAX> +#elif defined(__hppa) +// wchar_t has "unsigned int" as the underlying type + : public _Integer_limits<wchar_t, 0, UINT_MAX> +#else +// assume that wchar_t has "int" as the underlying type + : public _Integer_limits<wchar_t, INT_MIN, INT_MAX> +#endif +#else +// we have WCHAR_MIN and WCHAR_MAX defined, so use it + : public _Integer_limits<wchar_t, WCHAR_MIN, WCHAR_MAX> +#endif +{}; +#endif + +template<> +class numeric_limits<short> + : public _Integer_limits<short, SHRT_MIN, SHRT_MAX> +{}; + +template<> +class numeric_limits<unsigned short> + : public _Integer_limits<unsigned short, 0, USHRT_MAX> +{}; + +template<> +class numeric_limits<int> + : public _Integer_limits<int, INT_MIN, INT_MAX> +{}; + +template<> +class numeric_limits<unsigned int> + : public _Integer_limits<unsigned int, 0, UINT_MAX> +{}; + +template<> +class numeric_limits<long> + : public _Integer_limits<long, LONG_MIN, LONG_MAX> +{}; + +template<> +class numeric_limits<unsigned long> + : public _Integer_limits<unsigned long, 0, ULONG_MAX> +{}; + +#ifdef __GNUC__ + +// Some compilers have long long, but don't define the +// LONGLONG_MIN and LONGLONG_MAX macros in limits.h. This +// assumes that long long is 64 bits. +#if !defined(LONGLONG_MAX) && !defined(ULONGLONG_MAX) + +# define ULONGLONG_MAX 0xffffffffffffffffLLU +# define LONGLONG_MAX 0x7fffffffffffffffLL + +#endif + +#if !defined(LONGLONG_MIN) +# define LONGLONG_MIN (-LONGLONG_MAX - 1) +#endif + + +#if !defined(ULONGLONG_MIN) +# define ULONGLONG_MIN 0 +#endif + +#endif /* __GNUC__ */ + +// Specializations for all built-in floating-point type. + +template<> class numeric_limits<float> + : public _Floating_limits<float, + FLT_MANT_DIG, // Binary digits of precision + FLT_DIG, // Decimal digits of precision + FLT_MIN_EXP, // Minimum exponent + FLT_MAX_EXP, // Maximum exponent + FLT_MIN_10_EXP, // Minimum base 10 exponent + FLT_MAX_10_EXP, // Maximum base 10 exponent +#if defined(BOOST_BIG_ENDIAN) + 0x7f80 << (sizeof(int)*CHAR_BIT-16), // Last word of +infinity + 0x7f81 << (sizeof(int)*CHAR_BIT-16), // Last word of quiet NaN + 0x7fc1 << (sizeof(int)*CHAR_BIT-16), // Last word of signaling NaN +#else + 0x7f800000u, // Last word of +infinity + 0x7f810000u, // Last word of quiet NaN + 0x7fc10000u, // Last word of signaling NaN +#endif + true, // conforms to iec559 + round_to_nearest> +{ +public: + static float min BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return FLT_MIN; } + static float denorm_min() throw() { return FLT_MIN; } + static float max BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return FLT_MAX; } + static float epsilon() throw() { return FLT_EPSILON; } + static float round_error() throw() { return 0.5f; } // Units: ulps. +}; + +template<> class numeric_limits<double> + : public _Floating_limits<double, + DBL_MANT_DIG, // Binary digits of precision + DBL_DIG, // Decimal digits of precision + DBL_MIN_EXP, // Minimum exponent + DBL_MAX_EXP, // Maximum exponent + DBL_MIN_10_EXP, // Minimum base 10 exponent + DBL_MAX_10_EXP, // Maximum base 10 exponent +#if defined(BOOST_BIG_ENDIAN) + 0x7ff0 << (sizeof(int)*CHAR_BIT-16), // Last word of +infinity + 0x7ff1 << (sizeof(int)*CHAR_BIT-16), // Last word of quiet NaN + 0x7ff9 << (sizeof(int)*CHAR_BIT-16), // Last word of signaling NaN +#else + 0x7ff00000u, // Last word of +infinity + 0x7ff10000u, // Last word of quiet NaN + 0x7ff90000u, // Last word of signaling NaN +#endif + true, // conforms to iec559 + round_to_nearest> +{ +public: + static double min BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return DBL_MIN; } + static double denorm_min() throw() { return DBL_MIN; } + static double max BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return DBL_MAX; } + static double epsilon() throw() { return DBL_EPSILON; } + static double round_error() throw() { return 0.5; } // Units: ulps. +}; + +template<> class numeric_limits<long double> + : public _Floating_limits<long double, + LDBL_MANT_DIG, // Binary digits of precision + LDBL_DIG, // Decimal digits of precision + LDBL_MIN_EXP, // Minimum exponent + LDBL_MAX_EXP, // Maximum exponent + LDBL_MIN_10_EXP,// Minimum base 10 exponent + LDBL_MAX_10_EXP,// Maximum base 10 exponent +#if defined(BOOST_BIG_ENDIAN) + 0x7ff0 << (sizeof(int)*CHAR_BIT-16), // Last word of +infinity + 0x7ff1 << (sizeof(int)*CHAR_BIT-16), // Last word of quiet NaN + 0x7ff9 << (sizeof(int)*CHAR_BIT-16), // Last word of signaling NaN +#else + 0x7fff8000u, // Last word of +infinity + 0x7fffc000u, // Last word of quiet NaN + 0x7fff9000u, // Last word of signaling NaN +#endif + false, // Doesn't conform to iec559 + round_to_nearest> +{ +public: + static long double min BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return LDBL_MIN; } + static long double denorm_min() throw() { return LDBL_MIN; } + static long double max BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return LDBL_MAX; } + static long double epsilon() throw() { return LDBL_EPSILON; } + static long double round_error() throw() { return 4; } // Units: ulps. +}; + +} // namespace std + +#endif /* BOOST_SGI_CPP_LIMITS */ + +// Local Variables: +// mode:C++ +// End: + + + diff --git a/3rdParty/Boost/boost/detail/ob_call_traits.hpp b/3rdParty/Boost/boost/detail/ob_call_traits.hpp new file mode 100644 index 0000000..eb4df7a --- /dev/null +++ b/3rdParty/Boost/boost/detail/ob_call_traits.hpp @@ -0,0 +1,168 @@ +// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). +// +// See http://www.boost.org/libs/utility for most recent version including documentation. +// +// Crippled version for crippled compilers: +// see libs/utility/call_traits.htm +// + +/* Release notes: + 01st October 2000: + Fixed call_traits on VC6, using "poor man's partial specialisation", + using ideas taken from "Generative programming" by Krzysztof Czarnecki + & Ulrich Eisenecker. +*/ + +#ifndef BOOST_OB_CALL_TRAITS_HPP +#define BOOST_OB_CALL_TRAITS_HPP + +#ifndef BOOST_CONFIG_HPP +#include <boost/config.hpp> +#endif + +#ifndef BOOST_ARITHMETIC_TYPE_TRAITS_HPP +#include <boost/type_traits/arithmetic_traits.hpp> +#endif +#ifndef BOOST_COMPOSITE_TYPE_TRAITS_HPP +#include <boost/type_traits/composite_traits.hpp> +#endif + +namespace boost{ + +#ifdef BOOST_MSVC6_MEMBER_TEMPLATES +// +// use member templates to emulate +// partial specialisation: +// +namespace detail{ + +template <class T> +struct standard_call_traits +{ + typedef T value_type; + typedef T& reference; + typedef const T& const_reference; + typedef const T& param_type; +}; +template <class T> +struct simple_call_traits +{ + typedef T value_type; + typedef T& reference; + typedef const T& const_reference; + typedef const T param_type; +}; +template <class T> +struct reference_call_traits +{ + typedef T value_type; + typedef T reference; + typedef T const_reference; + typedef T param_type; +}; + +template <bool pointer, bool arithmetic, bool reference> +struct call_traits_chooser +{ + template <class T> + struct rebind + { + typedef standard_call_traits<T> type; + }; +}; + +template <> +struct call_traits_chooser<true, false, false> +{ + template <class T> + struct rebind + { + typedef simple_call_traits<T> type; + }; +}; + +template <> +struct call_traits_chooser<false, false, true> +{ + template <class T> + struct rebind + { + typedef reference_call_traits<T> type; + }; +}; + +template <bool size_is_small> +struct call_traits_sizeof_chooser2 +{ + template <class T> + struct small_rebind + { + typedef simple_call_traits<T> small_type; + }; +}; + +template<> +struct call_traits_sizeof_chooser2<false> +{ + template <class T> + struct small_rebind + { + typedef standard_call_traits<T> small_type; + }; +}; + +template <> +struct call_traits_chooser<false, true, false> +{ + template <class T> + struct rebind + { + enum { sizeof_choice = (sizeof(T) <= sizeof(void*)) }; + typedef call_traits_sizeof_chooser2<(sizeof(T) <= sizeof(void*))> chooser; + typedef typename chooser::template small_rebind<T> bound_type; + typedef typename bound_type::small_type type; + }; +}; + +} // namespace detail +template <typename T> +struct call_traits +{ +private: + typedef detail::call_traits_chooser< + ::boost::is_pointer<T>::value, + ::boost::is_arithmetic<T>::value, + ::boost::is_reference<T>::value + > chooser; + typedef typename chooser::template rebind<T> bound_type; + typedef typename bound_type::type call_traits_type; +public: + typedef typename call_traits_type::value_type value_type; + typedef typename call_traits_type::reference reference; + typedef typename call_traits_type::const_reference const_reference; + typedef typename call_traits_type::param_type param_type; +}; + +#else +// +// sorry call_traits is completely non-functional +// blame your broken compiler: +// + +template <typename T> +struct call_traits +{ + typedef T value_type; + typedef T& reference; + typedef const T& const_reference; + typedef const T& param_type; +}; + +#endif // member templates + +} + +#endif // BOOST_OB_CALL_TRAITS_HPP diff --git a/3rdParty/Boost/boost/detail/reference_content.hpp b/3rdParty/Boost/boost/detail/reference_content.hpp new file mode 100644 index 0000000..daf56a8 --- /dev/null +++ b/3rdParty/Boost/boost/detail/reference_content.hpp @@ -0,0 +1,141 @@ +//----------------------------------------------------------------------------- +// boost detail/reference_content.hpp header file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2003 +// Eric Friedman +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_DETAIL_REFERENCE_CONTENT_HPP +#define BOOST_DETAIL_REFERENCE_CONTENT_HPP + +#include "boost/config.hpp" + +#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) +# include "boost/mpl/bool.hpp" +# include "boost/type_traits/has_nothrow_copy.hpp" +#else +# include "boost/mpl/if.hpp" +# include "boost/type_traits/is_reference.hpp" +#endif + +#include "boost/mpl/void.hpp" + +namespace boost { + +namespace detail { + +/////////////////////////////////////////////////////////////////////////////// +// (detail) class template reference_content +// +// Non-Assignable wrapper for references. +// +template <typename RefT> +class reference_content +{ +private: // representation + + RefT content_; + +public: // structors + + ~reference_content() + { + } + + reference_content(RefT r) + : content_( r ) + { + } + + reference_content(const reference_content& operand) + : content_( operand.content_ ) + { + } + +private: // non-Assignable + + reference_content& operator=(const reference_content&); + +public: // queries + + RefT get() const + { + return content_; + } + +}; + +/////////////////////////////////////////////////////////////////////////////// +// (detail) metafunction make_reference_content +// +// Wraps with reference_content if specified type is reference. +// + +template <typename T = mpl::void_> struct make_reference_content; + +#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) + +template <typename T> +struct make_reference_content +{ + typedef T type; +}; + +template <typename T> +struct make_reference_content< T& > +{ + typedef reference_content<T&> type; +}; + +#else // defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) + +template <typename T> +struct make_reference_content + : mpl::if_< + is_reference<T> + , reference_content<T> + , T + > +{ +}; + +#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION workaround + +template <> +struct make_reference_content< mpl::void_ > +{ + template <typename T> + struct apply + : make_reference_content<T> + { + }; + + typedef mpl::void_ type; +}; + +} // namespace detail + +/////////////////////////////////////////////////////////////////////////////// +// reference_content<T&> type traits specializations +// + +#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) + +template <typename T> +struct has_nothrow_copy< + ::boost::detail::reference_content< T& > + > + : mpl::true_ +{ +}; + +#endif // !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) + +} // namespace boost + +#endif // BOOST_DETAIL_REFERENCE_CONTENT_HPP diff --git a/3rdParty/Boost/boost/detail/sp_typeinfo.hpp b/3rdParty/Boost/boost/detail/sp_typeinfo.hpp new file mode 100644 index 0000000..e78c943 --- /dev/null +++ b/3rdParty/Boost/boost/detail/sp_typeinfo.hpp @@ -0,0 +1,83 @@ +#ifndef BOOST_DETAIL_SP_TYPEINFO_HPP_INCLUDED +#define BOOST_DETAIL_SP_TYPEINFO_HPP_INCLUDED + +// MS compatible compilers support #pragma once + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +// detail/sp_typeinfo.hpp +// +// Copyright 2007 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_NO_TYPEID ) + +namespace boost +{ + +namespace detail +{ + +typedef void* sp_typeinfo; + +template<class T> struct sp_typeid_ +{ + static char v_; +}; + +template<class T> char sp_typeid_< T >::v_; + +template<class T> struct sp_typeid_< T const >: sp_typeid_< T > +{ +}; + +template<class T> struct sp_typeid_< T volatile >: sp_typeid_< T > +{ +}; + +template<class T> struct sp_typeid_< T const volatile >: sp_typeid_< T > +{ +}; + +} // namespace detail + +} // namespace boost + +#define BOOST_SP_TYPEID(T) (&boost::detail::sp_typeid_<T>::v_) + +#else + +#include <typeinfo> + +namespace boost +{ + +namespace detail +{ + +#if defined( BOOST_NO_STD_TYPEINFO ) + +typedef ::type_info sp_typeinfo; + +#else + +typedef std::type_info sp_typeinfo; + +#endif + +} // namespace detail + +} // namespace boost + +#define BOOST_SP_TYPEID(T) typeid(T) + +#endif + +#endif // #ifndef BOOST_DETAIL_SP_TYPEINFO_HPP_INCLUDED diff --git a/3rdParty/Boost/boost/detail/utf8_codecvt_facet.hpp b/3rdParty/Boost/boost/detail/utf8_codecvt_facet.hpp new file mode 100644 index 0000000..ac7e7bf --- /dev/null +++ b/3rdParty/Boost/boost/detail/utf8_codecvt_facet.hpp @@ -0,0 +1,197 @@ +// Copyright (c) 2001 Ronald Garcia, Indiana University (garcia@osl.iu.edu) +// Andrew Lumsdaine, Indiana University (lums@osl.iu.edu). +// Distributed under the Boost Software License, Version 1.0. (See accompany- +// ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UTF8_CODECVT_FACET_HPP +#define BOOST_UTF8_CODECVT_FACET_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// utf8_codecvt_facet.hpp + +// This header defines class utf8_codecvt_facet, derived fro +// std::codecvt<wchar_t, char>, which can be used to convert utf8 data in +// files into wchar_t strings in the application. +// +// The header is NOT STANDALONE, and is not to be included by the USER. +// There are at least two libraries which want to use this functionality, and +// we want to avoid code duplication. It would be possible to create utf8 +// library, but: +// - this requires review process first +// - in the case, when linking the a library which uses utf8 +// (say 'program_options'), user should also link to the utf8 library. +// This seems inconvenient, and asking a user to link to an unrevieved +// library is strange. +// Until the above points are fixed, a library which wants to use utf8 must: +// - include this header from one of it's headers or sources +// - include the corresponding .cpp file from one of the sources +// - before including either file, the library must define +// - BOOST_UTF8_BEGIN_NAMESPACE to the namespace declaration that must be used +// - BOOST_UTF8_END_NAMESPACE to the code to close the previous namespace +// - declaration. +// - BOOST_UTF8_DECL -- to the code which must be used for all 'exportable' +// symbols. +// +// For example, program_options library might contain: +// #define BOOST_UTF8_BEGIN_NAMESPACE <backslash character> +// namespace boost { namespace program_options { +// #define BOOST_UTF8_END_NAMESPACE }} +// #define BOOST_UTF8_DECL BOOST_PROGRAM_OPTIONS_DECL +// #include "../../detail/utf8/utf8_codecvt.cpp" +// +// Essentially, each library will have its own copy of utf8 code, in +// different namespaces. + +// Note:(Robert Ramey). I have made the following alterations in the original +// code. +// a) Rendered utf8_codecvt<wchar_t, char> with using templates +// b) Move longer functions outside class definition to prevent inlining +// and make code smaller +// c) added on a derived class to permit translation to/from current +// locale to utf8 + +// See http://www.boost.org for updates, documentation, and revision history. + +// archives stored as text - note these ar templated on the basic +// stream templates to accommodate wide (and other?) kind of characters +// +// note the fact that on libraries without wide characters, ostream is +// is not a specialization of basic_ostream which in fact is not defined +// in such cases. So we can't use basic_ostream<OStream::char_type> but rather +// use two template parameters +// +// utf8_codecvt_facet +// This is an implementation of a std::codecvt facet for translating +// from UTF-8 externally to UCS-4. Note that this is not tied to +// any specific types in order to allow customization on platforms +// where wchar_t is not big enough. +// +// NOTES: The current implementation jumps through some unpleasant hoops in +// order to deal with signed character types. As a std::codecvt_base::result, +// it is necessary for the ExternType to be convertible to unsigned char. +// I chose not to tie the extern_type explicitly to char. But if any combination +// of types other than <wchar_t,char_t> is used, then std::codecvt must be +// specialized on those types for this to work. + +#include <locale> +// for mbstate_t +#include <wchar.h> +// for std::size_t +#include <cstddef> + +#include <boost/config.hpp> +#include <boost/detail/workaround.hpp> + +namespace std { + #if defined(__LIBCOMO__) + using ::mbstate_t; + #elif defined(BOOST_DINKUMWARE_STDLIB) && !defined(__BORLANDC__) + using ::mbstate_t; + #elif defined(__SGI_STL_PORT) + #elif defined(BOOST_NO_STDC_NAMESPACE) + using ::mbstate_t; + using ::codecvt; + #endif +} // namespace std + +#if !defined(__MSL_CPP__) && !defined(__LIBCOMO__) + #define BOOST_CODECVT_DO_LENGTH_CONST const +#else + #define BOOST_CODECVT_DO_LENGTH_CONST +#endif + +// maximum lenght of a multibyte string +#define MB_LENGTH_MAX 8 + +BOOST_UTF8_BEGIN_NAMESPACE + +struct BOOST_UTF8_DECL utf8_codecvt_facet : + public std::codecvt<wchar_t, char, std::mbstate_t> +{ +public: + explicit utf8_codecvt_facet(std::size_t no_locale_manage=0) + : std::codecvt<wchar_t, char, std::mbstate_t>(no_locale_manage) + {} +protected: + virtual std::codecvt_base::result do_in( + std::mbstate_t& state, + const char * from, + const char * from_end, + const char * & from_next, + wchar_t * to, + wchar_t * to_end, + wchar_t*& to_next + ) const; + + virtual std::codecvt_base::result do_out( + std::mbstate_t & state, const wchar_t * from, + const wchar_t * from_end, const wchar_t* & from_next, + char * to, char * to_end, char * & to_next + ) const; + + bool invalid_continuing_octet(unsigned char octet_1) const { + return (octet_1 < 0x80|| 0xbf< octet_1); + } + + bool invalid_leading_octet(unsigned char octet_1) const { + return (0x7f < octet_1 && octet_1 < 0xc0) || + (octet_1 > 0xfd); + } + + // continuing octets = octets except for the leading octet + static unsigned int get_cont_octet_count(unsigned char lead_octet) { + return get_octet_count(lead_octet) - 1; + } + + static unsigned int get_octet_count(unsigned char lead_octet); + + // How many "continuing octets" will be needed for this word + // == total octets - 1. + int get_cont_octet_out_count(wchar_t word) const ; + + virtual bool do_always_noconv() const throw() { return false; } + + // UTF-8 isn't really stateful since we rewind on partial conversions + virtual std::codecvt_base::result do_unshift( + std::mbstate_t&, + char * from, + char * /*to*/, + char * & next + ) const + { + next = from; + return ok; + } + + virtual int do_encoding() const throw() { + const int variable_byte_external_encoding=0; + return variable_byte_external_encoding; + } + + // How many char objects can I process to get <= max_limit + // wchar_t objects? + virtual int do_length( + BOOST_CODECVT_DO_LENGTH_CONST std::mbstate_t &, + const char * from, + const char * from_end, + std::size_t max_limit +#if BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600)) + ) const throw(); +#else + ) const; +#endif + + // Largest possible value do_length(state,from,from_end,1) could return. + virtual int do_max_length() const throw () { + return 6; // largest UTF-8 encoding of a UCS-4 character + } +}; + +BOOST_UTF8_END_NAMESPACE + +#endif // BOOST_UTF8_CODECVT_FACET_HPP diff --git a/3rdParty/Boost/boost/detail/workaround.hpp b/3rdParty/Boost/boost/detail/workaround.hpp new file mode 100644 index 0000000..b6b6412 --- /dev/null +++ b/3rdParty/Boost/boost/detail/workaround.hpp @@ -0,0 +1,262 @@ +// Copyright David Abrahams 2002. +// 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 WORKAROUND_DWA2002126_HPP +# define WORKAROUND_DWA2002126_HPP + +// Compiler/library version workaround macro +// +// Usage: +// +// #if BOOST_WORKAROUND(BOOST_MSVC, < 1300) +// // workaround for eVC4 and VC6 +// ... // workaround code here +// #endif +// +// When BOOST_STRICT_CONFIG is defined, expands to 0. Otherwise, the +// first argument must be undefined or expand to a numeric +// value. The above expands to: +// +// (BOOST_MSVC) != 0 && (BOOST_MSVC) < 1300 +// +// When used for workarounds that apply to the latest known version +// and all earlier versions of a compiler, the following convention +// should be observed: +// +// #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1301)) +// +// The version number in this case corresponds to the last version in +// which the workaround was known to have been required. When +// BOOST_DETECT_OUTDATED_WORKAROUNDS is not the defined, the macro +// BOOST_TESTED_AT(x) expands to "!= 0", which effectively activates +// the workaround for any version of the compiler. When +// BOOST_DETECT_OUTDATED_WORKAROUNDS is defined, a compiler warning or +// error will be issued if the compiler version exceeds the argument +// to BOOST_TESTED_AT(). This can be used to locate workarounds which +// may be obsoleted by newer versions. + +# ifndef BOOST_STRICT_CONFIG + +#include <boost/config.hpp> + +#ifndef __BORLANDC__ +#define __BORLANDC___WORKAROUND_GUARD 1 +#else +#define __BORLANDC___WORKAROUND_GUARD 0 +#endif +#ifndef __CODEGEARC__ +#define __CODEGEARC___WORKAROUND_GUARD 1 +#else +#define __CODEGEARC___WORKAROUND_GUARD 0 +#endif +#ifndef _MSC_VER +#define _MSC_VER_WORKAROUND_GUARD 1 +#else +#define _MSC_VER_WORKAROUND_GUARD 0 +#endif +#ifndef _MSC_FULL_VER +#define _MSC_FULL_VER_WORKAROUND_GUARD 1 +#else +#define _MSC_FULL_VER_WORKAROUND_GUARD 0 +#endif +#ifndef BOOST_MSVC +#define BOOST_MSVC_WORKAROUND_GUARD 1 +#else +#define BOOST_MSVC_WORKAROUND_GUARD 0 +#endif +#ifndef __GNUC__ +#define __GNUC___WORKAROUND_GUARD 1 +#else +#define __GNUC___WORKAROUND_GUARD 0 +#endif +#ifndef __GNUC_MINOR__ +#define __GNUC_MINOR___WORKAROUND_GUARD 1 +#else +#define __GNUC_MINOR___WORKAROUND_GUARD 0 +#endif +#ifndef __GNUC_PATCHLEVEL__ +#define __GNUC_PATCHLEVEL___WORKAROUND_GUARD 1 +#else +#define __GNUC_PATCHLEVEL___WORKAROUND_GUARD 0 +#endif +#ifndef __IBMCPP__ +#define __IBMCPP___WORKAROUND_GUARD 1 +#else +#define __IBMCPP___WORKAROUND_GUARD 0 +#endif +#ifndef __SUNPRO_CC +#define __SUNPRO_CC_WORKAROUND_GUARD 1 +#else +#define __SUNPRO_CC_WORKAROUND_GUARD 0 +#endif +#ifndef __DECCXX_VER +#define __DECCXX_VER_WORKAROUND_GUARD 1 +#else +#define __DECCXX_VER_WORKAROUND_GUARD 0 +#endif +#ifndef __MWERKS__ +#define __MWERKS___WORKAROUND_GUARD 1 +#else +#define __MWERKS___WORKAROUND_GUARD 0 +#endif +#ifndef __EDG__ +#define __EDG___WORKAROUND_GUARD 1 +#else +#define __EDG___WORKAROUND_GUARD 0 +#endif +#ifndef __EDG_VERSION__ +#define __EDG_VERSION___WORKAROUND_GUARD 1 +#else +#define __EDG_VERSION___WORKAROUND_GUARD 0 +#endif +#ifndef __HP_aCC +#define __HP_aCC_WORKAROUND_GUARD 1 +#else +#define __HP_aCC_WORKAROUND_GUARD 0 +#endif +#ifndef __hpxstd98 +#define __hpxstd98_WORKAROUND_GUARD 1 +#else +#define __hpxstd98_WORKAROUND_GUARD 0 +#endif +#ifndef _CRAYC +#define _CRAYC_WORKAROUND_GUARD 1 +#else +#define _CRAYC_WORKAROUND_GUARD 0 +#endif +#ifndef __DMC__ +#define __DMC___WORKAROUND_GUARD 1 +#else +#define __DMC___WORKAROUND_GUARD 0 +#endif +#ifndef MPW_CPLUS +#define MPW_CPLUS_WORKAROUND_GUARD 1 +#else +#define MPW_CPLUS_WORKAROUND_GUARD 0 +#endif +#ifndef __COMO__ +#define __COMO___WORKAROUND_GUARD 1 +#else +#define __COMO___WORKAROUND_GUARD 0 +#endif +#ifndef __COMO_VERSION__ +#define __COMO_VERSION___WORKAROUND_GUARD 1 +#else +#define __COMO_VERSION___WORKAROUND_GUARD 0 +#endif +#ifndef __INTEL_COMPILER +#define __INTEL_COMPILER_WORKAROUND_GUARD 1 +#else +#define __INTEL_COMPILER_WORKAROUND_GUARD 0 +#endif +#ifndef __ICL +#define __ICL_WORKAROUND_GUARD 1 +#else +#define __ICL_WORKAROUND_GUARD 0 +#endif +#ifndef _COMPILER_VERSION +#define _COMPILER_VERSION_WORKAROUND_GUARD 1 +#else +#define _COMPILER_VERSION_WORKAROUND_GUARD 0 +#endif + +#ifndef _RWSTD_VER +#define _RWSTD_VER_WORKAROUND_GUARD 1 +#else +#define _RWSTD_VER_WORKAROUND_GUARD 0 +#endif +#ifndef BOOST_RWSTD_VER +#define BOOST_RWSTD_VER_WORKAROUND_GUARD 1 +#else +#define BOOST_RWSTD_VER_WORKAROUND_GUARD 0 +#endif +#ifndef __GLIBCPP__ +#define __GLIBCPP___WORKAROUND_GUARD 1 +#else +#define __GLIBCPP___WORKAROUND_GUARD 0 +#endif +#ifndef _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC +#define _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC_WORKAROUND_GUARD 1 +#else +#define _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC_WORKAROUND_GUARD 0 +#endif +#ifndef __SGI_STL_PORT +#define __SGI_STL_PORT_WORKAROUND_GUARD 1 +#else +#define __SGI_STL_PORT_WORKAROUND_GUARD 0 +#endif +#ifndef _STLPORT_VERSION +#define _STLPORT_VERSION_WORKAROUND_GUARD 1 +#else +#define _STLPORT_VERSION_WORKAROUND_GUARD 0 +#endif +#ifndef __LIBCOMO_VERSION__ +#define __LIBCOMO_VERSION___WORKAROUND_GUARD 1 +#else +#define __LIBCOMO_VERSION___WORKAROUND_GUARD 0 +#endif +#ifndef _CPPLIB_VER +#define _CPPLIB_VER_WORKAROUND_GUARD 1 +#else +#define _CPPLIB_VER_WORKAROUND_GUARD 0 +#endif + +#ifndef BOOST_INTEL_CXX_VERSION +#define BOOST_INTEL_CXX_VERSION_WORKAROUND_GUARD 1 +#else +#define BOOST_INTEL_CXX_VERSION_WORKAROUND_GUARD 0 +#endif +#ifndef BOOST_INTEL_WIN +#define BOOST_INTEL_WIN_WORKAROUND_GUARD 1 +#else +#define BOOST_INTEL_WIN_WORKAROUND_GUARD 0 +#endif +#ifndef BOOST_DINKUMWARE_STDLIB +#define BOOST_DINKUMWARE_STDLIB_WORKAROUND_GUARD 1 +#else +#define BOOST_DINKUMWARE_STDLIB_WORKAROUND_GUARD 0 +#endif +#ifndef BOOST_INTEL +#define BOOST_INTEL_WORKAROUND_GUARD 1 +#else +#define BOOST_INTEL_WORKAROUND_GUARD 0 +#endif +// Always define to zero, if it's used it'll be defined my MPL: +#define BOOST_MPL_CFG_GCC_WORKAROUND_GUARD 0 + +# define BOOST_WORKAROUND(symbol, test) \ + ((symbol ## _WORKAROUND_GUARD + 0 == 0) && \ + (symbol != 0) && (1 % (( (symbol test) ) + 1))) +// ^ ^ ^ ^ +// The extra level of parenthesis nesting above, along with the +// BOOST_OPEN_PAREN indirection below, is required to satisfy the +// broken preprocessor in MWCW 8.3 and earlier. +// +// The basic mechanism works as follows: +// (symbol test) + 1 => if (symbol test) then 2 else 1 +// 1 % ((symbol test) + 1) => if (symbol test) then 1 else 0 +// +// The complication with % is for cooperation with BOOST_TESTED_AT(). +// When "test" is BOOST_TESTED_AT(x) and +// BOOST_DETECT_OUTDATED_WORKAROUNDS is #defined, +// +// symbol test => if (symbol <= x) then 1 else -1 +// (symbol test) + 1 => if (symbol <= x) then 2 else 0 +// 1 % ((symbol test) + 1) => if (symbol <= x) then 1 else divide-by-zero +// + +# ifdef BOOST_DETECT_OUTDATED_WORKAROUNDS +# define BOOST_OPEN_PAREN ( +# define BOOST_TESTED_AT(value) > value) ?(-1): BOOST_OPEN_PAREN 1 +# else +# define BOOST_TESTED_AT(value) != ((value)-(value)) +# endif + +# else + +# define BOOST_WORKAROUND(symbol, test) 0 + +# endif + +#endif // WORKAROUND_DWA2002126_HPP |