From 0aa0fe08dc308c94379c47d0bf9745e341cb4c81 Mon Sep 17 00:00:00 2001 From: Stefan Radomski Date: Fri, 13 Jan 2017 12:58:41 +0100 Subject: Updated boost headers --- contrib/local/bcp-boost.sh | 19 +- contrib/src/boost/algorithm/string/replace.hpp | 2 - contrib/src/boost/config/compiler/borland.hpp | 1 + contrib/src/boost/config/compiler/clang.hpp | 35 ++- contrib/src/boost/config/compiler/codegear.hpp | 1 + contrib/src/boost/config/compiler/comeau.hpp | 2 +- contrib/src/boost/config/compiler/common_edg.hpp | 1 + contrib/src/boost/config/compiler/compaq_cxx.hpp | 2 +- contrib/src/boost/config/compiler/cray.hpp | 3 +- contrib/src/boost/config/compiler/digitalmars.hpp | 1 + contrib/src/boost/config/compiler/gcc.hpp | 22 +- contrib/src/boost/config/compiler/gcc_xml.hpp | 3 +- contrib/src/boost/config/compiler/greenhills.hpp | 2 +- contrib/src/boost/config/compiler/hp_acc.hpp | 3 +- contrib/src/boost/config/compiler/intel.hpp | 21 +- contrib/src/boost/config/compiler/kai.hpp | 2 +- contrib/src/boost/config/compiler/metrowerks.hpp | 1 + contrib/src/boost/config/compiler/mpw.hpp | 1 + contrib/src/boost/config/compiler/nvcc.hpp | 16 ++ contrib/src/boost/config/compiler/pathscale.hpp | 1 + contrib/src/boost/config/compiler/pgi.hpp | 1 + contrib/src/boost/config/compiler/sgi_mipspro.hpp | 2 +- contrib/src/boost/config/compiler/sunpro_cc.hpp | 10 +- contrib/src/boost/config/compiler/vacpp.hpp | 1 + contrib/src/boost/config/compiler/visualc.hpp | 43 +-- contrib/src/boost/config/compiler/xlcpp.hpp | 4 + contrib/src/boost/config/platform/linux.hpp | 2 +- .../src/boost/config/select_compiler_config.hpp | 42 +-- contrib/src/boost/config/stdlib/dinkumware.hpp | 13 +- contrib/src/boost/config/stdlib/libcomo.hpp | 7 + contrib/src/boost/config/stdlib/libcpp.hpp | 47 +++- contrib/src/boost/config/stdlib/libstdcpp3.hpp | 37 ++- contrib/src/boost/config/stdlib/modena.hpp | 7 + contrib/src/boost/config/stdlib/msl.hpp | 7 + contrib/src/boost/config/stdlib/roguewave.hpp | 7 + contrib/src/boost/config/stdlib/sgi.hpp | 9 +- contrib/src/boost/config/stdlib/stlport.hpp | 7 + contrib/src/boost/config/stdlib/vacpp.hpp | 7 + contrib/src/boost/config/suffix.hpp | 16 +- contrib/src/boost/core/demangle.hpp | 5 +- contrib/src/boost/current_function.hpp | 6 +- contrib/src/boost/detail/iterator.hpp | 13 + .../src/boost/detail/winapi/GetCurrentProcess.hpp | 34 --- .../src/boost/detail/winapi/GetCurrentThread.hpp | 34 --- contrib/src/boost/detail/winapi/basic_types.hpp | 8 + contrib/src/boost/detail/winapi/config.hpp | 13 +- contrib/src/boost/detail/winapi/crypt.hpp | 4 +- .../boost/detail/winapi/get_current_process_id.hpp | 33 +++ .../boost/detail/winapi/get_current_thread_id.hpp | 34 +++ contrib/src/boost/detail/winapi/process.hpp | 34 --- contrib/src/boost/detail/winapi/thread.hpp | 46 ---- .../src/boost/dynamic_bitset/dynamic_bitset.hpp | 32 ++- contrib/src/boost/exception/exception.hpp | 28 +- contrib/src/boost/function/function_base.hpp | 258 ++++++++---------- contrib/src/boost/function/function_template.hpp | 115 ++++---- contrib/src/boost/move/algo/move.hpp | 155 +++++++++++ contrib/src/boost/move/algorithm.hpp | 117 +------- contrib/src/boost/move/core.hpp | 27 +- contrib/src/boost/move/detail/config_begin.hpp | 2 + contrib/src/boost/move/detail/iterator_traits.hpp | 4 + contrib/src/boost/move/detail/meta_utils.hpp | 39 ++- contrib/src/boost/move/detail/meta_utils_core.hpp | 12 + contrib/src/boost/move/detail/type_traits.hpp | 34 +-- contrib/src/boost/move/detail/workaround.hpp | 14 + contrib/src/boost/move/iterator.hpp | 65 +++-- contrib/src/boost/move/utility.hpp | 15 +- contrib/src/boost/move/utility_core.hpp | 33 +-- contrib/src/boost/predef/hardware/simd.h | 20 +- contrib/src/boost/predef/hardware/simd/x86.h | 6 +- contrib/src/boost/predef/hardware/simd/x86_amd.h | 8 +- .../boost/predef/hardware/simd/x86_amd/versions.h | 8 +- contrib/src/boost/predef/os/cygwin.h | 2 +- contrib/src/boost/predef/version.h | 4 +- contrib/src/boost/preprocessor/config/config.hpp | 2 +- contrib/src/boost/range/const_iterator.hpp | 8 +- contrib/src/boost/range/size_type.hpp | 5 - contrib/src/boost/smart_ptr/bad_weak_ptr.hpp | 9 + .../src/boost/smart_ptr/detail/sp_counted_base.hpp | 5 +- .../smart_ptr/detail/sp_counted_base_clang.hpp | 9 + contrib/src/boost/smart_ptr/detail/spinlock.hpp | 3 + contrib/src/boost/smart_ptr/shared_ptr.hpp | 21 +- contrib/src/boost/type_index.hpp | 265 ++++++++++++++++++ contrib/src/boost/type_index/ctti_type_index.hpp | 212 +++++++++++++++ .../type_index/detail/compile_time_type_info.hpp | 289 ++++++++++++++++++++ .../type_index/detail/ctti_register_class.hpp | 40 +++ .../boost/type_index/detail/stl_register_class.hpp | 40 +++ contrib/src/boost/type_index/stl_type_index.hpp | 272 +++++++++++++++++++ contrib/src/boost/type_index/type_index_facade.hpp | 300 +++++++++++++++++++++ contrib/src/boost/type_traits/add_reference.hpp | 6 +- contrib/src/boost/type_traits/has_trivial_copy.hpp | 1 + .../boost/type_traits/has_trivial_destructor.hpp | 2 +- contrib/src/boost/type_traits/is_abstract.hpp | 1 + contrib/src/boost/type_traits/is_array.hpp | 2 +- contrib/src/boost/type_traits/is_const.hpp | 3 +- .../boost/type_traits/is_default_constructible.hpp | 22 +- contrib/src/boost/type_traits/is_destructible.hpp | 1 + contrib/src/boost/type_traits/is_pod.hpp | 1 + contrib/src/boost/type_traits/is_volatile.hpp | 3 +- contrib/src/boost/type_traits/remove_const.hpp | 2 +- contrib/src/boost/type_traits/remove_cv.hpp | 2 +- contrib/src/boost/type_traits/remove_pointer.hpp | 2 +- .../src/boost/type_traits/type_with_alignment.hpp | 2 +- contrib/src/boost/utility/base_from_member.hpp | 13 +- contrib/src/boost/uuid/detail/uuid_x86.hpp | 10 +- contrib/src/boost/uuid/name_generator.hpp | 125 --------- contrib/src/boost/uuid/nil_generator.hpp | 34 --- contrib/src/boost/uuid/random_generator.hpp | 12 +- contrib/src/boost/uuid/seed_rng.hpp | 12 +- contrib/src/boost/uuid/string_generator.hpp | 185 ------------- contrib/src/boost/uuid/uuid_generators.hpp | 19 -- contrib/src/boost/uuid/uuid_io.hpp | 6 +- contrib/src/boost/version.hpp | 4 +- 112 files changed, 2527 insertions(+), 1093 deletions(-) delete mode 100644 contrib/src/boost/detail/winapi/GetCurrentProcess.hpp delete mode 100644 contrib/src/boost/detail/winapi/GetCurrentThread.hpp create mode 100644 contrib/src/boost/detail/winapi/get_current_process_id.hpp create mode 100644 contrib/src/boost/detail/winapi/get_current_thread_id.hpp delete mode 100644 contrib/src/boost/detail/winapi/process.hpp delete mode 100644 contrib/src/boost/detail/winapi/thread.hpp create mode 100644 contrib/src/boost/move/algo/move.hpp create mode 100644 contrib/src/boost/type_index.hpp create mode 100644 contrib/src/boost/type_index/ctti_type_index.hpp create mode 100644 contrib/src/boost/type_index/detail/compile_time_type_info.hpp create mode 100644 contrib/src/boost/type_index/detail/ctti_register_class.hpp create mode 100644 contrib/src/boost/type_index/detail/stl_register_class.hpp create mode 100644 contrib/src/boost/type_index/stl_type_index.hpp create mode 100644 contrib/src/boost/type_index/type_index_facade.hpp delete mode 100644 contrib/src/boost/uuid/name_generator.hpp delete mode 100644 contrib/src/boost/uuid/nil_generator.hpp delete mode 100644 contrib/src/boost/uuid/string_generator.hpp delete mode 100644 contrib/src/boost/uuid/uuid_generators.hpp diff --git a/contrib/local/bcp-boost.sh b/contrib/local/bcp-boost.sh index 0371214..0e2a1ca 100755 --- a/contrib/local/bcp-boost.sh +++ b/contrib/local/bcp-boost.sh @@ -4,13 +4,22 @@ ME=`basename $0` DIR="$( cd "$( dirname "$0" )" && pwd )" CWD=`pwd` -SOURCE_FILES=`find ${DIR}/../../src/ -name \*.h -print -o -name \*.cpp -print` +BOOST_DIR=$1 +if [ ! -d ${BOOST_DIR} ]; then + echo "First argument is supposed to be the path to the boost source code" + exit +fi + +cd $BOOST_DIR +./bootstrap.sh +./b2 tools/bcp -# echo ${ARABICA_FILES} -# exit +cd ${DIR} + +SOURCE_FILES=`find ${DIR}/../../src/ -name \*.h -print -o -name \*.cpp -print` -/Users/sradomski/Documents/TK/Code/boost_1_60_0/dist/bin/bcp \ ---boost=/Users/sradomski/Documents/TK/Code/boost_1_60_0 \ +${BOOST_DIR}/dist/bin/bcp \ +--boost=${BOOST_DIR} \ --scan ${SOURCE_FILES} \ ${DIR}/../src diff --git a/contrib/src/boost/algorithm/string/replace.hpp b/contrib/src/boost/algorithm/string/replace.hpp index 0c04e47..2adb031 100644 --- a/contrib/src/boost/algorithm/string/replace.hpp +++ b/contrib/src/boost/algorithm/string/replace.hpp @@ -401,7 +401,6 @@ namespace boost { \param Search A substring to be searched for \param Format A substitute string \param Loc A locale used for case insensitive comparison - \return A reference to the modified input */ template inline void ireplace_last( @@ -643,7 +642,6 @@ namespace boost { \param Input An input string \param Search A substring to be searched for \param Format A substitute string - \return A reference to the modified input */ template inline void replace_all( diff --git a/contrib/src/boost/config/compiler/borland.hpp b/contrib/src/boost/config/compiler/borland.hpp index 80dd230..ccd930e 100644 --- a/contrib/src/boost/config/compiler/borland.hpp +++ b/contrib/src/boost/config/compiler/borland.hpp @@ -196,6 +196,7 @@ #define BOOST_NO_CXX11_INLINE_NAMESPACES #define BOOST_NO_CXX11_REF_QUALIFIERS #define BOOST_NO_CXX11_FINAL +#define BOOST_NO_CXX11_THREAD_LOCAL // C++ 14: #if !defined(__cpp_aggregate_nsdmi) || (__cpp_aggregate_nsdmi < 201304) diff --git a/contrib/src/boost/config/compiler/clang.hpp b/contrib/src/boost/config/compiler/clang.hpp index 5481e5e..150e3c0 100644 --- a/contrib/src/boost/config/compiler/clang.hpp +++ b/contrib/src/boost/config/compiler/clang.hpp @@ -39,9 +39,20 @@ # define BOOST_NO_TYPEID #endif -#if defined(__int64) && !defined(__GNUC__) +#if !__has_feature(cxx_thread_local) +# define BOOST_NO_CXX11_THREAD_LOCAL +#endif + +#ifdef __is_identifier +#if !__is_identifier(__int64) && !defined(__GNUC__) # define BOOST_HAS_MS_INT64 #endif +#endif + +#if __has_include() +# define BOOST_HAS_STDINT_H +#endif + #define BOOST_HAS_NRVO @@ -57,16 +68,25 @@ #define BOOST_HAS_LONG_LONG // -// We disable this if the compiler is really nvcc as it -// doesn't actually support __int128 as of CUDA_VERSION=5000 +// We disable this if the compiler is really nvcc with C++03 as it +// doesn't actually support __int128 as of CUDA_VERSION=7500 // even though it defines __SIZEOF_INT128__. // See https://svn.boost.org/trac/boost/ticket/10418 +// https://svn.boost.org/trac/boost/ticket/11852 // Only re-enable this for nvcc if you're absolutely sure // of the circumstances under which it's supported. // Similarly __SIZEOF_INT128__ is defined when targetting msvc // compatibility even though the required support functions are absent. // -#if defined(__SIZEOF_INT128__) && !defined(__CUDACC__) && !defined(_MSC_VER) +#if defined(__CUDACC__) +# if defined(BOOST_GCC_CXX11) +# define BOOST_NVCC_CXX11 +# else +# define BOOST_NVCC_CXX03 +# endif +#endif + +#if defined(__SIZEOF_INT128__) && !defined(BOOST_NVCC_CXX03) && !defined(_MSC_VER) # define BOOST_HAS_INT128 #endif @@ -98,11 +118,16 @@ // // Currently clang on Windows using VC++ RTL does not support C++11's char16_t or char32_t // -#if defined(_MSC_VER) || !(defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L) +#if (defined(_MSC_VER) && (_MSC_VER < 1900)) || !(defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L) # define BOOST_NO_CXX11_CHAR16_T # define BOOST_NO_CXX11_CHAR32_T #endif +#if defined(_MSC_VER) && (_MSC_VER >= 1800) && !defined(__GNUC__) +#define BOOST_HAS_EXPM1 +#define BOOST_HAS_LOG1P +#endif + #if !__has_feature(cxx_constexpr) # define BOOST_NO_CXX11_CONSTEXPR #endif diff --git a/contrib/src/boost/config/compiler/codegear.hpp b/contrib/src/boost/config/compiler/codegear.hpp index 02bd792..e2f6061 100644 --- a/contrib/src/boost/config/compiler/codegear.hpp +++ b/contrib/src/boost/config/compiler/codegear.hpp @@ -122,6 +122,7 @@ #define BOOST_NO_CXX11_INLINE_NAMESPACES #define BOOST_NO_CXX11_REF_QUALIFIERS #define BOOST_NO_CXX11_FINAL +#define BOOST_NO_CXX11_THREAD_LOCAL // C++ 14: #if !defined(__cpp_aggregate_nsdmi) || (__cpp_aggregate_nsdmi < 201304) diff --git a/contrib/src/boost/config/compiler/comeau.hpp b/contrib/src/boost/config/compiler/comeau.hpp index 278222d..0984160 100644 --- a/contrib/src/boost/config/compiler/comeau.hpp +++ b/contrib/src/boost/config/compiler/comeau.hpp @@ -12,7 +12,7 @@ // Comeau C++ compiler setup: -#include "boost/config/compiler/common_edg.hpp" +#include #if (__COMO_VERSION__ <= 4245) diff --git a/contrib/src/boost/config/compiler/common_edg.hpp b/contrib/src/boost/config/compiler/common_edg.hpp index b92e574..c09faeb 100644 --- a/contrib/src/boost/config/compiler/common_edg.hpp +++ b/contrib/src/boost/config/compiler/common_edg.hpp @@ -106,6 +106,7 @@ #define BOOST_NO_CXX11_INLINE_NAMESPACES #define BOOST_NO_CXX11_REF_QUALIFIERS #define BOOST_NO_CXX11_FINAL +#define BOOST_NO_CXX11_THREAD_LOCAL // C++ 14: #if !defined(__cpp_aggregate_nsdmi) || (__cpp_aggregate_nsdmi < 201304) diff --git a/contrib/src/boost/config/compiler/compaq_cxx.hpp b/contrib/src/boost/config/compiler/compaq_cxx.hpp index b44486c..4d6b8ab 100644 --- a/contrib/src/boost/config/compiler/compaq_cxx.hpp +++ b/contrib/src/boost/config/compiler/compaq_cxx.hpp @@ -9,7 +9,7 @@ #define BOOST_COMPILER "HP Tru64 C++ " BOOST_STRINGIZE(__DECCXX_VER) -#include "boost/config/compiler/common_edg.hpp" +#include // // versions check: diff --git a/contrib/src/boost/config/compiler/cray.hpp b/contrib/src/boost/config/compiler/cray.hpp index 3f66043..837f815 100644 --- a/contrib/src/boost/config/compiler/cray.hpp +++ b/contrib/src/boost/config/compiler/cray.hpp @@ -21,7 +21,7 @@ # error "Unsupported Cray compiler, please try running the configure script." #endif -#include "boost/config/compiler/common_edg.hpp" +#include // @@ -60,6 +60,7 @@ #define BOOST_NO_CXX11_CHAR16_T #define BOOST_NO_CXX11_REF_QUALIFIERS #define BOOST_NO_CXX11_FINAL +#define BOOST_NO_CXX11_THREAD_LOCAL //#define BOOST_BCB_PARTIAL_SPECIALIZATION_BUG diff --git a/contrib/src/boost/config/compiler/digitalmars.hpp b/contrib/src/boost/config/compiler/digitalmars.hpp index a3d293c..c344aae 100644 --- a/contrib/src/boost/config/compiler/digitalmars.hpp +++ b/contrib/src/boost/config/compiler/digitalmars.hpp @@ -82,6 +82,7 @@ #define BOOST_NO_CXX11_INLINE_NAMESPACES #define BOOST_NO_CXX11_REF_QUALIFIERS #define BOOST_NO_CXX11_FINAL +#define BOOST_NO_CXX11_THREAD_LOCAL // C++ 14: #if !defined(__cpp_aggregate_nsdmi) || (__cpp_aggregate_nsdmi < 201304) diff --git a/contrib/src/boost/config/compiler/gcc.hpp b/contrib/src/boost/config/compiler/gcc.hpp index d9dd59d..e319d04 100644 --- a/contrib/src/boost/config/compiler/gcc.hpp +++ b/contrib/src/boost/config/compiler/gcc.hpp @@ -133,14 +133,23 @@ // // Recent GCC versions have __int128 when in 64-bit mode. // -// We disable this if the compiler is really nvcc as it -// doesn't actually support __int128 as of CUDA_VERSION=5000 +// We disable this if the compiler is really nvcc with C++03 as it +// doesn't actually support __int128 as of CUDA_VERSION=7500 // even though it defines __SIZEOF_INT128__. // See https://svn.boost.org/trac/boost/ticket/8048 +// https://svn.boost.org/trac/boost/ticket/11852 // Only re-enable this for nvcc if you're absolutely sure // of the circumstances under which it's supported: // -#if defined(__SIZEOF_INT128__) && !defined(__CUDACC__) +#if defined(__CUDACC__) +# if defined(BOOST_GCC_CXX11) +# define BOOST_NVCC_CXX11 +# else +# define BOOST_NVCC_CXX03 +# endif +#endif + +#if defined(__SIZEOF_INT128__) && !defined(BOOST_NVCC_CXX03) # define BOOST_HAS_INT128 #endif // @@ -148,12 +157,16 @@ // include a std lib header to detect this - not ideal, but we'll // be including later anyway when we select the std lib. // +// Nevertheless, as of CUDA 7.5, using __float128 with the host +// compiler in pre-C++11 mode is still not supported. +// See https://svn.boost.org/trac/boost/ticket/11852 +// #ifdef __cplusplus #include #else #include #endif -#if defined(_GLIBCXX_USE_FLOAT128) && !defined(__STRICT_ANSI__) +#if defined(_GLIBCXX_USE_FLOAT128) && !defined(__STRICT_ANSI__) && !defined(BOOST_NVCC_CXX03) # define BOOST_HAS_FLOAT128 #endif @@ -239,6 +252,7 @@ // #if (BOOST_GCC_VERSION < 40800) || !defined(BOOST_GCC_CXX11) # define BOOST_NO_CXX11_ALIGNAS +# define BOOST_NO_CXX11_THREAD_LOCAL #endif // C++0x features in 4.8.1 and later diff --git a/contrib/src/boost/config/compiler/gcc_xml.hpp b/contrib/src/boost/config/compiler/gcc_xml.hpp index c11f29d..b56c786 100644 --- a/contrib/src/boost/config/compiler/gcc_xml.hpp +++ b/contrib/src/boost/config/compiler/gcc_xml.hpp @@ -59,7 +59,8 @@ # define BOOST_NO_CXX11_TRAILING_RESULT_TYPES # define BOOST_NO_CXX11_INLINE_NAMESPACES # define BOOST_NO_CXX11_REF_QUALIFIERS -#define BOOST_NO_CXX11_FINAL +# define BOOST_NO_CXX11_FINAL +# define BOOST_NO_CXX11_THREAD_LOCAL // C++ 14: #if !defined(__cpp_aggregate_nsdmi) || (__cpp_aggregate_nsdmi < 201304) diff --git a/contrib/src/boost/config/compiler/greenhills.hpp b/contrib/src/boost/config/compiler/greenhills.hpp index 038b6b2..a76a07c 100644 --- a/contrib/src/boost/config/compiler/greenhills.hpp +++ b/contrib/src/boost/config/compiler/greenhills.hpp @@ -9,7 +9,7 @@ #define BOOST_COMPILER "Greenhills C++ version " BOOST_STRINGIZE(__ghs) -#include "boost/config/compiler/common_edg.hpp" +#include // // versions check: diff --git a/contrib/src/boost/config/compiler/hp_acc.hpp b/contrib/src/boost/config/compiler/hp_acc.hpp index fb63839..a773b8c 100644 --- a/contrib/src/boost/config/compiler/hp_acc.hpp +++ b/contrib/src/boost/config/compiler/hp_acc.hpp @@ -13,7 +13,7 @@ // HP aCC C++ compiler setup: #if defined(__EDG__) -#include "boost/config/compiler/common_edg.hpp" +#include #endif #if (__HP_aCC <= 33100) @@ -123,6 +123,7 @@ #define BOOST_NO_CXX11_TRAILING_RESULT_TYPES #define BOOST_NO_CXX11_INLINE_NAMESPACES #define BOOST_NO_CXX11_REF_QUALIFIERS +#define BOOST_NO_CXX11_THREAD_LOCAL /* See https://forums13.itrc.hp.com/service/forums/questionanswer.do?threadId=1443331 and diff --git a/contrib/src/boost/config/compiler/intel.hpp b/contrib/src/boost/config/compiler/intel.hpp index 7789b94..1885ea2 100644 --- a/contrib/src/boost/config/compiler/intel.hpp +++ b/contrib/src/boost/config/compiler/intel.hpp @@ -35,6 +35,10 @@ #endif +#if (__INTEL_COMPILER <= 1600) && !defined(BOOST_NO_CXX14_VARIABLE_TEMPLATES) +# define BOOST_NO_CXX14_VARIABLE_TEMPLATES +#endif + #else #include @@ -90,7 +94,7 @@ #else -#include "boost/config/compiler/common_edg.hpp" +#include #if defined(__INTEL_COMPILER) #if __INTEL_COMPILER == 9999 @@ -496,6 +500,11 @@ template<> struct assert_intrinsic_wchar_t {}; # define BOOST_NO_CXX11_HDR_TUPLE #endif +// Broken in all versions up to 17: +#if !defined(BOOST_NO_CXX14_CONSTEXPR) +#define BOOST_NO_CXX14_CONSTEXPR +#endif + #if (BOOST_INTEL_CXX_VERSION < 1200) // // fenv.h appears not to work with Intel prior to 12.0: @@ -514,7 +523,15 @@ template<> struct assert_intrinsic_wchar_t {}; # define BOOST_HAS_STDINT_H #endif -#if defined(__LP64__) && defined(__GNUC__) && (BOOST_INTEL_CXX_VERSION >= 1310) && !defined(__CUDACC__) +#if defined(__CUDACC__) +# if defined(BOOST_GCC_CXX11) +# define BOOST_NVCC_CXX11 +# else +# define BOOST_NVCC_CXX03 +# endif +#endif + +#if defined(__LP64__) && defined(__GNUC__) && (BOOST_INTEL_CXX_VERSION >= 1310) && !defined(BOOST_NVCC_CXX03) # define BOOST_HAS_INT128 #endif diff --git a/contrib/src/boost/config/compiler/kai.hpp b/contrib/src/boost/config/compiler/kai.hpp index 2337e6a..960d501 100644 --- a/contrib/src/boost/config/compiler/kai.hpp +++ b/contrib/src/boost/config/compiler/kai.hpp @@ -9,7 +9,7 @@ // Kai C++ compiler setup: -#include "boost/config/compiler/common_edg.hpp" +#include # if (__KCC_VERSION <= 4001) || !defined(BOOST_STRICT_CONFIG) // at least on Sun, the contents of is not in namespace std diff --git a/contrib/src/boost/config/compiler/metrowerks.hpp b/contrib/src/boost/config/compiler/metrowerks.hpp index c930143..3c5e228 100644 --- a/contrib/src/boost/config/compiler/metrowerks.hpp +++ b/contrib/src/boost/config/compiler/metrowerks.hpp @@ -125,6 +125,7 @@ #define BOOST_NO_CXX11_INLINE_NAMESPACES #define BOOST_NO_CXX11_REF_QUALIFIERS #define BOOST_NO_CXX11_FINAL +#define BOOST_NO_CXX11_THREAD_LOCAL // C++ 14: #if !defined(__cpp_aggregate_nsdmi) || (__cpp_aggregate_nsdmi < 201304) diff --git a/contrib/src/boost/config/compiler/mpw.hpp b/contrib/src/boost/config/compiler/mpw.hpp index 76045bc..084f9e1 100644 --- a/contrib/src/boost/config/compiler/mpw.hpp +++ b/contrib/src/boost/config/compiler/mpw.hpp @@ -74,6 +74,7 @@ #define BOOST_NO_CXX11_INLINE_NAMESPACES #define BOOST_NO_CXX11_REF_QUALIFIERS #define BOOST_NO_CXX11_FINAL +#define BOOST_NO_CXX11_THREAD_LOCAL // C++ 14: #if !defined(__cpp_aggregate_nsdmi) || (__cpp_aggregate_nsdmi < 201304) diff --git a/contrib/src/boost/config/compiler/nvcc.hpp b/contrib/src/boost/config/compiler/nvcc.hpp index bbe81f6..b31d4f4 100644 --- a/contrib/src/boost/config/compiler/nvcc.hpp +++ b/contrib/src/boost/config/compiler/nvcc.hpp @@ -14,3 +14,19 @@ // NVIDIA Specific support // BOOST_GPU_ENABLED : Flag a function or a method as being enabled on the host and device #define BOOST_GPU_ENABLED __host__ __device__ + +// A bug in version 7.0 of CUDA prevents use of variadic templates in some occasions +// https://svn.boost.org/trac/boost/ticket/11897 +// This is fixed in 7.5. As the following version macro was introduced in 7.5 an existance +// check is enough to detect versions < 7.5 +#if !defined(__CUDACC_VER__) || (__CUDACC_VER__ < 70500) +# define BOOST_NO_CXX11_VARIADIC_TEMPLATES +#endif +// The same bug is back again in 8.0: +#if (__CUDACC_VER__ > 80000) && (__CUDACC_VER__ < 80100) +# define BOOST_NO_CXX11_VARIADIC_TEMPLATES +#endif +// Most recent CUDA (8.0) has no constexpr support in msvc mode: +#if defined(_MSC_VER) +# define BOOST_NO_CXX11_CONSTEXPR +#endif diff --git a/contrib/src/boost/config/compiler/pathscale.hpp b/contrib/src/boost/config/compiler/pathscale.hpp index 7c211c4..a5e65af 100644 --- a/contrib/src/boost/config/compiler/pathscale.hpp +++ b/contrib/src/boost/config/compiler/pathscale.hpp @@ -82,6 +82,7 @@ # define BOOST_NO_CXX11_INLINE_NAMESPACES # define BOOST_NO_CXX11_REF_QUALIFIERS # define BOOST_NO_CXX11_FINAL +# define BOOST_NO_CXX11_THREAD_LOCAL // C++ 14: #if !defined(__cpp_aggregate_nsdmi) || (__cpp_aggregate_nsdmi < 201304) diff --git a/contrib/src/boost/config/compiler/pgi.hpp b/contrib/src/boost/config/compiler/pgi.hpp index e5605c9..fa2d5e4 100644 --- a/contrib/src/boost/config/compiler/pgi.hpp +++ b/contrib/src/boost/config/compiler/pgi.hpp @@ -120,6 +120,7 @@ #define BOOST_NO_CXX11_INLINE_NAMESPACES #define BOOST_NO_CXX11_REF_QUALIFIERS #define BOOST_NO_CXX11_FINAL +#define BOOST_NO_CXX11_THREAD_LOCAL // C++ 14: #if !defined(__cpp_aggregate_nsdmi) || (__cpp_aggregate_nsdmi < 201304) diff --git a/contrib/src/boost/config/compiler/sgi_mipspro.hpp b/contrib/src/boost/config/compiler/sgi_mipspro.hpp index 9068831..54433c9 100644 --- a/contrib/src/boost/config/compiler/sgi_mipspro.hpp +++ b/contrib/src/boost/config/compiler/sgi_mipspro.hpp @@ -9,7 +9,7 @@ #define BOOST_COMPILER "SGI Irix compiler version " BOOST_STRINGIZE(_COMPILER_VERSION) -#include "boost/config/compiler/common_edg.hpp" +#include // // Threading support: diff --git a/contrib/src/boost/config/compiler/sunpro_cc.hpp b/contrib/src/boost/config/compiler/sunpro_cc.hpp index 6017660..ac259fc 100644 --- a/contrib/src/boost/config/compiler/sunpro_cc.hpp +++ b/contrib/src/boost/config/compiler/sunpro_cc.hpp @@ -132,6 +132,7 @@ #define BOOST_NO_CXX11_DECLTYPE_N3276 #define BOOST_NO_CXX11_USER_DEFINED_LITERALS #define BOOST_NO_CXX11_REF_QUALIFIERS +#define BOOST_NO_CXX11_THREAD_LOCAL #endif #define BOOST_NO_COMPLETE_VALUE_INITIALIZATION @@ -151,7 +152,7 @@ #if !defined(__cpp_constexpr) || (__cpp_constexpr < 201304) # define BOOST_NO_CXX14_CONSTEXPR #endif -#if !defined(__cpp_decltype_auto) || (__cpp_decltype_auto < 201304) +#if !defined(__cpp_decltype_auto) || (__cpp_decltype_auto < 201304) || (__cplusplus < 201402L) # define BOOST_NO_CXX14_DECLTYPE_AUTO #endif #if (__cplusplus < 201304) // There's no SD6 check for this.... @@ -169,6 +170,13 @@ #if !defined(__cpp_variable_templates) || (__cpp_variable_templates < 201304) # define BOOST_NO_CXX14_VARIABLE_TEMPLATES #endif + +// Turn on threading support for Solaris 12. +// Ticket #11972 +#if (__SUNPRO_CC >= 0x5140) && defined(__SunOS_5_12) && !defined(BOOST_HAS_THREADS) +# define BOOST_HAS_THREADS +#endif + // // Version // diff --git a/contrib/src/boost/config/compiler/vacpp.hpp b/contrib/src/boost/config/compiler/vacpp.hpp index 6c228ea..3fbed9f 100644 --- a/contrib/src/boost/config/compiler/vacpp.hpp +++ b/contrib/src/boost/config/compiler/vacpp.hpp @@ -131,6 +131,7 @@ #define BOOST_NO_CXX11_INLINE_NAMESPACES #define BOOST_NO_CXX11_REF_QUALIFIERS #define BOOST_NO_CXX11_FINAL +#define BOOST_NO_CXX11_THREAD_LOCAL // C++ 14: #if !defined(__cpp_aggregate_nsdmi) || (__cpp_aggregate_nsdmi < 201304) diff --git a/contrib/src/boost/config/compiler/visualc.hpp b/contrib/src/boost/config/compiler/visualc.hpp index baaab58..cdbc9b6 100644 --- a/contrib/src/boost/config/compiler/visualc.hpp +++ b/contrib/src/boost/config/compiler/visualc.hpp @@ -158,6 +158,11 @@ # define BOOST_NO_CXX11_DECLTYPE_N3276 #endif +#if _MSC_FULL_VER >= 180020827 +#define BOOST_HAS_EXPM1 +#define BOOST_HAS_LOG1P +#endif + // C++11 features supported by VC++ 14 (aka 2015) // #if (_MSC_FULL_VER < 190023026) @@ -175,6 +180,21 @@ # define BOOST_NO_CXX14_BINARY_LITERALS # define BOOST_NO_CXX14_GENERIC_LAMBDAS # define BOOST_NO_CXX14_DIGIT_SEPARATORS +# define BOOST_NO_CXX11_THREAD_LOCAL +#endif +// C++11 features supported by VC++ 14 update 3 (aka 2015) +// +#if (_MSC_FULL_VER < 190024210) +# define BOOST_NO_CXX14_VARIABLE_TEMPLATES +# define BOOST_NO_SFINAE_EXPR +# define BOOST_NO_CXX11_CONSTEXPR +#endif + +// C++14 features supported by VC++ 15 Preview 5 +// +#if (_MSC_VER < 1910) +# define BOOST_NO_CXX14_AGGREGATE_NSDMI +# define BOOST_NO_CXX14_CONSTEXPR #endif // MSVC including version 14 has not yet completely @@ -193,25 +213,10 @@ // See also: http://www.boost.org/libs/utility/value_init.htm#compiler_issues // (Niels Dekker, LKEB, May 2010) #define BOOST_NO_COMPLETE_VALUE_INITIALIZATION -// C++11 features not supported by any versions -#define BOOST_NO_SFINAE_EXPR -#define BOOST_NO_TWO_PHASE_NAME_LOOKUP // -// This is somewhat supported in VC14, but we may need to wait for -// a service release before enabling: +// C++ 11: // -#define BOOST_NO_CXX11_CONSTEXPR - -// C++ 14: -#if !defined(__cpp_aggregate_nsdmi) || (__cpp_aggregate_nsdmi < 201304) -# define BOOST_NO_CXX14_AGGREGATE_NSDMI -#endif -#if !defined(__cpp_constexpr) || (__cpp_constexpr < 201304) -# define BOOST_NO_CXX14_CONSTEXPR -#endif -#if !defined(__cpp_variable_templates) || (__cpp_variable_templates < 201304) -# define BOOST_NO_CXX14_VARIABLE_TEMPLATES -#endif +#define BOOST_NO_TWO_PHASE_NAME_LOOKUP // // prefix and suffix headers: @@ -288,8 +293,8 @@ #endif // -// last known and checked version is 19.00.23026 (VC++ 2015 RTM): -#if (_MSC_VER > 1900) +// last known and checked version is 19.10.24629 (VC++ 2017 RC): +#if (_MSC_VER > 1910) # if defined(BOOST_ASSERT_CONFIG) # error "Unknown compiler version - please run the configure tests and report the results" # else diff --git a/contrib/src/boost/config/compiler/xlcpp.hpp b/contrib/src/boost/config/compiler/xlcpp.hpp index e369ece..2aaafc3 100644 --- a/contrib/src/boost/config/compiler/xlcpp.hpp +++ b/contrib/src/boost/config/compiler/xlcpp.hpp @@ -238,6 +238,10 @@ # define BOOST_NO_CXX14_VARIABLE_TEMPLATES #endif +#if !__has_feature(cxx_thread_local) +# define BOOST_NO_CXX11_THREAD_LOCAL +#endif + #if __cplusplus < 201400 // All versions with __cplusplus above this value seem to support this: # define BOOST_NO_CXX14_DIGIT_SEPARATORS diff --git a/contrib/src/boost/config/platform/linux.hpp b/contrib/src/boost/config/platform/linux.hpp index 6fa5f45..8c43c7b 100644 --- a/contrib/src/boost/config/platform/linux.hpp +++ b/contrib/src/boost/config/platform/linux.hpp @@ -72,7 +72,7 @@ // boilerplate code: #define BOOST_HAS_UNISTD_H #include -#ifdef __USE_GNU +#if defined(__USE_GNU) && !defined(__ANDROID__) && !defined(ANDROID) #define BOOST_HAS_PTHREAD_YIELD #endif diff --git a/contrib/src/boost/config/select_compiler_config.hpp b/contrib/src/boost/config/select_compiler_config.hpp index 4d87093..7a75708 100644 --- a/contrib/src/boost/config/select_compiler_config.hpp +++ b/contrib/src/boost/config/select_compiler_config.hpp @@ -122,27 +122,27 @@ // // This section allows dependency scanners to find all the headers we *might* include: // -#include "boost/config/compiler/gcc_xml.hpp" -#include "boost/config/compiler/cray.hpp" -#include "boost/config/compiler/comeau.hpp" -#include "boost/config/compiler/pathscale.hpp" -#include "boost/config/compiler/intel.hpp" -#include "boost/config/compiler/clang.hpp" -#include "boost/config/compiler/digitalmars.hpp" -#include "boost/config/compiler/gcc.hpp" -#include "boost/config/compiler/kai.hpp" -#include "boost/config/compiler/sgi_mipspro.hpp" -#include "boost/config/compiler/compaq_cxx.hpp" -#include "boost/config/compiler/greenhills.hpp" -#include "boost/config/compiler/codegear.hpp" -#include "boost/config/compiler/borland.hpp" -#include "boost/config/compiler/metrowerks.hpp" -#include "boost/config/compiler/sunpro_cc.hpp" -#include "boost/config/compiler/hp_acc.hpp" -#include "boost/config/compiler/mpw.hpp" -#include "boost/config/compiler/vacpp.hpp" -#include "boost/config/compiler/pgi.hpp" -#include "boost/config/compiler/visualc.hpp" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #endif diff --git a/contrib/src/boost/config/stdlib/dinkumware.hpp b/contrib/src/boost/config/stdlib/dinkumware.hpp index af8ddda..8cf5d4d 100644 --- a/contrib/src/boost/config/stdlib/dinkumware.hpp +++ b/contrib/src/boost/config/stdlib/dinkumware.hpp @@ -150,13 +150,24 @@ #if defined(__has_include) #if !__has_include() # define BOOST_NO_CXX14_HDR_SHARED_MUTEX -#elif __cplusplus < 201402 +#elif (__cplusplus < 201402) && !defined(_MSC_VER) # define BOOST_NO_CXX14_HDR_SHARED_MUTEX #endif #elif !defined(_CPPLIB_VER) || (_CPPLIB_VER < 650) # define BOOST_NO_CXX14_HDR_SHARED_MUTEX #endif +// C++14 features +#if !defined(_CPPLIB_VER) || (_CPPLIB_VER < 650) +# define BOOST_NO_CXX14_STD_EXCHANGE +#endif + +// C++17 features +# define BOOST_NO_CXX17_STD_APPLY +#if !defined(_CPPLIB_VER) || (_CPPLIB_VER < 650) +# define BOOST_NO_CXX17_STD_INVOKE +#endif + #if defined(BOOST_INTEL) && (BOOST_INTEL <= 1400) // Intel's compiler can't handle this header yet: # define BOOST_NO_CXX11_HDR_ATOMIC diff --git a/contrib/src/boost/config/stdlib/libcomo.hpp b/contrib/src/boost/config/stdlib/libcomo.hpp index 941498d..e3fc627 100644 --- a/contrib/src/boost/config/stdlib/libcomo.hpp +++ b/contrib/src/boost/config/stdlib/libcomo.hpp @@ -72,6 +72,13 @@ # define BOOST_NO_CXX14_HDR_SHARED_MUTEX #endif +// C++14 features +# define BOOST_NO_CXX14_STD_EXCHANGE + +// C++17 features +# define BOOST_NO_CXX17_STD_APPLY +# define BOOST_NO_CXX17_STD_INVOKE + // // Intrinsic type_traits support. // The SGI STL has it's own __type_traits class, which diff --git a/contrib/src/boost/config/stdlib/libcpp.hpp b/contrib/src/boost/config/stdlib/libcpp.hpp index ab5d123..2eea999 100644 --- a/contrib/src/boost/config/stdlib/libcpp.hpp +++ b/contrib/src/boost/config/stdlib/libcpp.hpp @@ -32,10 +32,14 @@ #endif #if __cplusplus < 201103 -# define BOOST_NO_CXX11_HDR_ARRAY +// +// These two appear to be somewhat useable in C++03 mode, there may be others... +// +//# define BOOST_NO_CXX11_HDR_ARRAY +//# define BOOST_NO_CXX11_HDR_FORWARD_LIST + # define BOOST_NO_CXX11_HDR_CODECVT # define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE -# define BOOST_NO_CXX11_HDR_FORWARD_LIST # define BOOST_NO_CXX11_HDR_INITIALIZER_LIST # define BOOST_NO_CXX11_HDR_MUTEX # define BOOST_NO_CXX11_HDR_RANDOM @@ -53,19 +57,48 @@ # define BOOST_NO_CXX11_HDR_FUNCTIONAL # define BOOST_NO_CXX11_STD_ALIGN # define BOOST_NO_CXX11_ADDRESSOF -#endif - +# define BOOST_NO_CXX11_HDR_ATOMIC +# define BOOST_NO_CXX11_ATOMIC_SMART_PTR +# define BOOST_NO_CXX11_HDR_CHRONO +# define BOOST_NO_CXX11_HDR_TYPE_TRAITS +# define BOOST_NO_CXX11_HDR_FUTURE +#elif _LIBCPP_VERSION < 3700 // // These appear to be unusable/incomplete so far: // +# define BOOST_NO_CXX11_HDR_ATOMIC +# define BOOST_NO_CXX11_ATOMIC_SMART_PTR # define BOOST_NO_CXX11_HDR_CHRONO -# define BOOST_NO_CXX11_HDR_FUTURE # define BOOST_NO_CXX11_HDR_TYPE_TRAITS -# define BOOST_NO_CXX11_ATOMIC_SMART_PTR -# define BOOST_NO_CXX11_HDR_ATOMIC +# define BOOST_NO_CXX11_HDR_FUTURE +#endif + +#if _LIBCPP_VERSION < 3700 // libc++ uses a non-standard messages_base #define BOOST_NO_STD_MESSAGES +#endif + +// C++14 features +#if (_LIBCPP_VERSION < 3700) || (__cplusplus <= 201402L) +# define BOOST_NO_CXX14_STD_EXCHANGE +#endif + +// C++17 features +#if (_LIBCPP_VERSION < 3700) || (__cplusplus <= 201402L) +# define BOOST_NO_CXX17_STD_INVOKE +#endif +#if (_LIBCPP_VERSION < 4000) || (__cplusplus <= 201402L) +# define BOOST_NO_CXX17_STD_APPLY +#endif + +#if (_LIBCPP_VERSION <= 1101) && !defined(BOOST_NO_CXX11_THREAD_LOCAL) +// This is a bit of a sledgehammer, because really it's just libc++abi that has no +// support for thread_local, leading to linker errors such as +// "undefined reference to `__cxa_thread_atexit'". It is fixed in the +// most recent releases of libc++abi though... +# define BOOST_NO_CXX11_THREAD_LOCAL +#endif #if defined(__has_include) #if !__has_include() diff --git a/contrib/src/boost/config/stdlib/libstdcpp3.hpp b/contrib/src/boost/config/stdlib/libstdcpp3.hpp index 9718bed..557767b 100644 --- a/contrib/src/boost/config/stdlib/libstdcpp3.hpp +++ b/contrib/src/boost/config/stdlib/libstdcpp3.hpp @@ -98,6 +98,7 @@ #if defined(__GXX_EXPERIMENTAL_CXX0X__) || (__cplusplus >= 201103) # define BOOST_LIBSTDCXX11 #endif + // // Decide which version of libstdc++ we have, normally // stdlibc++ C++0x support is detected via __GNUC__, __GNUC_MINOR__, and possibly @@ -122,7 +123,9 @@ // #ifdef __clang__ -#if __has_include() +#if __has_include() +# define BOOST_LIBSTDCXX_VERSION 60100 +#elif __has_include() # define BOOST_LIBSTDCXX_VERSION 50100 #elif __has_include() # define BOOST_LIBSTDCXX_VERSION 40900 @@ -139,6 +142,7 @@ #elif __has_include() # define BOOST_LIBSTDCXX_VERSION 40300 #endif + // // GCC 4.8 and 9 add working versions of and respectively. // However, we have no test for these as the headers were present but broken @@ -151,13 +155,29 @@ // Oracle Solaris compiler uses it's own verison of libstdc++ but doesn't // set __GNUC__ // +#if __SUNPRO_CC >= 0x5140 +#define BOOST_LIBSTDCXX_VERSION 50100 +#else #define BOOST_LIBSTDCXX_VERSION 40800 #endif +#endif #if !defined(BOOST_LIBSTDCXX_VERSION) # define BOOST_LIBSTDCXX_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) #endif +// std::auto_ptr isn't provided with _GLIBCXX_DEPRECATED=0 (GCC 4.5 and earlier) +// or _GLIBCXX_USE_DEPRECATED=0 (GCC 4.6 and later). +#if defined(BOOST_LIBSTDCXX11) +# if BOOST_LIBSTDCXX_VERSION < 40600 +# if !_GLIBCXX_DEPRECATED +# define BOOST_NO_AUTO_PTR +# endif +# elif !_GLIBCXX_USE_DEPRECATED +# define BOOST_NO_AUTO_PTR +# endif +#endif + // C++0x headers in GCC 4.3.0 and later // #if (BOOST_LIBSTDCXX_VERSION < 40300) || !defined(BOOST_LIBSTDCXX11) @@ -220,6 +240,9 @@ // even for the simplest patterns such as "\d" or "[0-9]". This is the case at least in gcc up to 4.8, inclusively. # define BOOST_NO_CXX11_HDR_REGEX #endif +#if (BOOST_LIBSTDCXX_VERSION < 40900) || (__cplusplus <= 201103) +# define BOOST_NO_CXX14_STD_EXCHANGE +#endif #if defined(__clang_major__) && ((__clang_major__ < 3) || ((__clang_major__ == 3) && (__clang_minor__ < 7))) // As of clang-3.6, libstdc++ header throws up errors with clang: @@ -235,6 +258,16 @@ # define BOOST_NO_CXX11_STD_ALIGN #endif +// +// C++17 features in GCC 6.1 and later +// +#if (BOOST_LIBSTDCXX_VERSION < 60100) || (__cplusplus <= 201402L) +# define BOOST_NO_CXX17_STD_INVOKE +#endif +#if (BOOST_LIBSTDCXX_VERSION < 70100) || (__cplusplus <= 201402L) +# define BOOST_NO_CXX17_STD_APPLY +#endif + #if defined(__has_include) #if !__has_include() # define BOOST_NO_CXX14_HDR_SHARED_MUTEX @@ -247,7 +280,7 @@ // // Headers not present on Solaris with the Oracle compiler: -#if defined(__SUNPRO_CC) +#if defined(__SUNPRO_CC) && (__SUNPRO_CC < 0x5140) #define BOOST_NO_CXX11_HDR_FUTURE #define BOOST_NO_CXX11_HDR_FORWARD_LIST #define BOOST_NO_CXX11_HDR_ATOMIC diff --git a/contrib/src/boost/config/stdlib/modena.hpp b/contrib/src/boost/config/stdlib/modena.hpp index 7a85e0c..fa4a818 100644 --- a/contrib/src/boost/config/stdlib/modena.hpp +++ b/contrib/src/boost/config/stdlib/modena.hpp @@ -61,6 +61,13 @@ # define BOOST_NO_CXX14_HDR_SHARED_MUTEX #endif +// C++14 features +# define BOOST_NO_CXX14_STD_EXCHANGE + +// C++17 features +# define BOOST_NO_CXX17_STD_APPLY +# define BOOST_NO_CXX17_STD_INVOKE + #define BOOST_STDLIB "Modena C++ standard library" diff --git a/contrib/src/boost/config/stdlib/msl.hpp b/contrib/src/boost/config/stdlib/msl.hpp index dd2775e..8f21a13 100644 --- a/contrib/src/boost/config/stdlib/msl.hpp +++ b/contrib/src/boost/config/stdlib/msl.hpp @@ -85,4 +85,11 @@ # define BOOST_NO_CXX14_HDR_SHARED_MUTEX #endif +// C++14 features +# define BOOST_NO_CXX14_STD_EXCHANGE + +// C++17 features +# define BOOST_NO_CXX17_STD_APPLY +# define BOOST_NO_CXX17_STD_INVOKE + #define BOOST_STDLIB "Metrowerks Standard Library version " BOOST_STRINGIZE(__MSL_CPP__) diff --git a/contrib/src/boost/config/stdlib/roguewave.hpp b/contrib/src/boost/config/stdlib/roguewave.hpp index 97a2b0b..437d38d 100644 --- a/contrib/src/boost/config/stdlib/roguewave.hpp +++ b/contrib/src/boost/config/stdlib/roguewave.hpp @@ -196,3 +196,10 @@ #else # define BOOST_NO_CXX14_HDR_SHARED_MUTEX #endif + +// C++14 features +# define BOOST_NO_CXX14_STD_EXCHANGE + +// C++17 features +# define BOOST_NO_CXX17_STD_APPLY +# define BOOST_NO_CXX17_STD_INVOKE diff --git a/contrib/src/boost/config/stdlib/sgi.hpp b/contrib/src/boost/config/stdlib/sgi.hpp index c805271..8d2f849 100644 --- a/contrib/src/boost/config/stdlib/sgi.hpp +++ b/contrib/src/boost/config/stdlib/sgi.hpp @@ -155,4 +155,11 @@ # define BOOST_NO_CXX14_HDR_SHARED_MUTEX #endif -#define BOOST_STDLIB "SGI standard library" \ No newline at end of file +// C++14 features +# define BOOST_NO_CXX14_STD_EXCHANGE + +// C++17 features +# define BOOST_NO_CXX17_STD_APPLY +# define BOOST_NO_CXX17_STD_INVOKE + +#define BOOST_STDLIB "SGI standard library" diff --git a/contrib/src/boost/config/stdlib/stlport.hpp b/contrib/src/boost/config/stdlib/stlport.hpp index bbc4176..518f9ef 100644 --- a/contrib/src/boost/config/stdlib/stlport.hpp +++ b/contrib/src/boost/config/stdlib/stlport.hpp @@ -245,4 +245,11 @@ namespace boost { using std::min; using std::max; } # define BOOST_NO_CXX14_HDR_SHARED_MUTEX #endif +// C++14 features +# define BOOST_NO_CXX14_STD_EXCHANGE + +// C++17 features +# define BOOST_NO_CXX17_STD_APPLY +# define BOOST_NO_CXX17_STD_INVOKE + #define BOOST_STDLIB "STLPort standard library version " BOOST_STRINGIZE(__SGI_STL_PORT) diff --git a/contrib/src/boost/config/stdlib/vacpp.hpp b/contrib/src/boost/config/stdlib/vacpp.hpp index 4ccd0d2..f9afef6 100644 --- a/contrib/src/boost/config/stdlib/vacpp.hpp +++ b/contrib/src/boost/config/stdlib/vacpp.hpp @@ -61,4 +61,11 @@ # define BOOST_NO_CXX14_HDR_SHARED_MUTEX #endif +// C++14 features +# define BOOST_NO_CXX14_STD_EXCHANGE + +// C++17 features +# define BOOST_NO_CXX17_STD_APPLY +# define BOOST_NO_CXX17_STD_INVOKE + #define BOOST_STDLIB "Visual Age default standard library" diff --git a/contrib/src/boost/config/suffix.hpp b/contrib/src/boost/config/suffix.hpp index 17bf102..eeaec2b 100644 --- a/contrib/src/boost/config/suffix.hpp +++ b/contrib/src/boost/config/suffix.hpp @@ -624,12 +624,22 @@ namespace std{ using ::type_info; } # define BOOST_NORETURN __declspec(noreturn) # elif defined(__GNUC__) # define BOOST_NORETURN __attribute__ ((__noreturn__)) -# else -# define BOOST_NO_NORETURN -# define BOOST_NORETURN +# elif defined(__has_attribute) && defined(__SUNPRO_CC) +# if __has_attribute(noreturn) +# define BOOST_NORETURN [[noreturn]] +# endif +# elif defined(__has_cpp_attribute) +# if __has_cpp_attribute(noreturn) +# define BOOST_NORETURN [[noreturn]] +# endif # endif #endif +#if !defined(BOOST_NORETURN) +# define BOOST_NO_NORETURN +# define BOOST_NORETURN +#endif + // Branch prediction hints // These macros are intended to wrap conditional expressions that yield true or false // diff --git a/contrib/src/boost/core/demangle.hpp b/contrib/src/boost/core/demangle.hpp index 44aeb8d..f13c26a 100644 --- a/contrib/src/boost/core/demangle.hpp +++ b/contrib/src/boost/core/demangle.hpp @@ -17,7 +17,10 @@ # pragma once #endif -#if defined( __clang__ ) && defined( __has_include ) +// __has_include is currently supported by GCC and Clang. However GCC 4.9 may have issues and +// returns 1 for 'defined( __has_include )', while '__has_include' is actually not supported: +// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63662 +#if defined( __has_include ) && (!defined( BOOST_GCC ) || (__GNUC__ + 0) >= 5) # if __has_include() # define BOOST_CORE_HAS_CXXABI_H # endif diff --git a/contrib/src/boost/current_function.hpp b/contrib/src/boost/current_function.hpp index 5c113f8..86955cb 100644 --- a/contrib/src/boost/current_function.hpp +++ b/contrib/src/boost/current_function.hpp @@ -28,7 +28,11 @@ namespace detail inline void current_function_helper() { -#if defined(__GNUC__) || (defined(__MWERKS__) && (__MWERKS__ >= 0x3000)) || (defined(__ICC) && (__ICC >= 600)) || defined(__ghs__) +#if defined( BOOST_DISABLE_CURRENT_FUNCTION ) + +# define BOOST_CURRENT_FUNCTION "(unknown)" + +#elif defined(__GNUC__) || (defined(__MWERKS__) && (__MWERKS__ >= 0x3000)) || (defined(__ICC) && (__ICC >= 600)) || defined(__ghs__) # define BOOST_CURRENT_FUNCTION __PRETTY_FUNCTION__ diff --git a/contrib/src/boost/detail/iterator.hpp b/contrib/src/boost/detail/iterator.hpp index c2e8f1e..2498ef4 100644 --- a/contrib/src/boost/detail/iterator.hpp +++ b/contrib/src/boost/detail/iterator.hpp @@ -9,6 +9,9 @@ // This header is obsolete and will be deprecated. #include +#if defined(__SUNPRO_CC) && (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) +#include +#endif namespace boost { @@ -19,6 +22,16 @@ namespace detail using std::iterator_traits; using std::distance; +#if defined(__SUNPRO_CC) && (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) +// std::distance from stlport with Oracle compiler 12.4 and 12.5 fails to deduce template parameters +// when one of the arguments is an array and the other one is a pointer. +template< typename T, std::size_t N > +inline typename std::iterator_traits< T* >::difference_type distance(T (&left)[N], T* right) +{ + return std::distance(static_cast< T* >(left), right); +} +#endif + } // namespace detail } // namespace boost diff --git a/contrib/src/boost/detail/winapi/GetCurrentProcess.hpp b/contrib/src/boost/detail/winapi/GetCurrentProcess.hpp deleted file mode 100644 index 431b52f..0000000 --- a/contrib/src/boost/detail/winapi/GetCurrentProcess.hpp +++ /dev/null @@ -1,34 +0,0 @@ -// GetCurrentProcess.hpp --------------------------------------------------------------// - -// Copyright 2010 Vicente J. Botet Escriba -// Copyright 2015 Andrey Semashev - -// Distributed under the Boost Software License, Version 1.0. -// See http://www.boost.org/LICENSE_1_0.txt - - -#ifndef BOOST_DETAIL_WINAPI_GETCURRENTPROCESS_HPP -#define BOOST_DETAIL_WINAPI_GETCURRENTPROCESS_HPP - -#include - -#ifdef BOOST_HAS_PRAGMA_ONCE -#pragma once -#endif - -// Windows CE define GetCurrentProcess as an inline function in kfuncs.h -#if !defined( BOOST_USE_WINDOWS_H ) && !defined( UNDER_CE ) -extern "C" { -BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI GetCurrentProcess(BOOST_DETAIL_WINAPI_VOID); -} -#endif - -namespace boost { -namespace detail { -namespace winapi { -using ::GetCurrentProcess; -} -} -} - -#endif // BOOST_DETAIL_WINAPI_GETCURRENTPROCESS_HPP diff --git a/contrib/src/boost/detail/winapi/GetCurrentThread.hpp b/contrib/src/boost/detail/winapi/GetCurrentThread.hpp deleted file mode 100644 index cbcdc97..0000000 --- a/contrib/src/boost/detail/winapi/GetCurrentThread.hpp +++ /dev/null @@ -1,34 +0,0 @@ -// GetCurrentThread.hpp --------------------------------------------------------------// - -// Copyright 2010 Vicente J. Botet Escriba -// Copyright 2015 Andrey Semashev - -// Distributed under the Boost Software License, Version 1.0. -// See http://www.boost.org/LICENSE_1_0.txt - - -#ifndef BOOST_DETAIL_WINAPI_GETCURRENTTHREAD_HPP -#define BOOST_DETAIL_WINAPI_GETCURRENTTHREAD_HPP - -#include - -#ifdef BOOST_HAS_PRAGMA_ONCE -#pragma once -#endif - -// Windows CE define GetCurrentThread as an inline function in kfuncs.h -#if !defined( BOOST_USE_WINDOWS_H ) && !defined( UNDER_CE ) -extern "C" { -BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI GetCurrentThread(BOOST_DETAIL_WINAPI_VOID); -} -#endif - -namespace boost { -namespace detail { -namespace winapi { -using ::GetCurrentThread; -} -} -} - -#endif // BOOST_DETAIL_WINAPI_GETCURRENTTHREAD_HPP diff --git a/contrib/src/boost/detail/winapi/basic_types.hpp b/contrib/src/boost/detail/winapi/basic_types.hpp index 717e934..30df135 100644 --- a/contrib/src/boost/detail/winapi/basic_types.hpp +++ b/contrib/src/boost/detail/winapi/basic_types.hpp @@ -98,6 +98,10 @@ typedef ::PDWORD PDWORD_; typedef ::LPDWORD LPDWORD_; typedef ::HANDLE HANDLE_; typedef ::PHANDLE PHANDLE_; +typedef ::SHORT SHORT_; +typedef ::PSHORT PSHORT_; +typedef ::USHORT USHORT_; +typedef ::PUSHORT PUSHORT_; typedef ::INT INT_; typedef ::PINT PINT_; typedef ::LPINT LPINT_; @@ -150,6 +154,10 @@ typedef DWORD_* LPDWORD_; typedef void* HANDLE_; typedef void** PHANDLE_; +typedef short SHORT_; +typedef SHORT_* PSHORT_; +typedef unsigned short USHORT_; +typedef USHORT_* PUSHORT_; typedef int INT_; typedef INT_* PINT_; typedef INT_* LPINT_; diff --git a/contrib/src/boost/detail/winapi/config.hpp b/contrib/src/boost/detail/winapi/config.hpp index c67d670..1f08c2a 100644 --- a/contrib/src/boost/detail/winapi/config.hpp +++ b/contrib/src/boost/detail/winapi/config.hpp @@ -9,15 +9,10 @@ #ifndef BOOST_DETAIL_WINAPI_CONFIG_HPP_INCLUDED_ #define BOOST_DETAIL_WINAPI_CONFIG_HPP_INCLUDED_ -#include #if defined __MINGW32__ #include <_mingw.h> #endif -#ifdef BOOST_HAS_PRAGMA_ONCE -#pragma once -#endif - // BOOST_WINAPI_IS_MINGW indicates that the target Windows SDK is provided by MinGW (http://mingw.org/). // BOOST_WINAPI_IS_MINGW_W64 indicates that the target Windows SDK is provided by MinGW-w64 (http://mingw-w64.org). #if defined __MINGW32__ @@ -51,7 +46,7 @@ #define BOOST_USE_WINAPI_VERSION WINVER #else // By default use Windows Vista API on compilers that support it and XP on the others -#if (defined(_MSC_VER) && _MSC_VER <= 1400) || defined(BOOST_WINAPI_IS_MINGW) +#if (defined(_MSC_VER) && _MSC_VER < 1500) || defined(BOOST_WINAPI_IS_MINGW) #define BOOST_USE_WINAPI_VERSION BOOST_WINAPI_VERSION_WINXP #else #define BOOST_USE_WINAPI_VERSION BOOST_WINAPI_VERSION_WIN6 @@ -69,4 +64,10 @@ #endif #endif +#include + +#ifdef BOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + #endif // BOOST_DETAIL_WINAPI_CONFIG_HPP_INCLUDED_ diff --git a/contrib/src/boost/detail/winapi/crypt.hpp b/contrib/src/boost/detail/winapi/crypt.hpp index 4d2ebed..0650845 100644 --- a/contrib/src/boost/detail/winapi/crypt.hpp +++ b/contrib/src/boost/detail/winapi/crypt.hpp @@ -12,8 +12,8 @@ #include #include -#if defined( BOOST_USE_WINDOWS_H ) && defined( BOOST_WINAPI_IS_MINGW ) -// MinGW does not include this header as part of windows.h +#if defined( BOOST_USE_WINDOWS_H ) +// This header is not always included as part of windows.h #include #endif diff --git a/contrib/src/boost/detail/winapi/get_current_process_id.hpp b/contrib/src/boost/detail/winapi/get_current_process_id.hpp new file mode 100644 index 0000000..aa21e6c --- /dev/null +++ b/contrib/src/boost/detail/winapi/get_current_process_id.hpp @@ -0,0 +1,33 @@ +// get_current_process_id.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef BOOST_DETAIL_WINAPI_GET_CURRENT_PROCESS_ID_HPP +#define BOOST_DETAIL_WINAPI_GET_CURRENT_PROCESS_ID_HPP + +#include + +#ifdef BOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +// Windows CE define GetCurrentProcessId as an inline function in kfuncs.h +#if !defined( BOOST_USE_WINDOWS_H ) && !defined( UNDER_CE ) +extern "C" { +BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI GetCurrentProcessId(BOOST_DETAIL_WINAPI_VOID); +} +#endif + +namespace boost { +namespace detail { +namespace winapi { +using ::GetCurrentProcessId; +} +} +} + +#endif // BOOST_DETAIL_WINAPI_GET_CURRENT_PROCESS_ID_HPP diff --git a/contrib/src/boost/detail/winapi/get_current_thread_id.hpp b/contrib/src/boost/detail/winapi/get_current_thread_id.hpp new file mode 100644 index 0000000..198af3b --- /dev/null +++ b/contrib/src/boost/detail/winapi/get_current_thread_id.hpp @@ -0,0 +1,34 @@ +// get_current_thread_id.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba +// Copyright 2015 Andrey Semashev + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef BOOST_DETAIL_WINAPI_GET_CURRENT_THREAD_ID_HPP +#define BOOST_DETAIL_WINAPI_GET_CURRENT_THREAD_ID_HPP + +#include + +#ifdef BOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +// Windows CE define GetCurrentThreadId as an inline function in kfuncs.h +#if !defined( BOOST_USE_WINDOWS_H ) && !defined( UNDER_CE ) +extern "C" { +BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI GetCurrentThreadId(BOOST_DETAIL_WINAPI_VOID); +} +#endif + +namespace boost { +namespace detail { +namespace winapi { +using ::GetCurrentThreadId; +} +} +} + +#endif // BOOST_DETAIL_WINAPI_GET_CURRENT_THREAD_ID_HPP diff --git a/contrib/src/boost/detail/winapi/process.hpp b/contrib/src/boost/detail/winapi/process.hpp deleted file mode 100644 index 3c3de56..0000000 --- a/contrib/src/boost/detail/winapi/process.hpp +++ /dev/null @@ -1,34 +0,0 @@ -// process.hpp --------------------------------------------------------------// - -// Copyright 2010 Vicente J. Botet Escriba - -// Distributed under the Boost Software License, Version 1.0. -// See http://www.boost.org/LICENSE_1_0.txt - - -#ifndef BOOST_DETAIL_WINAPI_PROCESS_HPP -#define BOOST_DETAIL_WINAPI_PROCESS_HPP - -#include -#include - -#ifdef BOOST_HAS_PRAGMA_ONCE -#pragma once -#endif - -// Windows CE define GetCurrentProcessId as an inline function in kfuncs.h -#if !defined( BOOST_USE_WINDOWS_H ) && !defined( UNDER_CE ) -extern "C" { -BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI GetCurrentProcessId(BOOST_DETAIL_WINAPI_VOID); -} -#endif - -namespace boost { -namespace detail { -namespace winapi { -using ::GetCurrentProcessId; -} -} -} - -#endif // BOOST_DETAIL_WINAPI_PROCESS_HPP diff --git a/contrib/src/boost/detail/winapi/thread.hpp b/contrib/src/boost/detail/winapi/thread.hpp deleted file mode 100644 index 9367d46..0000000 --- a/contrib/src/boost/detail/winapi/thread.hpp +++ /dev/null @@ -1,46 +0,0 @@ -// thread.hpp --------------------------------------------------------------// - -// Copyright 2010 Vicente J. Botet Escriba -// Copyright 2015 Andrey Semashev - -// Distributed under the Boost Software License, Version 1.0. -// See http://www.boost.org/LICENSE_1_0.txt - - -#ifndef BOOST_DETAIL_WINAPI_THREAD_HPP -#define BOOST_DETAIL_WINAPI_THREAD_HPP - -#include -#include - -#ifdef BOOST_HAS_PRAGMA_ONCE -#pragma once -#endif - -#if !defined( BOOST_USE_WINDOWS_H ) -extern "C" { -// Windows CE define GetCurrentThreadId as an inline function in kfuncs.h -#if !defined( UNDER_CE ) -BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI GetCurrentThreadId(BOOST_DETAIL_WINAPI_VOID); -#endif -BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI -SleepEx( - boost::detail::winapi::DWORD_ dwMilliseconds, - boost::detail::winapi::BOOL_ bAlertable); -BOOST_SYMBOL_IMPORT boost::detail::winapi::VOID_ WINAPI Sleep(boost::detail::winapi::DWORD_ dwMilliseconds); -BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI SwitchToThread(BOOST_DETAIL_WINAPI_VOID); -} -#endif - -namespace boost { -namespace detail { -namespace winapi { -using ::GetCurrentThreadId; -using ::SleepEx; -using ::Sleep; -using ::SwitchToThread; -} -} -} - -#endif // BOOST_DETAIL_WINAPI_THREAD_HPP diff --git a/contrib/src/boost/dynamic_bitset/dynamic_bitset.hpp b/contrib/src/boost/dynamic_bitset/dynamic_bitset.hpp index f6002d8..86b5428 100644 --- a/contrib/src/boost/dynamic_bitset/dynamic_bitset.hpp +++ b/contrib/src/boost/dynamic_bitset/dynamic_bitset.hpp @@ -305,6 +305,9 @@ public: size_type num_blocks() const BOOST_NOEXCEPT; size_type max_size() const BOOST_NOEXCEPT; bool empty() const BOOST_NOEXCEPT; + size_type capacity() const BOOST_NOEXCEPT; + void reserve(size_type num_bits); + void shrink_to_fit(); bool is_subset_of(const dynamic_bitset& a) const; bool is_proper_subset_of(const dynamic_bitset& a) const; @@ -750,15 +753,15 @@ push_back(bool bit) template void dynamic_bitset:: -pop_back() +pop_back() { const size_type old_num_blocks = num_blocks(); const size_type required_blocks = calc_num_blocks(m_num_bits - 1); - + if (required_blocks != old_num_blocks) { - m_bits.pop_back(); + m_bits.pop_back(); } - + --m_num_bits; m_zero_unused_bits(); } @@ -1268,6 +1271,27 @@ inline bool dynamic_bitset::empty() const BOOST_NOEXCEPT } template +inline typename dynamic_bitset::size_type +dynamic_bitset::capacity() const BOOST_NOEXCEPT +{ + return m_bits.capacity() * bits_per_block; +} + +template +inline void dynamic_bitset::reserve(size_type num_bits) +{ + m_bits.reserve(calc_num_blocks(num_bits)); +} + +template +void dynamic_bitset::shrink_to_fit() +{ + if (m_bits.size() < m_bits.capacity()) { + buffer_type(m_bits).swap(m_bits); + } +} + +template bool dynamic_bitset:: is_subset_of(const dynamic_bitset& a) const { diff --git a/contrib/src/boost/exception/exception.hpp b/contrib/src/boost/exception/exception.hpp index 1f2bd9c..c0fdaf9 100644 --- a/contrib/src/boost/exception/exception.hpp +++ b/contrib/src/boost/exception/exception.hpp @@ -12,6 +12,14 @@ #pragma warning(push,1) #endif +#ifdef BOOST_EXCEPTION_MINI_BOOST +#include +namespace boost { namespace exception_detail { using std::shared_ptr; } } +#else +namespace boost { template class shared_ptr; }; +namespace boost { namespace exception_detail { using boost::shared_ptr; } } +#endif + namespace boost { @@ -144,9 +152,6 @@ boost # endif #endif - template - class shared_ptr; - namespace exception_detail { @@ -182,6 +187,18 @@ boost template <> struct get_info; + template + struct set_info_rv; + + template <> + struct set_info_rv; + + template <> + struct set_info_rv; + + template <> + struct set_info_rv; + char const * get_diagnostic_information( exception const &, char const * ); void copy_boost_exception( exception *, exception const * ); @@ -264,6 +281,11 @@ boost friend struct exception_detail::get_info; friend struct exception_detail::get_info; friend struct exception_detail::get_info; + template + friend struct exception_detail::set_info_rv; + friend struct exception_detail::set_info_rv; + friend struct exception_detail::set_info_rv; + friend struct exception_detail::set_info_rv; friend void exception_detail::copy_boost_exception( exception *, exception const * ); #endif mutable exception_detail::refcount_ptr data_; diff --git a/contrib/src/boost/function/function_base.hpp b/contrib/src/boost/function/function_base.hpp index 35c1995..21a0c0d 100644 --- a/contrib/src/boost/function/function_base.hpp +++ b/contrib/src/boost/function/function_base.hpp @@ -16,9 +16,9 @@ #include #include #include -#include #include #include +#include #include #include #include @@ -41,28 +41,6 @@ # pragma warning( push ) # pragma warning( disable : 4793 ) // complaint about native code generation # pragma warning( disable : 4127 ) // "conditional expression is constant" -#endif - -// Define BOOST_FUNCTION_STD_NS to the namespace that contains type_info. -#ifdef BOOST_NO_STD_TYPEINFO -// Embedded VC++ does not have type_info in namespace std -# define BOOST_FUNCTION_STD_NS -#else -# define BOOST_FUNCTION_STD_NS std -#endif - -// Borrowed from Boost.Python library: determines the cases where we -// need to use std::type_info::name to compare instead of operator==. -#if defined( BOOST_NO_TYPEID ) -# define BOOST_FUNCTION_COMPARE_TYPE_ID(X,Y) ((X)==(Y)) -#elif defined(__GNUC__) \ - || defined(_AIX) \ - || ( defined(__sgi) && defined(__host_mips)) -# include -# define BOOST_FUNCTION_COMPARE_TYPE_ID(X,Y) \ - (std::strcmp((X).name(),(Y).name()) == 0) -# else -# define BOOST_FUNCTION_COMPARE_TYPE_ID(X,Y) ((X)==(Y)) #endif #if defined(__ICL) && __ICL <= 600 || defined(__MWERKS__) && __MWERKS__ < 0x2406 && !defined(BOOST_STRICT_CONFIG) @@ -87,15 +65,16 @@ namespace boost { * object pointers, and a structure that resembles a bound * member function pointer. */ - union function_buffer + union function_buffer_members { // For pointers to function objects - mutable void* obj_ptr; + typedef void* obj_ptr_t; + mutable obj_ptr_t obj_ptr; // For pointers to std::type_info objects struct type_t { // (get_functor_type_tag, check_functor_type_tag). - const detail::sp_typeinfo* type; + const boost::typeindex::type_info* type; // Whether the type is const-qualified. bool const_qualified; @@ -104,7 +83,8 @@ namespace boost { } type; // For function pointers of all kinds - mutable void (*func_ptr)(); + typedef void (*func_ptr_t)(); + mutable func_ptr_t func_ptr; // For bound member pointers struct bound_memfunc_ptr_t { @@ -119,9 +99,15 @@ namespace boost { bool is_const_qualified; bool is_volatile_qualified; } obj_ref; + }; + + union function_buffer + { + // Type-specific union members + mutable function_buffer_members members; // To relax aliasing constraints - mutable char data; + mutable char data[sizeof(function_buffer_members)]; }; /** @@ -188,45 +174,42 @@ namespace boost { struct reference_manager { static inline void - manage(const function_buffer& in_buffer, function_buffer& out_buffer, + manage(const function_buffer& in_buffer, function_buffer& out_buffer, functor_manager_operation_type op) { switch (op) { - case clone_functor_tag: - out_buffer.obj_ref = in_buffer.obj_ref; + case clone_functor_tag: + out_buffer.members.obj_ref = in_buffer.members.obj_ref; return; case move_functor_tag: - out_buffer.obj_ref = in_buffer.obj_ref; - in_buffer.obj_ref.obj_ptr = 0; + out_buffer.members.obj_ref = in_buffer.members.obj_ref; + in_buffer.members.obj_ref.obj_ptr = 0; return; case destroy_functor_tag: - out_buffer.obj_ref.obj_ptr = 0; + out_buffer.members.obj_ref.obj_ptr = 0; return; case check_functor_type_tag: { - const detail::sp_typeinfo& check_type - = *out_buffer.type.type; - // Check whether we have the same type. We can add // cv-qualifiers, but we can't take them away. - if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, BOOST_SP_TYPEID(F)) - && (!in_buffer.obj_ref.is_const_qualified - || out_buffer.type.const_qualified) - && (!in_buffer.obj_ref.is_volatile_qualified - || out_buffer.type.volatile_qualified)) - out_buffer.obj_ptr = in_buffer.obj_ref.obj_ptr; + if (*out_buffer.members.type.type == boost::typeindex::type_id() + && (!in_buffer.members.obj_ref.is_const_qualified + || out_buffer.members.type.const_qualified) + && (!in_buffer.members.obj_ref.is_volatile_qualified + || out_buffer.members.type.volatile_qualified)) + out_buffer.members.obj_ptr = in_buffer.members.obj_ref.obj_ptr; else - out_buffer.obj_ptr = 0; + out_buffer.members.obj_ptr = 0; } return; case get_functor_type_tag: - out_buffer.type.type = &BOOST_SP_TYPEID(F); - out_buffer.type.const_qualified = in_buffer.obj_ref.is_const_qualified; - out_buffer.type.volatile_qualified = in_buffer.obj_ref.is_volatile_qualified; + out_buffer.members.type.type = &boost::typeindex::type_id().type_info(); + out_buffer.members.type.const_qualified = in_buffer.members.obj_ref.is_const_qualified; + out_buffer.members.type.volatile_qualified = in_buffer.members.obj_ref.is_volatile_qualified; return; } } @@ -240,9 +223,9 @@ namespace boost { struct function_allows_small_object_optimization { BOOST_STATIC_CONSTANT - (bool, + (bool, value = ((sizeof(F) <= sizeof(function_buffer) && - (alignment_of::value + (alignment_of::value % alignment_of::value == 0)))); }; @@ -254,7 +237,7 @@ namespace boost { A(a) { } - + functor_wrapper(const functor_wrapper& f) : F(static_cast(f)), A(static_cast(f)) @@ -273,61 +256,57 @@ namespace boost { // Function pointers static inline void - manage_ptr(const function_buffer& in_buffer, function_buffer& out_buffer, + manage_ptr(const function_buffer& in_buffer, function_buffer& out_buffer, functor_manager_operation_type op) { if (op == clone_functor_tag) - out_buffer.func_ptr = in_buffer.func_ptr; + out_buffer.members.func_ptr = in_buffer.members.func_ptr; else if (op == move_functor_tag) { - out_buffer.func_ptr = in_buffer.func_ptr; - in_buffer.func_ptr = 0; + out_buffer.members.func_ptr = in_buffer.members.func_ptr; + in_buffer.members.func_ptr = 0; } else if (op == destroy_functor_tag) - out_buffer.func_ptr = 0; + out_buffer.members.func_ptr = 0; else if (op == check_functor_type_tag) { - const boost::detail::sp_typeinfo& check_type - = *out_buffer.type.type; - if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, BOOST_SP_TYPEID(Functor))) - out_buffer.obj_ptr = &in_buffer.func_ptr; + if (*out_buffer.members.type.type == boost::typeindex::type_id()) + out_buffer.members.obj_ptr = &in_buffer.members.func_ptr; else - out_buffer.obj_ptr = 0; + out_buffer.members.obj_ptr = 0; } else /* op == get_functor_type_tag */ { - out_buffer.type.type = &BOOST_SP_TYPEID(Functor); - out_buffer.type.const_qualified = false; - out_buffer.type.volatile_qualified = false; + out_buffer.members.type.type = &boost::typeindex::type_id().type_info(); + out_buffer.members.type.const_qualified = false; + out_buffer.members.type.volatile_qualified = false; } } // Function objects that fit in the small-object buffer. static inline void - manage_small(const function_buffer& in_buffer, function_buffer& out_buffer, + manage_small(const function_buffer& in_buffer, function_buffer& out_buffer, functor_manager_operation_type op) { if (op == clone_functor_tag || op == move_functor_tag) { - const functor_type* in_functor = - reinterpret_cast(&in_buffer.data); - new (reinterpret_cast(&out_buffer.data)) functor_type(*in_functor); + const functor_type* in_functor = + reinterpret_cast(in_buffer.data); + new (reinterpret_cast(out_buffer.data)) functor_type(*in_functor); if (op == move_functor_tag) { - functor_type* f = reinterpret_cast(&in_buffer.data); + functor_type* f = reinterpret_cast(in_buffer.data); (void)f; // suppress warning about the value of f not being used (MSVC) f->~Functor(); } } else if (op == destroy_functor_tag) { // Some compilers (Borland, vc6, ...) are unhappy with ~functor_type. - functor_type* f = reinterpret_cast(&out_buffer.data); + functor_type* f = reinterpret_cast(out_buffer.data); (void)f; // suppress warning about the value of f not being used (MSVC) f->~Functor(); } else if (op == check_functor_type_tag) { - const detail::sp_typeinfo& check_type - = *out_buffer.type.type; - if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, BOOST_SP_TYPEID(Functor))) - out_buffer.obj_ptr = &in_buffer.data; + if (*out_buffer.members.type.type == boost::typeindex::type_id()) + out_buffer.members.obj_ptr = in_buffer.data; else - out_buffer.obj_ptr = 0; + out_buffer.members.obj_ptr = 0; } else /* op == get_functor_type_tag */ { - out_buffer.type.type = &BOOST_SP_TYPEID(Functor); - out_buffer.type.const_qualified = false; - out_buffer.type.volatile_qualified = false; + out_buffer.members.type.type = &boost::typeindex::type_id().type_info(); + out_buffer.members.type.const_qualified = false; + out_buffer.members.type.volatile_qualified = false; } } }; @@ -340,7 +319,7 @@ namespace boost { // Function pointers static inline void - manager(const function_buffer& in_buffer, function_buffer& out_buffer, + manager(const function_buffer& in_buffer, function_buffer& out_buffer, functor_manager_operation_type op, function_ptr_tag) { functor_manager_common::manage_ptr(in_buffer,out_buffer,op); @@ -348,15 +327,15 @@ namespace boost { // Function objects that fit in the small-object buffer. static inline void - manager(const function_buffer& in_buffer, function_buffer& out_buffer, + manager(const function_buffer& in_buffer, function_buffer& out_buffer, functor_manager_operation_type op, mpl::true_) { functor_manager_common::manage_small(in_buffer,out_buffer,op); } - + // Function objects that require heap allocation static inline void - manager(const function_buffer& in_buffer, function_buffer& out_buffer, + manager(const function_buffer& in_buffer, function_buffer& out_buffer, functor_manager_operation_type op, mpl::false_) { if (op == clone_functor_tag) { @@ -366,29 +345,27 @@ namespace boost { // jewillco: Changing this to static_cast because GCC 2.95.3 is // obsolete. const functor_type* f = - static_cast(in_buffer.obj_ptr); + static_cast(in_buffer.members.obj_ptr); functor_type* new_f = new functor_type(*f); - out_buffer.obj_ptr = new_f; + out_buffer.members.obj_ptr = new_f; } else if (op == move_functor_tag) { - out_buffer.obj_ptr = in_buffer.obj_ptr; - in_buffer.obj_ptr = 0; + out_buffer.members.obj_ptr = in_buffer.members.obj_ptr; + in_buffer.members.obj_ptr = 0; } else if (op == destroy_functor_tag) { /* Cast from the void pointer to the functor pointer type */ functor_type* f = - static_cast(out_buffer.obj_ptr); + static_cast(out_buffer.members.obj_ptr); delete f; - out_buffer.obj_ptr = 0; + out_buffer.members.obj_ptr = 0; } else if (op == check_functor_type_tag) { - const detail::sp_typeinfo& check_type - = *out_buffer.type.type; - if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, BOOST_SP_TYPEID(Functor))) - out_buffer.obj_ptr = in_buffer.obj_ptr; + if (*out_buffer.members.type.type == boost::typeindex::type_id()) + out_buffer.members.obj_ptr = in_buffer.members.obj_ptr; else - out_buffer.obj_ptr = 0; + out_buffer.members.obj_ptr = 0; } else /* op == get_functor_type_tag */ { - out_buffer.type.type = &BOOST_SP_TYPEID(Functor); - out_buffer.type.const_qualified = false; - out_buffer.type.volatile_qualified = false; + out_buffer.members.type.type = &boost::typeindex::type_id().type_info(); + out_buffer.members.type.const_qualified = false; + out_buffer.members.type.volatile_qualified = false; } } @@ -396,7 +373,7 @@ namespace boost { // object can use the small-object optimization buffer or // whether we need to allocate it on the heap. static inline void - manager(const function_buffer& in_buffer, function_buffer& out_buffer, + manager(const function_buffer& in_buffer, function_buffer& out_buffer, functor_manager_operation_type op, function_obj_tag) { manager(in_buffer, out_buffer, op, @@ -405,7 +382,7 @@ namespace boost { // For member pointers, we use the small-object optimization buffer. static inline void - manager(const function_buffer& in_buffer, function_buffer& out_buffer, + manager(const function_buffer& in_buffer, function_buffer& out_buffer, functor_manager_operation_type op, member_ptr_tag) { manager(in_buffer, out_buffer, op, mpl::true_()); @@ -415,15 +392,15 @@ namespace boost { /* Dispatch to an appropriate manager based on whether we have a function pointer or a function object pointer. */ static inline void - manage(const function_buffer& in_buffer, function_buffer& out_buffer, + manage(const function_buffer& in_buffer, function_buffer& out_buffer, functor_manager_operation_type op) { typedef typename get_function_tag::type tag_type; switch (op) { case get_functor_type_tag: - out_buffer.type.type = &BOOST_SP_TYPEID(functor_type); - out_buffer.type.const_qualified = false; - out_buffer.type.volatile_qualified = false; + out_buffer.members.type.type = &boost::typeindex::type_id().type_info(); + out_buffer.members.type.const_qualified = false; + out_buffer.members.type.volatile_qualified = false; return; default: @@ -441,7 +418,7 @@ namespace boost { // Function pointers static inline void - manager(const function_buffer& in_buffer, function_buffer& out_buffer, + manager(const function_buffer& in_buffer, function_buffer& out_buffer, functor_manager_operation_type op, function_ptr_tag) { functor_manager_common::manage_ptr(in_buffer,out_buffer,op); @@ -449,15 +426,15 @@ namespace boost { // Function objects that fit in the small-object buffer. static inline void - manager(const function_buffer& in_buffer, function_buffer& out_buffer, + manager(const function_buffer& in_buffer, function_buffer& out_buffer, functor_manager_operation_type op, mpl::true_) { functor_manager_common::manage_small(in_buffer,out_buffer,op); } - + // Function objects that require heap allocation static inline void - manager(const function_buffer& in_buffer, function_buffer& out_buffer, + manager(const function_buffer& in_buffer, function_buffer& out_buffer, functor_manager_operation_type op, mpl::false_) { typedef functor_wrapper functor_wrapper_type; @@ -470,36 +447,34 @@ namespace boost { // GCC 2.95.3 gets the CV qualifiers wrong here, so we // can't do the static_cast that we should do. const functor_wrapper_type* f = - static_cast(in_buffer.obj_ptr); + static_cast(in_buffer.members.obj_ptr); wrapper_allocator_type wrapper_allocator(static_cast(*f)); wrapper_allocator_pointer_type copy = wrapper_allocator.allocate(1); wrapper_allocator.construct(copy, *f); // Get back to the original pointer type functor_wrapper_type* new_f = static_cast(copy); - out_buffer.obj_ptr = new_f; + out_buffer.members.obj_ptr = new_f; } else if (op == move_functor_tag) { - out_buffer.obj_ptr = in_buffer.obj_ptr; - in_buffer.obj_ptr = 0; + out_buffer.members.obj_ptr = in_buffer.members.obj_ptr; + in_buffer.members.obj_ptr = 0; } else if (op == destroy_functor_tag) { /* Cast from the void pointer to the functor_wrapper_type */ functor_wrapper_type* victim = - static_cast(in_buffer.obj_ptr); + static_cast(in_buffer.members.obj_ptr); wrapper_allocator_type wrapper_allocator(static_cast(*victim)); wrapper_allocator.destroy(victim); wrapper_allocator.deallocate(victim,1); - out_buffer.obj_ptr = 0; + out_buffer.members.obj_ptr = 0; } else if (op == check_functor_type_tag) { - const detail::sp_typeinfo& check_type - = *out_buffer.type.type; - if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, BOOST_SP_TYPEID(Functor))) - out_buffer.obj_ptr = in_buffer.obj_ptr; + if (*out_buffer.members.type.type == boost::typeindex::type_id()) + out_buffer.members.obj_ptr = in_buffer.members.obj_ptr; else - out_buffer.obj_ptr = 0; + out_buffer.members.obj_ptr = 0; } else /* op == get_functor_type_tag */ { - out_buffer.type.type = &BOOST_SP_TYPEID(Functor); - out_buffer.type.const_qualified = false; - out_buffer.type.volatile_qualified = false; + out_buffer.members.type.type = &boost::typeindex::type_id().type_info(); + out_buffer.members.type.const_qualified = false; + out_buffer.members.type.volatile_qualified = false; } } @@ -507,7 +482,7 @@ namespace boost { // object can use the small-object optimization buffer or // whether we need to allocate it on the heap. static inline void - manager(const function_buffer& in_buffer, function_buffer& out_buffer, + manager(const function_buffer& in_buffer, function_buffer& out_buffer, functor_manager_operation_type op, function_obj_tag) { manager(in_buffer, out_buffer, op, @@ -518,15 +493,15 @@ namespace boost { /* Dispatch to an appropriate manager based on whether we have a function pointer or a function object pointer. */ static inline void - manage(const function_buffer& in_buffer, function_buffer& out_buffer, + manage(const function_buffer& in_buffer, function_buffer& out_buffer, functor_manager_operation_type op) { typedef typename get_function_tag::type tag_type; switch (op) { case get_functor_type_tag: - out_buffer.type.type = &BOOST_SP_TYPEID(functor_type); - out_buffer.type.const_qualified = false; - out_buffer.type.volatile_qualified = false; + out_buffer.members.type.type = &boost::typeindex::type_id().type_info(); + out_buffer.members.type.const_qualified = false; + out_buffer.members.type.volatile_qualified = false; return; default: @@ -604,8 +579,8 @@ namespace boost { */ struct vtable_base { - void (*manager)(const function_buffer& in_buffer, - function_buffer& out_buffer, + void (*manager)(const function_buffer& in_buffer, + function_buffer& out_buffer, functor_manager_operation_type op); }; } // end namespace function @@ -625,15 +600,15 @@ public: /** Determine if the function is empty (i.e., has no target). */ bool empty() const { return !vtable; } - /** Retrieve the type of the stored function object, or BOOST_SP_TYPEID(void) + /** Retrieve the type of the stored function object, or type_id() if this is empty. */ - const detail::sp_typeinfo& target_type() const + const boost::typeindex::type_info& target_type() const { - if (!vtable) return BOOST_SP_TYPEID(void); + if (!vtable) return boost::typeindex::type_id().type_info(); detail::function::function_buffer type; get_vtable()->manager(functor, type, detail::function::get_functor_type_tag); - return *type.type.type; + return *type.members.type.type; } template @@ -642,12 +617,12 @@ public: if (!vtable) return 0; detail::function::function_buffer type_result; - type_result.type.type = &BOOST_SP_TYPEID(Functor); - type_result.type.const_qualified = is_const::value; - type_result.type.volatile_qualified = is_volatile::value; - get_vtable()->manager(functor, type_result, + type_result.members.type.type = &boost::typeindex::type_id().type_info(); + type_result.members.type.const_qualified = is_const::value; + type_result.members.type.volatile_qualified = is_volatile::value; + get_vtable()->manager(functor, type_result, detail::function::check_functor_type_tag); - return static_cast(type_result.obj_ptr); + return static_cast(type_result.members.obj_ptr); } template @@ -656,14 +631,14 @@ public: if (!vtable) return 0; detail::function::function_buffer type_result; - type_result.type.type = &BOOST_SP_TYPEID(Functor); - type_result.type.const_qualified = true; - type_result.type.volatile_qualified = is_volatile::value; - get_vtable()->manager(functor, type_result, + type_result.members.type.type = &boost::typeindex::type_id().type_info(); + type_result.members.type.const_qualified = true; + type_result.members.type.volatile_qualified = is_volatile::value; + get_vtable()->manager(functor, type_result, detail::function::check_functor_type_tag); // GCC 2.95.3 gets the CV qualifiers wrong here, so we // can't do the static_cast that we should do. - return static_cast(type_result.obj_ptr); + return static_cast(type_result.members.obj_ptr); } template @@ -883,10 +858,9 @@ namespace detail { } // end namespace boost #undef BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL -#undef BOOST_FUNCTION_COMPARE_TYPE_ID #if defined(BOOST_MSVC) # pragma warning( pop ) -#endif +#endif #endif // BOOST_FUNCTION_BASE_HEADER diff --git a/contrib/src/boost/function/function_template.hpp b/contrib/src/boost/function/function_template.hpp index 211b81d..82c81d7 100644 --- a/contrib/src/boost/function/function_template.hpp +++ b/contrib/src/boost/function/function_template.hpp @@ -16,7 +16,7 @@ #if defined(BOOST_MSVC) # pragma warning( push ) # pragma warning( disable : 4127 ) // "conditional expression is constant" -#endif +#endif #define BOOST_FUNCTION_TEMPLATE_PARMS BOOST_PP_ENUM_PARAMS(BOOST_FUNCTION_NUM_ARGS, typename T) @@ -97,7 +97,7 @@ namespace boost { static R invoke(function_buffer& function_ptr BOOST_FUNCTION_COMMA BOOST_FUNCTION_PARMS) { - FunctionPtr f = reinterpret_cast(function_ptr.func_ptr); + FunctionPtr f = reinterpret_cast(function_ptr.members.func_ptr); return f(BOOST_FUNCTION_ARGS); } }; @@ -114,7 +114,7 @@ namespace boost { BOOST_FUNCTION_PARMS) { - FunctionPtr f = reinterpret_cast(function_ptr.func_ptr); + FunctionPtr f = reinterpret_cast(function_ptr.members.func_ptr); BOOST_FUNCTION_RETURN(f(BOOST_FUNCTION_ARGS)); } }; @@ -132,9 +132,9 @@ namespace boost { { FunctionObj* f; if (function_allows_small_object_optimization::value) - f = reinterpret_cast(&function_obj_ptr.data); + f = reinterpret_cast(function_obj_ptr.data); else - f = reinterpret_cast(function_obj_ptr.obj_ptr); + f = reinterpret_cast(function_obj_ptr.members.obj_ptr); return (*f)(BOOST_FUNCTION_ARGS); } }; @@ -153,9 +153,9 @@ namespace boost { { FunctionObj* f; if (function_allows_small_object_optimization::value) - f = reinterpret_cast(&function_obj_ptr.data); + f = reinterpret_cast(function_obj_ptr.data); else - f = reinterpret_cast(function_obj_ptr.obj_ptr); + f = reinterpret_cast(function_obj_ptr.members.obj_ptr); BOOST_FUNCTION_RETURN((*f)(BOOST_FUNCTION_ARGS)); } }; @@ -171,8 +171,8 @@ namespace boost { BOOST_FUNCTION_PARMS) { - FunctionObj* f = - reinterpret_cast(function_obj_ptr.obj_ptr); + FunctionObj* f = + reinterpret_cast(function_obj_ptr.members.obj_ptr); return (*f)(BOOST_FUNCTION_ARGS); } }; @@ -189,8 +189,8 @@ namespace boost { BOOST_FUNCTION_PARMS) { - FunctionObj* f = - reinterpret_cast(function_obj_ptr.obj_ptr); + FunctionObj* f = + reinterpret_cast(function_obj_ptr.members.obj_ptr); BOOST_FUNCTION_RETURN((*f)(BOOST_FUNCTION_ARGS)); } }; @@ -208,8 +208,8 @@ namespace boost { BOOST_FUNCTION_PARMS) { - MemberPtr* f = - reinterpret_cast(&function_obj_ptr.data); + MemberPtr* f = + reinterpret_cast(function_obj_ptr.data); return boost::mem_fn(*f)(BOOST_FUNCTION_ARGS); } }; @@ -226,8 +226,8 @@ namespace boost { BOOST_FUNCTION_PARMS) { - MemberPtr* f = - reinterpret_cast(&function_obj_ptr.data); + MemberPtr* f = + reinterpret_cast(function_obj_ptr.data); BOOST_FUNCTION_RETURN(boost::mem_fn(*f)(BOOST_FUNCTION_ARGS)); } }; @@ -322,7 +322,7 @@ namespace boost { /* Given the tag returned by get_function_tag, retrieve the actual invoker that will be used for the given function - object. + object. Each specialization contains an "apply" nested class template that accepts the function object, return type, function @@ -513,21 +513,21 @@ namespace boost { private: // Function pointers template - bool + bool assign_to(FunctionPtr f, function_buffer& functor, function_ptr_tag) const { this->clear(functor); if (f) { // should be a reinterpret cast, but some compilers insist // on giving cv-qualifiers to free functions - functor.func_ptr = reinterpret_cast(f); + functor.members.func_ptr = reinterpret_cast(f); return true; } else { return false; } } template - bool + bool assign_to_a(FunctionPtr f, function_buffer& functor, Allocator, function_ptr_tag) const { return assign_to(f,functor,function_ptr_tag()); @@ -566,13 +566,13 @@ namespace boost { // Function objects // Assign to a function object using the small object optimization template - void + void assign_functor(FunctionObj f, function_buffer& functor, mpl::true_) const { - new (reinterpret_cast(&functor.data)) FunctionObj(f); + new (reinterpret_cast(functor.data)) FunctionObj(f); } template - void + void assign_functor_a(FunctionObj f, function_buffer& functor, Allocator, mpl::true_) const { assign_functor(f,functor,mpl::true_()); @@ -580,13 +580,13 @@ namespace boost { // Assign to a function object allocated on the heap. template - void + void assign_functor(FunctionObj f, function_buffer& functor, mpl::false_) const { - functor.obj_ptr = new FunctionObj(f); + functor.members.obj_ptr = new FunctionObj(f); } template - void + void assign_functor_a(FunctionObj f, function_buffer& functor, Allocator a, mpl::false_) const { typedef functor_wrapper functor_wrapper_type; @@ -597,15 +597,15 @@ namespace boost { wrapper_allocator_pointer_type copy = wrapper_allocator.allocate(1); wrapper_allocator.construct(copy, functor_wrapper_type(f,a)); functor_wrapper_type* new_f = static_cast(copy); - functor.obj_ptr = new_f; + functor.members.obj_ptr = new_f; } template - bool + bool assign_to(FunctionObj f, function_buffer& functor, function_obj_tag) const { if (!boost::detail::function::has_empty_target(boost::addressof(f))) { - assign_functor(f, functor, + assign_functor(f, functor, mpl::bool_<(function_allows_small_object_optimization::value)>()); return true; } else { @@ -613,7 +613,7 @@ namespace boost { } } template - bool + bool assign_to_a(FunctionObj f, function_buffer& functor, Allocator a, function_obj_tag) const { if (!boost::detail::function::has_empty_target(boost::addressof(f))) { @@ -627,18 +627,18 @@ namespace boost { // Reference to a function object template - bool - assign_to(const reference_wrapper& f, + bool + assign_to(const reference_wrapper& f, function_buffer& functor, function_obj_ref_tag) const { - functor.obj_ref.obj_ptr = (void *)(f.get_pointer()); - functor.obj_ref.is_const_qualified = is_const::value; - functor.obj_ref.is_volatile_qualified = is_volatile::value; + functor.members.obj_ref.obj_ptr = (void *)(f.get_pointer()); + functor.members.obj_ref.is_const_qualified = is_const::value; + functor.members.obj_ref.is_volatile_qualified = is_volatile::value; return true; } template - bool - assign_to_a(const reference_wrapper& f, + bool + assign_to_a(const reference_wrapper& f, function_buffer& functor, Allocator, function_obj_ref_tag) const { return assign_to(f,functor,function_obj_ref_tag()); @@ -752,14 +752,14 @@ namespace boost { { this->assign_to_own(f); } - + #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES BOOST_FUNCTION_FUNCTION(BOOST_FUNCTION_FUNCTION&& f) : function_base() { this->move_assign(f); } #endif - + ~BOOST_FUNCTION_FUNCTION() { clear(); } result_type operator()(BOOST_FUNCTION_PARMS) const @@ -840,12 +840,11 @@ namespace boost { BOOST_CATCH_END return *this; } - + #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES // Move assignment from another BOOST_FUNCTION_FUNCTION BOOST_FUNCTION_FUNCTION& operator=(BOOST_FUNCTION_FUNCTION&& f) { - if (&f == this) return *this; @@ -922,10 +921,10 @@ namespace boost { typedef typename boost::detail::function::get_function_tag::type tag; typedef boost::detail::function::BOOST_FUNCTION_GET_INVOKER get_invoker; typedef typename get_invoker:: - template apply handler_type; - + typedef typename handler_type::invoker_type invoker_type; typedef typename handler_type::manager_type manager_type; @@ -933,7 +932,7 @@ namespace boost { // static initialization. Otherwise, we will have a race // condition here in multi-threaded code. See // http://thread.gmane.org/gmane.comp.lib.boost.devel/164902/. - static const vtable_type stored_vtable = + static const vtable_type stored_vtable = { { &manager_type::manage }, &invoker_type::invoke }; if (stored_vtable.assign_to(f, functor)) { @@ -944,7 +943,7 @@ namespace boost { boost::detail::function::function_allows_small_object_optimization::value) value |= static_cast(0x01); vtable = reinterpret_cast(value); - } else + } else vtable = 0; } @@ -956,11 +955,11 @@ namespace boost { typedef typename boost::detail::function::get_function_tag::type tag; typedef boost::detail::function::BOOST_FUNCTION_GET_INVOKER get_invoker; typedef typename get_invoker:: - template apply_a handler_type; - + typedef typename handler_type::invoker_type invoker_type; typedef typename handler_type::manager_type manager_type; @@ -971,7 +970,7 @@ namespace boost { static const vtable_type stored_vtable = { { &manager_type::manage }, &invoker_type::invoke }; - if (stored_vtable.assign_to_a(f, functor, a)) { + if (stored_vtable.assign_to_a(f, functor, a)) { std::size_t value = reinterpret_cast(&stored_vtable.base); // coverity[pointless_expression]: suppress coverity warnings on apparant if(const). if (boost::has_trivial_copy_constructor::value && @@ -979,15 +978,15 @@ namespace boost { boost::detail::function::function_allows_small_object_optimization::value) value |= static_cast(0x01); vtable = reinterpret_cast(value); - } else + } else vtable = 0; } - // Moves the value from the specified argument to *this. If the argument - // has its function object allocated on the heap, move_assign will pass - // its buffer to *this, and set the argument's buffer pointer to NULL. - void move_assign(BOOST_FUNCTION_FUNCTION& f) - { + // Moves the value from the specified argument to *this. If the argument + // has its function object allocated on the heap, move_assign will pass + // its buffer to *this, and set the argument's buffer pointer to NULL. + void move_assign(BOOST_FUNCTION_FUNCTION& f) + { if (&f == this) return; @@ -1098,7 +1097,7 @@ public: function(self_type&& f): base_type(static_cast(f)){} function(base_type&& f): base_type(static_cast(f)){} #endif - + self_type& operator=(const self_type& f) { self_type(f).swap(*this); @@ -1111,7 +1110,7 @@ public: self_type(static_cast(f)).swap(*this); return *this; } -#endif +#endif template #ifndef BOOST_NO_SFINAE @@ -1140,14 +1139,14 @@ public: self_type(f).swap(*this); return *this; } - + #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES self_type& operator=(base_type&& f) { self_type(static_cast(f)).swap(*this); return *this; } -#endif +#endif }; #undef BOOST_FUNCTION_PARTIAL_SPEC @@ -1187,4 +1186,4 @@ public: #if defined(BOOST_MSVC) # pragma warning( pop ) -#endif +#endif diff --git a/contrib/src/boost/move/algo/move.hpp b/contrib/src/boost/move/algo/move.hpp new file mode 100644 index 0000000..d35f04a --- /dev/null +++ b/contrib/src/boost/move/algo/move.hpp @@ -0,0 +1,155 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2012-2016. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// See http://www.boost.org/libs/move for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +//! \file + +#ifndef BOOST_MOVE_ALGO_MOVE_HPP +#define BOOST_MOVE_ALGO_MOVE_HPP + +#ifndef BOOST_CONFIG_HPP +# include +#endif +# +#if defined(BOOST_HAS_PRAGMA_ONCE) +# pragma once +#endif + +#include + +#include +#include +#include + +namespace boost { + +////////////////////////////////////////////////////////////////////////////// +// +// move +// +////////////////////////////////////////////////////////////////////////////// + +#if !defined(BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE) + + //! Effects: Moves elements in the range [first,last) into the range [result,result + (last - + //! first)) starting from first and proceeding to last. For each non-negative integer n < (last-first), + //! performs *(result + n) = ::boost::move (*(first + n)). + //! + //! Effects: result + (last - first). + //! + //! Requires: result shall not be in the range [first,last). + //! + //! Complexity: Exactly last - first move assignments. + template // O models OutputIterator + O move(I f, I l, O result) + { + while (f != l) { + *result = ::boost::move(*f); + ++f; ++result; + } + return result; + } + + ////////////////////////////////////////////////////////////////////////////// + // + // move_backward + // + ////////////////////////////////////////////////////////////////////////////// + + //! Effects: Moves elements in the range [first,last) into the range + //! [result - (last-first),result) starting from last - 1 and proceeding to + //! first. For each positive integer n <= (last - first), + //! performs *(result - n) = ::boost::move(*(last - n)). + //! + //! Requires: result shall not be in the range [first,last). + //! + //! Returns: result - (last - first). + //! + //! Complexity: Exactly last - first assignments. + template // O models BidirectionalIterator + O move_backward(I f, I l, O result) + { + while (f != l) { + --l; --result; + *result = ::boost::move(*l); + } + return result; + } + +#else + + using ::std::move_backward; + +#endif //!defined(BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE) + +////////////////////////////////////////////////////////////////////////////// +// +// uninitialized_move +// +////////////////////////////////////////////////////////////////////////////// + +//! Effects: +//! \code +//! for (; first != last; ++result, ++first) +//! new (static_cast(&*result)) +//! typename iterator_traits::value_type(boost::move(*first)); +//! \endcode +//! +//! Returns: result +template + // F models ForwardIterator +F uninitialized_move(I f, I l, F r + /// @cond +// ,typename ::boost::move_detail::enable_if::value_type> >::type* = 0 + /// @endcond + ) +{ + typedef typename boost::movelib::iterator_traits::value_type input_value_type; + + F back = r; + BOOST_TRY{ + while (f != l) { + void * const addr = static_cast(::boost::move_detail::addressof(*r)); + ::new(addr) input_value_type(::boost::move(*f)); + ++f; ++r; + } + } + BOOST_CATCH(...){ + for (; back != r; ++back){ + back->~input_value_type(); + } + BOOST_RETHROW; + } + BOOST_CATCH_END + return r; +} + +/// @cond +/* +template + // F models ForwardIterator +F uninitialized_move(I f, I l, F r, + typename ::boost::move_detail::disable_if::value_type> >::type* = 0) +{ + return std::uninitialized_copy(f, l, r); +} +*/ + +/// @endcond + +} //namespace boost { + +#include + +#endif //#ifndef BOOST_MOVE_ALGO_MOVE_HPP diff --git a/contrib/src/boost/move/algorithm.hpp b/contrib/src/boost/move/algorithm.hpp index fbda0f4..825d771 100644 --- a/contrib/src/boost/move/algorithm.hpp +++ b/contrib/src/boost/move/algorithm.hpp @@ -26,6 +26,7 @@ #include #include +#include #include #include //copy, copy_backward @@ -35,122 +36,6 @@ namespace boost { ////////////////////////////////////////////////////////////////////////////// // -// move -// -////////////////////////////////////////////////////////////////////////////// - -#if !defined(BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE) - - //! Effects: Moves elements in the range [first,last) into the range [result,result + (last - - //! first)) starting from first and proceeding to last. For each non-negative integer n < (last-first), - //! performs *(result + n) = ::boost::move (*(first + n)). - //! - //! Effects: result + (last - first). - //! - //! Requires: result shall not be in the range [first,last). - //! - //! Complexity: Exactly last - first move assignments. - template // O models OutputIterator - O move(I f, I l, O result) - { - while (f != l) { - *result = ::boost::move(*f); - ++f; ++result; - } - return result; - } - - ////////////////////////////////////////////////////////////////////////////// - // - // move_backward - // - ////////////////////////////////////////////////////////////////////////////// - - //! Effects: Moves elements in the range [first,last) into the range - //! [result - (last-first),result) starting from last - 1 and proceeding to - //! first. For each positive integer n <= (last - first), - //! performs *(result - n) = ::boost::move(*(last - n)). - //! - //! Requires: result shall not be in the range [first,last). - //! - //! Returns: result - (last - first). - //! - //! Complexity: Exactly last - first assignments. - template // O models BidirectionalIterator - O move_backward(I f, I l, O result) - { - while (f != l) { - --l; --result; - *result = ::boost::move(*l); - } - return result; - } - -#else - - using ::std::move_backward; - -#endif //!defined(BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE) - -////////////////////////////////////////////////////////////////////////////// -// -// uninitialized_move -// -////////////////////////////////////////////////////////////////////////////// - -//! Effects: -//! \code -//! for (; first != last; ++result, ++first) -//! new (static_cast(&*result)) -//! typename iterator_traits::value_type(boost::move(*first)); -//! \endcode -//! -//! Returns: result -template - // F models ForwardIterator -F uninitialized_move(I f, I l, F r - /// @cond -// ,typename ::boost::move_detail::enable_if::value_type> >::type* = 0 - /// @endcond - ) -{ - typedef typename std::iterator_traits::value_type input_value_type; - - F back = r; - BOOST_TRY{ - while (f != l) { - void * const addr = static_cast(::boost::move_detail::addressof(*r)); - ::new(addr) input_value_type(::boost::move(*f)); - ++f; ++r; - } - } - BOOST_CATCH(...){ - for (; back != r; ++back){ - back->~input_value_type(); - } - BOOST_RETHROW; - } - BOOST_CATCH_END - return r; -} - -/// @cond -/* -template - // F models ForwardIterator -F uninitialized_move(I f, I l, F r, - typename ::boost::move_detail::disable_if::value_type> >::type* = 0) -{ - return std::uninitialized_copy(f, l, r); -} -*/ - -////////////////////////////////////////////////////////////////////////////// -// // uninitialized_copy_or_move // ////////////////////////////////////////////////////////////////////////////// diff --git a/contrib/src/boost/move/core.hpp b/contrib/src/boost/move/core.hpp index 54aece0..1dd8a8c 100644 --- a/contrib/src/boost/move/core.hpp +++ b/contrib/src/boost/move/core.hpp @@ -197,7 +197,7 @@ namespace move_detail { template - inline typename ::boost::move_detail::enable_if_c + BOOST_MOVE_FORCEINLINE typename ::boost::move_detail::enable_if_c < ::boost::move_detail::is_lvalue_reference::value || !::boost::has_move_emulation_enabled::value , T&>::type @@ -207,7 +207,7 @@ } template - inline typename ::boost::move_detail::enable_if_c + BOOST_MOVE_FORCEINLINE typename ::boost::move_detail::enable_if_c < !::boost::move_detail::is_lvalue_reference::value && ::boost::has_move_emulation_enabled::value , ::boost::rv&>::type @@ -217,7 +217,7 @@ } template - inline typename ::boost::move_detail::enable_if_c + BOOST_MOVE_FORCEINLINE typename ::boost::move_detail::enable_if_c < !::boost::move_detail::is_lvalue_reference::value && ::boost::has_move_emulation_enabled::value , ::boost::rv&>::type @@ -245,9 +245,9 @@ #define BOOST_MOVABLE_BUT_NOT_COPYABLE(TYPE)\ BOOST_MOVE_IMPL_NO_COPY_CTOR_OR_ASSIGN(TYPE)\ public:\ - operator ::boost::rv&() \ + BOOST_MOVE_FORCEINLINE operator ::boost::rv&() \ { return *BOOST_MOVE_TO_RV_CAST(::boost::rv*, this); }\ - operator const ::boost::rv&() const \ + BOOST_MOVE_FORCEINLINE operator const ::boost::rv&() const \ { return *BOOST_MOVE_TO_RV_CAST(const ::boost::rv*, this); }\ private:\ // @@ -260,21 +260,21 @@ #define BOOST_COPYABLE_AND_MOVABLE(TYPE)\ public:\ - TYPE& operator=(TYPE &t)\ - { this->operator=(const_cast(t)); return *this;}\ + BOOST_MOVE_FORCEINLINE TYPE& operator=(TYPE &t)\ + { this->operator=(const_cast(t)); return *this;}\ public:\ - operator ::boost::rv&() \ + BOOST_MOVE_FORCEINLINE operator ::boost::rv&() \ { return *BOOST_MOVE_TO_RV_CAST(::boost::rv*, this); }\ - operator const ::boost::rv&() const \ + BOOST_MOVE_FORCEINLINE operator const ::boost::rv&() const \ { return *BOOST_MOVE_TO_RV_CAST(const ::boost::rv*, this); }\ private:\ // #define BOOST_COPYABLE_AND_MOVABLE_ALT(TYPE)\ public:\ - operator ::boost::rv&() \ + BOOST_MOVE_FORCEINLINE operator ::boost::rv&() \ { return *BOOST_MOVE_TO_RV_CAST(::boost::rv*, this); }\ - operator const ::boost::rv&() const \ + BOOST_MOVE_FORCEINLINE operator const ::boost::rv&() const \ { return *BOOST_MOVE_TO_RV_CAST(const ::boost::rv*, this); }\ private:\ // @@ -301,6 +301,7 @@ BOOST_MOVE_IMPL_NO_COPY_CTOR_OR_ASSIGN(TYPE)\ public:\ typedef int boost_move_emulation_t;\ + private:\ // //! This macro marks a type as copyable and movable. @@ -450,7 +451,7 @@ namespace move_detail { template - inline typename ::boost::move_detail::enable_if_c + BOOST_MOVE_FORCEINLINE typename ::boost::move_detail::enable_if_c < ::boost::move_detail::is_lvalue_reference::value , T&>::type move_return(T& x) BOOST_NOEXCEPT @@ -459,7 +460,7 @@ } template - inline typename ::boost::move_detail::enable_if_c + BOOST_MOVE_FORCEINLINE typename ::boost::move_detail::enable_if_c < !::boost::move_detail::is_lvalue_reference::value , Ret && >::type move_return(T&& t) BOOST_NOEXCEPT diff --git a/contrib/src/boost/move/detail/config_begin.hpp b/contrib/src/boost/move/detail/config_begin.hpp index 342390b..637eb15 100644 --- a/contrib/src/boost/move/detail/config_begin.hpp +++ b/contrib/src/boost/move/detail/config_begin.hpp @@ -16,4 +16,6 @@ # pragma warning (disable : 4324) // structure was padded due to __declspec(align()) # pragma warning (disable : 4675) // "function": resolved overload was found by argument-dependent lookup # pragma warning (disable : 4996) // "function": was declared deprecated (_CRT_SECURE_NO_DEPRECATE/_SCL_SECURE_NO_WARNINGS) +# pragma warning (disable : 4714) // "function": marked as __forceinline not inlined +# pragma warning (disable : 4127) // conditional expression is constant #endif diff --git a/contrib/src/boost/move/detail/iterator_traits.hpp b/contrib/src/boost/move/detail/iterator_traits.hpp index a75ee03..5ffcb2c 100644 --- a/contrib/src/boost/move/detail/iterator_traits.hpp +++ b/contrib/src/boost/move/detail/iterator_traits.hpp @@ -23,6 +23,7 @@ #endif #include +#include #include BOOST_MOVE_STD_NS_BEG @@ -46,6 +47,7 @@ struct iterator_traits typedef typename Iterator::pointer pointer; typedef typename Iterator::reference reference; typedef typename Iterator::iterator_category iterator_category; + typedef typename boost::move_detail::make_unsigned::type size_type; }; template @@ -56,6 +58,7 @@ struct iterator_traits typedef T* pointer; typedef T& reference; typedef std::random_access_iterator_tag iterator_category; + typedef typename boost::move_detail::make_unsigned::type size_type; }; template @@ -66,6 +69,7 @@ struct iterator_traits typedef const T* pointer; typedef const T& reference; typedef std::random_access_iterator_tag iterator_category; + typedef typename boost::move_detail::make_unsigned::type size_type; }; }} //namespace boost { namespace movelib{ diff --git a/contrib/src/boost/move/detail/meta_utils.hpp b/contrib/src/boost/move/detail/meta_utils.hpp index 323c13a..e45394c 100644 --- a/contrib/src/boost/move/detail/meta_utils.hpp +++ b/contrib/src/boost/move/detail/meta_utils.hpp @@ -14,13 +14,11 @@ #ifndef BOOST_MOVE_DETAIL_META_UTILS_HPP #define BOOST_MOVE_DETAIL_META_UTILS_HPP -#ifndef BOOST_CONFIG_HPP -# include -#endif -# #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif +#include +#include //forceinline #include #include //for std::size_t @@ -245,8 +243,8 @@ template struct addr_impl_ref { T & v_; - inline addr_impl_ref( T & v ): v_( v ) {} - inline operator T& () const { return v_; } + BOOST_MOVE_FORCEINLINE addr_impl_ref( T & v ): v_( v ) {} + BOOST_MOVE_FORCEINLINE operator T& () const { return v_; } private: addr_impl_ref & operator=(const addr_impl_ref &); @@ -255,18 +253,18 @@ struct addr_impl_ref template struct addressof_impl { - static inline T * f( T & v, long ) + BOOST_MOVE_FORCEINLINE static T * f( T & v, long ) { return reinterpret_cast( &const_cast(reinterpret_cast(v))); } - static inline T * f( T * v, int ) + BOOST_MOVE_FORCEINLINE static T * f( T * v, int ) { return v; } }; template -inline T * addressof( T & v ) +BOOST_MOVE_FORCEINLINE T * addressof( T & v ) { return ::boost::move_detail::addressof_impl::f ( ::boost::move_detail::addr_impl_ref( v ), 0 ); @@ -314,6 +312,17 @@ class is_convertible #endif +template ::value> +struct is_same_or_convertible + : is_convertible +{}; + +template +struct is_same_or_convertible +{ + static const bool value = true; +}; + template< bool C , typename F1 @@ -347,6 +356,16 @@ struct disable_if_convertible : disable_if< is_convertible, R> {}; +template +struct enable_if_same_or_convertible + : enable_if< is_same_or_convertible, R> +{}; + +template +struct disable_if_same_or_convertible + : disable_if< is_same_or_convertible, R> +{}; + ////////////////////////////////////////////////////////////////////////////// // // and_ @@ -561,4 +580,6 @@ template< class T > struct remove_rvalue_reference { typedef T type; }; } //namespace move_detail { } //namespace boost { +#include + #endif //#ifndef BOOST_MOVE_DETAIL_META_UTILS_HPP diff --git a/contrib/src/boost/move/detail/meta_utils_core.hpp b/contrib/src/boost/move/detail/meta_utils_core.hpp index 4d715a0..40dbb6e 100644 --- a/contrib/src/boost/move/detail/meta_utils_core.hpp +++ b/contrib/src/boost/move/detail/meta_utils_core.hpp @@ -114,6 +114,18 @@ struct is_same static const bool value = true; }; +////////////////////////////////////// +// enable_if_same +////////////////////////////////////// +template +struct enable_if_same : enable_if, R> {}; + +////////////////////////////////////// +// disable_if_same +////////////////////////////////////// +template +struct disable_if_same : disable_if, R> {}; + } //namespace move_detail { } //namespace boost { diff --git a/contrib/src/boost/move/detail/type_traits.hpp b/contrib/src/boost/move/detail/type_traits.hpp index 816fdca..1b5d838 100644 --- a/contrib/src/boost/move/detail/type_traits.hpp +++ b/contrib/src/boost/move/detail/type_traits.hpp @@ -55,8 +55,10 @@ // BOOST_MOVE_IS_POD(T) should evaluate to true if T is a POD type // BOOST_MOVE_HAS_TRIVIAL_CONSTRUCTOR(T) should evaluate to true if "T x;" has no effect // BOOST_MOVE_HAS_TRIVIAL_COPY(T) should evaluate to true if T(t) <==> memcpy +// (Note: this trait does not guarantee T is copy constructible, the copy constructor could be deleted but still be trivial) // BOOST_MOVE_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T) should evaluate to true if T(boost::move(t)) <==> memcpy // BOOST_MOVE_HAS_TRIVIAL_ASSIGN(T) should evaluate to true if t = u <==> memcpy +// (Note: this trait does not guarantee T is assignable , the copy assignmen could be deleted but still be trivial) // BOOST_MOVE_HAS_TRIVIAL_MOVE_ASSIGN(T) should evaluate to true if t = boost::move(u) <==> memcpy // BOOST_MOVE_HAS_TRIVIAL_DESTRUCTOR(T) should evaluate to true if ~T() has no effect // BOOST_MOVE_HAS_NOTHROW_CONSTRUCTOR(T) should evaluate to true if "T x;" can not throw @@ -117,9 +119,7 @@ # define BOOST_MOVE_HAS_TRIVIAL_CONSTRUCTOR(T) __has_trivial_constructor(T) # endif # if __has_feature(has_trivial_copy) -# //There are problems with deleted copy constructors detected as trivially copyable. -# //http://stackoverflow.com/questions/12754886/has-trivial-copy-behaves-differently-in-clang-and-gcc-whos-right -# define BOOST_MOVE_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T) && ::boost::move_detail::is_copy_constructible::value) +# define BOOST_MOVE_HAS_TRIVIAL_COPY(T) __has_trivial_copy(T) # endif # if __has_feature(has_trivial_assign) # define BOOST_MOVE_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) ) @@ -235,7 +235,9 @@ #endif #ifdef BOOST_MOVE_HAS_TRIVIAL_COPY - #define BOOST_MOVE_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T) BOOST_MOVE_HAS_TRIVIAL_COPY(T) + #define BOOST_MOVE_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T) ::boost::move_detail::is_pod::value ||\ + (::boost::move_detail::is_copy_constructible::value &&\ + BOOST_MOVE_HAS_TRIVIAL_COPY(T)) #else #define BOOST_MOVE_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T) ::boost::move_detail::is_pod::value #endif @@ -246,12 +248,6 @@ #define BOOST_MOVE_IS_TRIVIALLY_DEFAULT_CONSTRUCTIBLE(T) ::boost::move_detail::is_pod::value #endif -#ifdef BOOST_MOVE_HAS_TRIVIAL_COPY - #define BOOST_MOVE_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T) BOOST_MOVE_HAS_TRIVIAL_COPY(T) -#else - #define BOOST_MOVE_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T) ::boost::move_detail::is_pod::value -#endif - #ifdef BOOST_MOVE_HAS_TRIVIAL_MOVE_CONSTRUCTOR #define BOOST_MOVE_IS_TRIVIALLY_MOVE_CONSTRUCTIBLE(T) BOOST_MOVE_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T) #else @@ -259,7 +255,9 @@ #endif #ifdef BOOST_MOVE_HAS_TRIVIAL_ASSIGN - #define BOOST_MOVE_IS_TRIVIALLY_COPY_ASSIGNABLE(T) BOOST_MOVE_HAS_TRIVIAL_ASSIGN(T) + #define BOOST_MOVE_IS_TRIVIALLY_COPY_ASSIGNABLE(T) ::boost::move_detail::is_pod::value ||\ + ( ::boost::move_detail::is_copy_assignable::value &&\ + BOOST_MOVE_HAS_TRIVIAL_ASSIGN(T)) #else #define BOOST_MOVE_IS_TRIVIALLY_COPY_ASSIGNABLE(T) ::boost::move_detail::is_pod::value #endif @@ -821,9 +819,7 @@ struct is_trivially_copy_constructible { //In several compilers BOOST_MOVE_IS_TRIVIALLY_COPY_CONSTRUCTIBLE return true even with //deleted copy constructors so make sure the type is copy constructible. - static const bool value = ::boost::move_detail::is_pod::value || - ( ::boost::move_detail::is_copy_constructible::value && - BOOST_MOVE_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T) ); + static const bool value = BOOST_MOVE_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T); }; ////////////////////////////////////// @@ -831,7 +827,7 @@ struct is_trivially_copy_constructible ////////////////////////////////////// template struct is_trivially_move_constructible -{ static const bool value = BOOST_MOVE_IS_TRIVIALLY_MOVE_CONSTRUCTIBLE(T); }; +{ static const bool value = BOOST_MOVE_IS_TRIVIALLY_MOVE_CONSTRUCTIBLE(T); }; ////////////////////////////////////// // is_trivially_copy_assignable @@ -841,9 +837,7 @@ struct is_trivially_copy_assignable { //In several compilers BOOST_MOVE_IS_TRIVIALLY_COPY_CONSTRUCTIBLE return true even with //deleted copy constructors so make sure the type is copy constructible. - static const bool value = ::boost::move_detail::is_pod::value || - ( ::boost::move_detail::is_copy_assignable::value && - BOOST_MOVE_IS_TRIVIALLY_COPY_ASSIGNABLE(T) ); + static const bool value = BOOST_MOVE_IS_TRIVIALLY_COPY_ASSIGNABLE(T); }; ////////////////////////////////////// @@ -1005,7 +999,7 @@ BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT(0x1000) template union aligned_union -{ +{ T aligner; char dummy[Len]; }; @@ -1023,7 +1017,7 @@ struct aligned_next //End of search defaults to max_align_t template struct aligned_next -{ typedef aligned_union type; }; +{ typedef aligned_union type; }; //Now define a search list through types #define BOOST_MOVE_ALIGNED_NEXT_STEP(TYPE, NEXT_TYPE)\ diff --git a/contrib/src/boost/move/detail/workaround.hpp b/contrib/src/boost/move/detail/workaround.hpp index b3f81b1..1d16f24 100644 --- a/contrib/src/boost/move/detail/workaround.hpp +++ b/contrib/src/boost/move/detail/workaround.hpp @@ -52,4 +52,18 @@ #define BOOST_MOVE_MSVC_AUTO_MOVE_RETURN_BUG #endif +#if defined(BOOST_MOVE_DISABLE_FORCEINLINE) + #define BOOST_MOVE_FORCEINLINE inline +#elif defined(BOOST_MOVE_FORCEINLINE_IS_BOOST_FORCELINE) + #define BOOST_MOVE_FORCEINLINE BOOST_FORCEINLINE +#elif defined(BOOST_MSVC) && defined(_DEBUG) + //"__forceinline" and MSVC seems to have some bugs in debug mode + #define BOOST_MOVE_FORCEINLINE inline +#elif defined(__GNUC__) && ((__GNUC__ < 4) || (__GNUC__ == 4 && (__GNUC_MINOR__ < 5))) + //Older GCCs have problems with forceinline + #define BOOST_MOVE_FORCEINLINE inline +#else + #define BOOST_MOVE_FORCEINLINE BOOST_FORCEINLINE +#endif + #endif //#ifndef BOOST_MOVE_DETAIL_WORKAROUND_HPP diff --git a/contrib/src/boost/move/iterator.hpp b/contrib/src/boost/move/iterator.hpp index 1b39e26..f36df23 100644 --- a/contrib/src/boost/move/iterator.hpp +++ b/contrib/src/boost/move/iterator.hpp @@ -23,6 +23,7 @@ #endif #include +#include //forceinline #include #include @@ -57,22 +58,20 @@ class move_iterator typedef typename boost::movelib::iterator_traits::difference_type difference_type; typedef typename boost::movelib::iterator_traits::iterator_category iterator_category; - move_iterator() + BOOST_MOVE_FORCEINLINE move_iterator() + : m_it() {} - explicit move_iterator(It i) + BOOST_MOVE_FORCEINLINE explicit move_iterator(const It &i) : m_it(i) {} template - move_iterator(const move_iterator& u) - : m_it(u.base()) + BOOST_MOVE_FORCEINLINE move_iterator(const move_iterator& u) + : m_it(u.m_it) {} - iterator_type base() const - { return m_it; } - - reference operator*() const + BOOST_MOVE_FORCEINLINE reference operator*() const { #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || defined(BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES) return *m_it; @@ -81,34 +80,34 @@ class move_iterator #endif } - pointer operator->() const + BOOST_MOVE_FORCEINLINE pointer operator->() const { return m_it; } - move_iterator& operator++() + BOOST_MOVE_FORCEINLINE move_iterator& operator++() { ++m_it; return *this; } - move_iterator operator++(int) + BOOST_MOVE_FORCEINLINE move_iterator operator++(int) { move_iterator tmp(*this); ++(*this); return tmp; } - move_iterator& operator--() + BOOST_MOVE_FORCEINLINE move_iterator& operator--() { --m_it; return *this; } - move_iterator operator--(int) + BOOST_MOVE_FORCEINLINE move_iterator operator--(int) { move_iterator tmp(*this); --(*this); return tmp; } move_iterator operator+ (difference_type n) const { return move_iterator(m_it + n); } - move_iterator& operator+=(difference_type n) + BOOST_MOVE_FORCEINLINE move_iterator& operator+=(difference_type n) { m_it += n; return *this; } - move_iterator operator- (difference_type n) const + BOOST_MOVE_FORCEINLINE move_iterator operator- (difference_type n) const { return move_iterator(m_it - n); } - move_iterator& operator-=(difference_type n) + BOOST_MOVE_FORCEINLINE move_iterator& operator-=(difference_type n) { m_it -= n; return *this; } - reference operator[](difference_type n) const + BOOST_MOVE_FORCEINLINE reference operator[](difference_type n) const { #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || defined(BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES) return m_it[n]; @@ -117,29 +116,29 @@ class move_iterator #endif } - friend bool operator==(const move_iterator& x, const move_iterator& y) - { return x.base() == y.base(); } + BOOST_MOVE_FORCEINLINE friend bool operator==(const move_iterator& x, const move_iterator& y) + { return x.m_it == y.m_it; } - friend bool operator!=(const move_iterator& x, const move_iterator& y) - { return x.base() != y.base(); } + BOOST_MOVE_FORCEINLINE friend bool operator!=(const move_iterator& x, const move_iterator& y) + { return x.m_it != y.m_it; } - friend bool operator< (const move_iterator& x, const move_iterator& y) - { return x.base() < y.base(); } + BOOST_MOVE_FORCEINLINE friend bool operator< (const move_iterator& x, const move_iterator& y) + { return x.m_it < y.m_it; } - friend bool operator<=(const move_iterator& x, const move_iterator& y) - { return x.base() <= y.base(); } + BOOST_MOVE_FORCEINLINE friend bool operator<=(const move_iterator& x, const move_iterator& y) + { return x.m_it <= y.m_it; } - friend bool operator> (const move_iterator& x, const move_iterator& y) - { return x.base() > y.base(); } + BOOST_MOVE_FORCEINLINE friend bool operator> (const move_iterator& x, const move_iterator& y) + { return x.m_it > y.m_it; } - friend bool operator>=(const move_iterator& x, const move_iterator& y) - { return x.base() >= y.base(); } + BOOST_MOVE_FORCEINLINE friend bool operator>=(const move_iterator& x, const move_iterator& y) + { return x.m_it >= y.m_it; } - friend difference_type operator-(const move_iterator& x, const move_iterator& y) - { return x.base() - y.base(); } + BOOST_MOVE_FORCEINLINE friend difference_type operator-(const move_iterator& x, const move_iterator& y) + { return x.m_it - y.m_it; } - friend move_iterator operator+(difference_type n, const move_iterator& x) - { return move_iterator(x.base() + n); } + BOOST_MOVE_FORCEINLINE friend move_iterator operator+(difference_type n, const move_iterator& x) + { return move_iterator(x.m_it + n); } private: It m_it; diff --git a/contrib/src/boost/move/utility.hpp b/contrib/src/boost/move/utility.hpp index 8f9c20b..28de793 100644 --- a/contrib/src/boost/move/utility.hpp +++ b/contrib/src/boost/move/utility.hpp @@ -25,6 +25,7 @@ #endif #include +#include //forceinline #include #include @@ -39,7 +40,7 @@ ////////////////////////////////////////////////////////////////////////////// template - inline typename ::boost::move_detail::enable_if_c + BOOST_MOVE_FORCEINLINE typename ::boost::move_detail::enable_if_c < enable_move_utility_emulation::value && !has_move_emulation_enabled::value , typename ::boost::move_detail::add_const::type & >::type @@ -49,7 +50,7 @@ } template - inline typename ::boost::move_detail::enable_if_c + BOOST_MOVE_FORCEINLINE typename ::boost::move_detail::enable_if_c < enable_move_utility_emulation::value && has_move_emulation_enabled::value && ::boost::move_detail::is_nothrow_move_constructible_or_uncopyable::value, rv&>::type move_if_noexcept(T& x) BOOST_NOEXCEPT @@ -58,7 +59,7 @@ } template - inline typename ::boost::move_detail::enable_if_c + BOOST_MOVE_FORCEINLINE typename ::boost::move_detail::enable_if_c < enable_move_utility_emulation::value && has_move_emulation_enabled::value && ::boost::move_detail::is_nothrow_move_constructible_or_uncopyable::value , rv& @@ -69,7 +70,7 @@ } template - inline typename ::boost::move_detail::enable_if_c + BOOST_MOVE_FORCEINLINE typename ::boost::move_detail::enable_if_c < enable_move_utility_emulation::value && has_move_emulation_enabled::value && !::boost::move_detail::is_nothrow_move_constructible_or_uncopyable::value , typename ::boost::move_detail::add_const::type & @@ -80,7 +81,7 @@ } template - inline typename ::boost::move_detail::enable_if_c + BOOST_MOVE_FORCEINLINE typename ::boost::move_detail::enable_if_c < enable_move_utility_emulation::value && has_move_emulation_enabled::value && !::boost::move_detail::is_nothrow_move_constructible_or_uncopyable::value , typename ::boost::move_detail::add_const::type & @@ -125,13 +126,13 @@ #else //BOOST_MOVE_DOXYGEN_INVOKED template - typename ::boost::move_detail::enable_if_c + BOOST_MOVE_FORCEINLINE typename ::boost::move_detail::enable_if_c < ::boost::move_detail::is_nothrow_move_constructible_or_uncopyable::value, T&&>::type move_if_noexcept(T& x) BOOST_NOEXCEPT { return ::boost::move(x); } template - typename ::boost::move_detail::enable_if_c + BOOST_MOVE_FORCEINLINE typename ::boost::move_detail::enable_if_c < !::boost::move_detail::is_nothrow_move_constructible_or_uncopyable::value, const T&>::type move_if_noexcept(T& x) BOOST_NOEXCEPT { return x; } diff --git a/contrib/src/boost/move/utility_core.hpp b/contrib/src/boost/move/utility_core.hpp index 7fd1ea1..55042a9 100644 --- a/contrib/src/boost/move/utility_core.hpp +++ b/contrib/src/boost/move/utility_core.hpp @@ -26,6 +26,7 @@ #endif #include +#include //forceinline #include #include #include @@ -47,7 +48,7 @@ ////////////////////////////////////////////////////////////////////////////// template - inline typename ::boost::move_detail::enable_if_and + BOOST_MOVE_FORCEINLINE typename ::boost::move_detail::enable_if_and < T & , enable_move_utility_emulation , has_move_emulation_disabled @@ -58,7 +59,7 @@ } template - inline typename ::boost::move_detail::enable_if_and + BOOST_MOVE_FORCEINLINE typename ::boost::move_detail::enable_if_and < rv& , enable_move_utility_emulation , has_move_emulation_enabled @@ -69,7 +70,7 @@ } template - inline typename ::boost::move_detail::enable_if_and + BOOST_MOVE_FORCEINLINE typename ::boost::move_detail::enable_if_and < rv& , enable_move_utility_emulation , has_move_emulation_enabled @@ -86,7 +87,7 @@ ////////////////////////////////////////////////////////////////////////////// template - inline typename ::boost::move_detail::enable_if_and + BOOST_MOVE_FORCEINLINE typename ::boost::move_detail::enable_if_and < T & , enable_move_utility_emulation , ::boost::move_detail::is_rv @@ -97,7 +98,7 @@ } template - inline typename ::boost::move_detail::enable_if_and + BOOST_MOVE_FORCEINLINE typename ::boost::move_detail::enable_if_and < const T & , enable_move_utility_emulation , ::boost::move_detail::is_not_rv @@ -114,7 +115,7 @@ ////////////////////////////////////////////////////////////////////////////// template - inline typename ::boost::move_detail::enable_if_and + BOOST_MOVE_FORCEINLINE typename ::boost::move_detail::enable_if_and < T & , enable_move_utility_emulation , ::boost::move_detail::is_rv @@ -125,7 +126,7 @@ } template - inline typename ::boost::move_detail::enable_if_and + BOOST_MOVE_FORCEINLINE typename ::boost::move_detail::enable_if_and < typename ::boost::move_detail::add_lvalue_reference::type , enable_move_utility_emulation , ::boost::move_detail::is_not_rv @@ -140,7 +141,7 @@ } template - inline typename ::boost::move_detail::enable_if_and + BOOST_MOVE_FORCEINLINE typename ::boost::move_detail::enable_if_and < rv& , enable_move_utility_emulation , ::boost::move_detail::is_not_rv @@ -202,13 +203,13 @@ //Old move approach, lvalues could bind to rvalue references template - inline typename ::boost::move_detail::remove_reference::type && move(T&& t) BOOST_NOEXCEPT + BOOST_MOVE_FORCEINLINE typename ::boost::move_detail::remove_reference::type && move(T&& t) BOOST_NOEXCEPT { return t; } #else //BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES template - inline typename ::boost::move_detail::remove_reference::type && move(T&& t) BOOST_NOEXCEPT + BOOST_MOVE_FORCEINLINE typename ::boost::move_detail::remove_reference::type && move(T&& t) BOOST_NOEXCEPT { return static_cast::type &&>(t); } #endif //BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES @@ -238,17 +239,17 @@ //Old move approach, lvalues could bind to rvalue references template - inline T&& forward(typename ::boost::move_detail::identity::type&& t) BOOST_NOEXCEPT + BOOST_MOVE_FORCEINLINE T&& forward(typename ::boost::move_detail::identity::type&& t) BOOST_NOEXCEPT { return t; } #else //Old move template - inline T&& forward(typename ::boost::move_detail::remove_reference::type& t) BOOST_NOEXCEPT + BOOST_MOVE_FORCEINLINE T&& forward(typename ::boost::move_detail::remove_reference::type& t) BOOST_NOEXCEPT { return static_cast(t); } template - inline T&& forward(typename ::boost::move_detail::remove_reference::type&& t) BOOST_NOEXCEPT + BOOST_MOVE_FORCEINLINE T&& forward(typename ::boost::move_detail::remove_reference::type&& t) BOOST_NOEXCEPT { //"boost::forward error: 'T' is a lvalue reference, can't forward as rvalue."; BOOST_STATIC_ASSERT(!boost::move_detail::is_lvalue_reference::value); @@ -273,17 +274,17 @@ //Old move approach, lvalues could bind to rvalue references template - inline T&& move_if_not_lvalue_reference(typename ::boost::move_detail::identity::type&& t) BOOST_NOEXCEPT + BOOST_MOVE_FORCEINLINE T&& move_if_not_lvalue_reference(typename ::boost::move_detail::identity::type&& t) BOOST_NOEXCEPT { return t; } #else //Old move template - inline T&& move_if_not_lvalue_reference(typename ::boost::move_detail::remove_reference::type& t) BOOST_NOEXCEPT + BOOST_MOVE_FORCEINLINE T&& move_if_not_lvalue_reference(typename ::boost::move_detail::remove_reference::type& t) BOOST_NOEXCEPT { return static_cast(t); } template - inline T&& move_if_not_lvalue_reference(typename ::boost::move_detail::remove_reference::type&& t) BOOST_NOEXCEPT + BOOST_MOVE_FORCEINLINE T&& move_if_not_lvalue_reference(typename ::boost::move_detail::remove_reference::type&& t) BOOST_NOEXCEPT { //"boost::forward error: 'T' is a lvalue reference, can't forward as rvalue."; BOOST_STATIC_ASSERT(!boost::move_detail::is_lvalue_reference::value); diff --git a/contrib/src/boost/predef/hardware/simd.h b/contrib/src/boost/predef/hardware/simd.h index 4de1e70..ac5c9da 100644 --- a/contrib/src/boost/predef/hardware/simd.h +++ b/contrib/src/boost/predef/hardware/simd.h @@ -77,12 +77,24 @@ http://www.boost.org/LICENSE_1_0.txt) # error "Multiple SIMD architectures detected, this cannot happen!" #endif -#if defined(BOOST_HW_SIMD_X86_AVAILABLE) -# define BOOST_HW_SIMD BOOST_HW_SIMD_X86 +#if defined(BOOST_HW_SIMD_X86_AVAILABLE) && defined(BOOST_HW_SIMD_X86_AMD_AVAILABLE) + // If both standard _X86 and _X86_AMD are available, + // then take the biggest version of the two! +# if BOOST_HW_SIMD_X86 >= BOOST_HW_SIMD_X86_AMD +# define BOOST_HW_SIMD BOOST_HW_SIMD_X86 +# else +# define BOOST_HW_SIMD BOOST_HW_SIMD_X86_AMD +# endif #endif -#if defined(BOOST_HW_SIMD_X86_AMD_AVAILABLE) -# define BOOST_HW_SIMD BOOST_HW_SIMD_X86_AMD +#if !defined(BOOST_HW_SIMD) + // At this point, only one of these two is defined +# if defined(BOOST_HW_SIMD_X86_AVAILABLE) +# define BOOST_HW_SIMD BOOST_HW_SIMD_X86 +# endif +# if defined(BOOST_HW_SIMD_X86_AMD_AVAILABLE) +# define BOOST_HW_SIMD BOOST_HW_SIMD_X86_AMD +# endif #endif #if defined(BOOST_HW_SIMD_ARM_AVAILABLE) diff --git a/contrib/src/boost/predef/hardware/simd/x86.h b/contrib/src/boost/predef/hardware/simd/x86.h index 0874bc4..88bd81e 100644 --- a/contrib/src/boost/predef/hardware/simd/x86.h +++ b/contrib/src/boost/predef/hardware/simd/x86.h @@ -67,7 +67,7 @@ http://www.boost.org/LICENSE_1_0.txt) [[`__FMA__`] [BOOST_HW_SIMD_X86_FMA3_VERSION]] - [[`__AVX2__`] [BOOST_HW_SIMD_x86_AVX2_VERSION]] + [[`__AVX2__`] [BOOST_HW_SIMD_X86_AVX2_VERSION]] ] */ @@ -99,10 +99,10 @@ http://www.boost.org/LICENSE_1_0.txt) #if !defined(BOOST_HW_SIMD_X86) && defined(__SSE3__) # define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_SSE3_VERSION #endif -#if !defined(BOOST_HW_SIMD_X86) && (defined(__SSE2__) || defined(_M_X64) || _M_IX86_FP >= 2) +#if !defined(BOOST_HW_SIMD_X86) && (defined(__SSE2__) || defined(_M_X64) || (defined(_M_IX86_FP) && _M_IX86_FP >= 2)) # define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_SSE2_VERSION #endif -#if !defined(BOOST_HW_SIMD_X86) && (defined(__SSE__) || defined(_M_X64) || _M_IX86_FP >= 1) +#if !defined(BOOST_HW_SIMD_X86) && (defined(__SSE__) || defined(_M_X64) || (defined(_M_IX86_FP) && _M_IX86_FP >= 1)) # define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_SSE_VERSION #endif #if !defined(BOOST_HW_SIMD_X86) && defined(__MMX__) diff --git a/contrib/src/boost/predef/hardware/simd/x86_amd.h b/contrib/src/boost/predef/hardware/simd/x86_amd.h index 60fd448..c80d1ce 100644 --- a/contrib/src/boost/predef/hardware/simd/x86_amd.h +++ b/contrib/src/boost/predef/hardware/simd/x86_amd.h @@ -33,13 +33,13 @@ http://www.boost.org/LICENSE_1_0.txt) [table [[__predef_symbol__] [__predef_version__]] - [[`__SSE4A__`] [BOOST_HW_SIMD_x86_SSE4A_VERSION]] + [[`__SSE4A__`] [BOOST_HW_SIMD_X86_SSE4A_VERSION]] - [[`__FMA4__`] [BOOST_HW_SIMD_x86_FMA4_VERSION]] + [[`__FMA4__`] [BOOST_HW_SIMD_X86_FMA4_VERSION]] - [[`__XOP__`] [BOOST_HW_SIMD_x86_XOP_VERSION]] + [[`__XOP__`] [BOOST_HW_SIMD_X86_XOP_VERSION]] - [[`BOOST_HW_SIMD_X86`] [BOOST_HW_SIMD_x86]] + [[`BOOST_HW_SIMD_X86`] [BOOST_HW_SIMD_X86]] ] [note This predef includes every other x86 SIMD extensions and also has other diff --git a/contrib/src/boost/predef/hardware/simd/x86_amd/versions.h b/contrib/src/boost/predef/hardware/simd/x86_amd/versions.h index a0a9e91..1f9e96c 100644 --- a/contrib/src/boost/predef/hardware/simd/x86_amd/versions.h +++ b/contrib/src/boost/predef/hardware/simd/x86_amd/versions.h @@ -21,7 +21,7 @@ http://www.boost.org/LICENSE_1_0.txt) // --------------------------------- /*` - [heading `BOOST_HW_SIMD_X86_SSE4A_VERSION`] + [heading `BOOST_HW_SIMD_X86_AMD_SSE4A_VERSION`] [@https://en.wikipedia.org/wiki/SSE4##SSE4A SSE4A] x86 extension (AMD specific). @@ -30,16 +30,16 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_HW_SIMD_X86_AMD_SSE4A_VERSION BOOST_VERSION_NUMBER(4, 0, 0) /*` - [heading `BOOST_HW_SIMD_X86_XOP_VERSION`] + [heading `BOOST_HW_SIMD_X86_AMD_FMA4_VERSION`] - [@https://en.wikipedia.org/wiki/XOP_instruction_set XOP] x86 extension (AMD specific). + [@https://en.wikipedia.org/wiki/FMA_instruction_set#FMA4_instruction_set FMA4] x86 extension (AMD specific). Version number is: *5.1.0*. */ #define BOOST_HW_SIMD_X86_AMD_FMA4_VERSION BOOST_VERSION_NUMBER(5, 1, 0) /*` - [heading `BOOST_HW_SIMD_X86_XOP_VERSION`] + [heading `BOOST_HW_SIMD_X86_AMD_XOP_VERSION`] [@https://en.wikipedia.org/wiki/XOP_instruction_set XOP] x86 extension (AMD specific). diff --git a/contrib/src/boost/predef/os/cygwin.h b/contrib/src/boost/predef/os/cygwin.h index 1985c97..9d36f0f 100644 --- a/contrib/src/boost/predef/os/cygwin.h +++ b/contrib/src/boost/predef/os/cygwin.h @@ -29,7 +29,7 @@ http://www.boost.org/LICENSE_1_0.txt) defined(__CYGWIN__) \ ) # undef BOOST_OS_CYGWIN -# define BOOST_OS_CGYWIN BOOST_VERSION_NUMBER_AVAILABLE +# define BOOST_OS_CYGWIN BOOST_VERSION_NUMBER_AVAILABLE #endif #if BOOST_OS_CYGWIN diff --git a/contrib/src/boost/predef/version.h b/contrib/src/boost/predef/version.h index 2fcdefa..8745c94 100644 --- a/contrib/src/boost/predef/version.h +++ b/contrib/src/boost/predef/version.h @@ -1,5 +1,5 @@ /* -Copyright Rene Rivera 2015 +Copyright Rene Rivera 2015-2016 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) @@ -10,6 +10,6 @@ http://www.boost.org/LICENSE_1_0.txt) #include -#define BOOST_PREDEF_VERSION BOOST_VERSION_NUMBER(1,4,0) +#define BOOST_PREDEF_VERSION BOOST_VERSION_NUMBER(1,4,1) #endif diff --git a/contrib/src/boost/preprocessor/config/config.hpp b/contrib/src/boost/preprocessor/config/config.hpp index 835b283..8be0e47 100644 --- a/contrib/src/boost/preprocessor/config/config.hpp +++ b/contrib/src/boost/preprocessor/config/config.hpp @@ -73,7 +73,7 @@ # define BOOST_PP_VARIADICS_MSVC 0 # if !defined BOOST_PP_VARIADICS # /* variadic support explicitly disabled for all untested compilers */ -# if defined __GCCXML__ || defined __CUDACC__ || defined __PATHSCALE__ || defined __DMC__ || defined __CODEGEARC__ || defined __BORLANDC__ || defined __MWERKS__ || ( defined __SUNPRO_CC && __SUNPRO_CC < 0x5130 ) || defined __HP_aCC && !defined __EDG__ || defined __MRC__ || defined __SC__ || defined __IBMCPP__ || defined __PGI +# if defined __GCCXML__ || defined __CUDACC__ || defined __PATHSCALE__ || defined __DMC__ || defined __CODEGEARC__ || defined __BORLANDC__ || defined __MWERKS__ || ( defined __SUNPRO_CC && __SUNPRO_CC < 0x5120 ) || defined __HP_aCC && !defined __EDG__ || defined __MRC__ || defined __SC__ || defined __IBMCPP__ || defined __PGI # define BOOST_PP_VARIADICS 0 # /* VC++ (C/C++) */ # elif defined _MSC_VER && _MSC_VER >= 1400 && (!defined __EDG__ || defined(__INTELLISENSE__)) && !defined __clang__ diff --git a/contrib/src/boost/range/const_iterator.hpp b/contrib/src/boost/range/const_iterator.hpp index 3413e59..727fdad 100644 --- a/contrib/src/boost/range/const_iterator.hpp +++ b/contrib/src/boost/range/const_iterator.hpp @@ -36,7 +36,7 @@ namespace boost BOOST_RANGE_EXTRACT_OPTIONAL_TYPE( const_iterator ) template< typename C > -struct range_const_iterator +struct range_const_iterator_helper : extract_const_iterator {}; @@ -45,7 +45,7 @@ struct range_const_iterator ////////////////////////////////////////////////////////////////////////// template< typename Iterator > -struct range_const_iterator > +struct range_const_iterator_helper > { typedef Iterator type; }; @@ -55,7 +55,7 @@ struct range_const_iterator > ////////////////////////////////////////////////////////////////////////// template< typename T, std::size_t sz > -struct range_const_iterator< T[sz] > +struct range_const_iterator_helper< T[sz] > { typedef const T* type; }; @@ -64,7 +64,7 @@ struct range_const_iterator< T[sz] > template struct range_const_iterator - : range_detail::range_const_iterator< + : range_detail::range_const_iterator_helper< BOOST_DEDUCED_TYPENAME remove_reference::type > { diff --git a/contrib/src/boost/range/size_type.hpp b/contrib/src/boost/range/size_type.hpp index f41c321..0a2ea81 100644 --- a/contrib/src/boost/range/size_type.hpp +++ b/contrib/src/boost/range/size_type.hpp @@ -83,11 +83,6 @@ namespace boost detail::range_size { }; - template< class T > - struct range_size : - detail::range_size - { }; - } // namespace boost diff --git a/contrib/src/boost/smart_ptr/bad_weak_ptr.hpp b/contrib/src/boost/smart_ptr/bad_weak_ptr.hpp index 3e0a1b7..582fad8 100644 --- a/contrib/src/boost/smart_ptr/bad_weak_ptr.hpp +++ b/contrib/src/boost/smart_ptr/bad_weak_ptr.hpp @@ -36,6 +36,11 @@ namespace boost # pragma option push -pc #endif +#if defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wweak-vtables" +#endif + class bad_weak_ptr: public std::exception { public: @@ -46,6 +51,10 @@ public: } }; +#if defined(__clang__) +# pragma clang diagnostic pop +#endif + #if defined(__BORLANDC__) && __BORLANDC__ <= 0x564 # pragma option pop #endif diff --git a/contrib/src/boost/smart_ptr/detail/sp_counted_base.hpp b/contrib/src/boost/smart_ptr/detail/sp_counted_base.hpp index 0addf07..83ede23 100644 --- a/contrib/src/boost/smart_ptr/detail/sp_counted_base.hpp +++ b/contrib/src/boost/smart_ptr/detail/sp_counted_base.hpp @@ -44,6 +44,9 @@ #elif defined( BOOST_SP_HAS_CLANG_C11_ATOMICS ) # include +#elif !defined( BOOST_NO_CXX11_HDR_ATOMIC ) +# include + #elif defined( __SNC__ ) # include @@ -65,7 +68,7 @@ #elif defined( __GNUC__ ) && ( defined( __powerpc__ ) || defined( __ppc__ ) || defined( __ppc ) ) && !defined(__PATHSCALE__) && !defined( _AIX ) # include -#elif defined( __GNUC__ ) && ( defined( __mips__ ) || defined( _mips ) ) && !defined(__PATHSCALE__) +#elif defined( __GNUC__ ) && ( defined( __mips__ ) || defined( _mips ) ) && !defined(__PATHSCALE__) && !defined( __mips16 ) # include #elif defined( BOOST_SP_HAS_SYNC ) diff --git a/contrib/src/boost/smart_ptr/detail/sp_counted_base_clang.hpp b/contrib/src/boost/smart_ptr/detail/sp_counted_base_clang.hpp index c66b985..7598495 100644 --- a/contrib/src/boost/smart_ptr/detail/sp_counted_base_clang.hpp +++ b/contrib/src/boost/smart_ptr/detail/sp_counted_base_clang.hpp @@ -58,6 +58,11 @@ inline boost::int_least32_t atomic_conditional_increment( atomic_int_least32_t * } } +#if defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wweak-vtables" +#endif + class sp_counted_base { private: @@ -133,6 +138,10 @@ public: } }; +#if defined(__clang__) +# pragma clang diagnostic pop +#endif + } // namespace detail } // namespace boost diff --git a/contrib/src/boost/smart_ptr/detail/spinlock.hpp b/contrib/src/boost/smart_ptr/detail/spinlock.hpp index 19f93d7..0b618df 100644 --- a/contrib/src/boost/smart_ptr/detail/spinlock.hpp +++ b/contrib/src/boost/smart_ptr/detail/spinlock.hpp @@ -43,6 +43,9 @@ #elif defined( BOOST_SP_USE_PTHREADS ) # include +#elif !defined( BOOST_NO_CXX11_HDR_ATOMIC ) +# include + #elif defined(__GNUC__) && defined( __arm__ ) && !defined( __thumb__ ) # include diff --git a/contrib/src/boost/smart_ptr/shared_ptr.hpp b/contrib/src/boost/smart_ptr/shared_ptr.hpp index 47bc33d..77f68be 100644 --- a/contrib/src/boost/smart_ptr/shared_ptr.hpp +++ b/contrib/src/boost/smart_ptr/shared_ptr.hpp @@ -642,6 +642,14 @@ public: return *this; } + // aliasing move + template + shared_ptr( shared_ptr && r, element_type * p ) BOOST_NOEXCEPT : px( p ), pn() + { + pn.swap( r.pn ); + r.px = 0; + } + #endif #if !defined( BOOST_NO_CXX11_NULLPTR ) @@ -679,7 +687,16 @@ public: { this_type( r, p ).swap( *this ); } - + +#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) + + template void reset( shared_ptr && r, element_type * p ) + { + this_type( static_cast< shared_ptr && >( r ), p ).swap( *this ); + } + +#endif + // never throws (but has a BOOST_ASSERT in it, so not marked with BOOST_NOEXCEPT) typename boost::detail::sp_dereference< T >::type operator* () const { @@ -1065,7 +1082,7 @@ template< class T > struct hash; template< class T > std::size_t hash_value( boost::shared_ptr const & p ) BOOST_NOEXCEPT { - return boost::hash< T* >()( p.get() ); + return boost::hash< typename boost::shared_ptr::element_type* >()( p.get() ); } } // namespace boost diff --git a/contrib/src/boost/type_index.hpp b/contrib/src/boost/type_index.hpp new file mode 100644 index 0000000..0310e20 --- /dev/null +++ b/contrib/src/boost/type_index.hpp @@ -0,0 +1,265 @@ +// +// Copyright (c) Antony Polukhin, 2012-2014. +// +// 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_TYPE_INDEX_HPP +#define BOOST_TYPE_INDEX_HPP + +/// \file boost/type_index.hpp +/// \brief Includes minimal set of headers required to use the Boost.TypeIndex library. +/// +/// By inclusion of this file most optimal type index classes will be included and used +/// as a boost::typeindex::type_index and boost::typeindex::type_info. + +#include + +#ifdef BOOST_HAS_PRAGMA_ONCE +# pragma once +#endif + +#if defined(BOOST_TYPE_INDEX_USER_TYPEINDEX) +# include BOOST_TYPE_INDEX_USER_TYPEINDEX +# ifdef BOOST_HAS_PRAGMA_DETECT_MISMATCH +# pragma detect_mismatch( "boost__type_index__abi", "user defined type_index class is used: " BOOST_STRINGIZE(BOOST_TYPE_INDEX_USER_TYPEINDEX)) +# endif +#elif (!defined(BOOST_NO_RTTI) && !defined(BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY)) || defined(BOOST_MSVC) +# include +# if defined(BOOST_NO_RTTI) || defined(BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY) +# include +# ifdef BOOST_HAS_PRAGMA_DETECT_MISMATCH +# pragma detect_mismatch( "boost__type_index__abi", "RTTI is off - typeid() is used only for templates") +# endif +# else +# ifdef BOOST_HAS_PRAGMA_DETECT_MISMATCH +# pragma detect_mismatch( "boost__type_index__abi", "RTTI is used") +# endif +# endif +#else +# include +# include +# ifdef BOOST_HAS_PRAGMA_DETECT_MISMATCH +# pragma detect_mismatch( "boost__type_index__abi", "RTTI is off - using CTTI") +# endif +#endif + +#ifndef BOOST_TYPE_INDEX_REGISTER_CLASS +#define BOOST_TYPE_INDEX_REGISTER_CLASS +#endif + +namespace boost { namespace typeindex { + +#if defined(BOOST_TYPE_INDEX_DOXYGEN_INVOKED) + +/// \def BOOST_TYPE_INDEX_FUNCTION_SIGNATURE +/// BOOST_TYPE_INDEX_FUNCTION_SIGNATURE is used by boost::typeindex::ctti_type_index class to +/// deduce the name of a type. If your compiler is not recognized +/// by the TypeIndex library and you wish to work with boost::typeindex::ctti_type_index, you may +/// define this macro by yourself. +/// +/// BOOST_TYPE_INDEX_FUNCTION_SIGNATURE must be defined to a compiler specific macro +/// that outputs the \b whole function signature \b including \b template \b parameters. +/// +/// If your compiler is not recognised and BOOST_TYPE_INDEX_FUNCTION_SIGNATURE is not defined, +/// then a compile-time error will arise at any attempt to use boost::typeindex::ctti_type_index classes. +/// +/// See BOOST_TYPE_INDEX_REGISTER_CTTI_PARSING_PARAMS and BOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING +/// for an information of how to tune the implementation to make a nice pretty_name() output. +#define BOOST_TYPE_INDEX_FUNCTION_SIGNATURE BOOST_CURRENT_FUNCTION + +/// \def BOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING +/// This is a helper macro for making correct pretty_names() with RTTI off. +/// +/// BOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING macro may be defined to +/// '(begin_skip, end_skip, runtime_skip, runtime_skip_until)' with parameters for adding a +/// support for compilers, that by default are not recognized by TypeIndex library. +/// +/// \b Example: +/// +/// Imagine the situation when +/// \code boost::typeindex::ctti_type_index::type_id().pretty_name() \endcode +/// returns the following string: +/// \code "static const char *boost::detail::ctti::n() [T = int]" \endcode +/// and \code boost::typeindex::ctti_type_index::type_id().pretty_name() \endcode returns the following: +/// \code "static const char *boost::detail::ctti::n() [T = short]" \endcode +/// +/// As we may see first 39 characters are "static const char *boost::detail::ctti<" and they do not depend on +/// the type T. After first 39 characters we have a human readable type name which is duplicated at the end +/// of a string. String always ends on ']', which consumes 1 character. +/// +/// Now if we define `BOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING` to +/// `(39, 1, false, "")` we'll be getting \code "int>::n() [T = int" \endcode +/// for `boost::typeindex::ctti_type_index::type_id().pretty_name()` and \code "short>::n() [T = short" \endcode +/// for `boost::typeindex::ctti_type_index::type_id().pretty_name()`. +/// +/// Now we need to take additional care of the characters that go before the last mention of our type. We'll +/// do that by telling the macro that we need to cut off everything that goes before the "T = " including the "T = " +/// itself: +/// +/// \code (39, 1, true, "T = ") \endcode +/// +/// In case of GCC or Clang command line we need to add the following line while compiling all the sources: +/// +/// \code +/// -DBOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING='(39, 1, true, "T = ")' +/// \endcode +/// \param begin_skip How many characters must be skipped at the beginning of the type holding string. +/// Must be a compile time constant. +/// \param end_skip How many characters must be skipped at the end of the type holding string. +/// Must be a compile time constant. +/// \param runtime_skip Do we need additional checks at runtime to cut off the more characters. +/// Must be `true` or `false`. +/// \param runtime_skip_until Skip all the characters before the following string (including the string itself). +/// Must be a compile time array of characters. +/// +/// See [RTTI emulation limitations](boost_typeindex/rtti_emulation_limitations.html) for more info. +#define BOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING (0, 0, false, "") + + + /// Depending on a compiler flags, optimal implementation of type_index will be used + /// as a default boost::typeindex::type_index. + /// + /// Could be a boost::typeindex::stl_type_index, boost::typeindex::ctti_type_index or + /// user defined type_index class. + /// + /// \b See boost::typeindex::type_index_facade for a full description of type_index functions. + typedef platform_specific type_index; +#elif defined(BOOST_TYPE_INDEX_USER_TYPEINDEX) + // Nothing to do +#elif (!defined(BOOST_NO_RTTI) && !defined(BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY)) || defined(BOOST_MSVC) + typedef boost::typeindex::stl_type_index type_index; +#else + typedef boost::typeindex::ctti_type_index type_index; +#endif + +/// Depending on a compiler flags, optimal implementation of type_info will be used +/// as a default boost::typeindex::type_info. +/// +/// Could be a std::type_info, boost::typeindex::detail::ctti_data or +/// some user defined class. +/// +/// type_info \b is \b not copyable or default constructible. It is \b not assignable too! +typedef type_index::type_info_t type_info; + +#if defined(BOOST_TYPE_INDEX_DOXYGEN_INVOKED) + +/// \def BOOST_TYPE_INDEX_USER_TYPEINDEX +/// BOOST_TYPE_INDEX_USER_TYPEINDEX can be defined to the path to header file +/// with user provided implementation of type_index. +/// +/// See [Making a custom type_index](boost_typeindex/making_a_custom_type_index.html) section +/// of documentation for usage example. +#define BOOST_TYPE_INDEX_USER_TYPEINDEX + + +/// \def BOOST_TYPE_INDEX_REGISTER_CLASS +/// BOOST_TYPE_INDEX_REGISTER_CLASS is used to help to emulate RTTI. +/// Put this macro into the public section of polymorphic class to allow runtime type detection. +/// +/// Depending on the typeid() availability this macro will expand to nothing or to virtual helper function +/// `virtual const type_info& boost_type_info_type_id_runtime_() const noexcept`. +/// +/// \b Example: +/// \code +/// class A { +/// public: +/// BOOST_TYPE_INDEX_REGISTER_CLASS +/// virtual ~A(){} +/// }; +/// +/// struct B: public A { +/// BOOST_TYPE_INDEX_REGISTER_CLASS +/// }; +/// +/// struct C: public B { +/// BOOST_TYPE_INDEX_REGISTER_CLASS +/// }; +/// +/// ... +/// +/// C c1; +/// A* pc1 = &c1; +/// assert(boost::typeindex::type_id() == boost::typeindex::type_id_runtime(*pc1)); +/// \endcode +#define BOOST_TYPE_INDEX_REGISTER_CLASS nothing-or-some-virtual-functions + +/// \def BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY +/// BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY is a helper macro that must be defined if mixing +/// RTTI on/off modules. See +/// [Mixing sources with RTTI on and RTTI off](boost_typeindex/mixing_sources_with_rtti_on_and_.html) +/// section of documentation for more info. +#define BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY + +#endif // defined(BOOST_TYPE_INDEX_DOXYGEN_INVOKED) + + +/// Function to get boost::typeindex::type_index for a type T. +/// Removes const, volatile && and & modifiers from T. +/// +/// \b Example: +/// \code +/// type_index ti = type_id(); +/// std::cout << ti.pretty_name(); // Outputs 'int' +/// \endcode +/// +/// \tparam T Type for which type_index must be created. +/// \throw Nothing. +/// \return boost::typeindex::type_index with information about the specified type T. +template +inline type_index type_id() BOOST_NOEXCEPT { + return type_index::type_id(); +} + +/// Function for constructing boost::typeindex::type_index instance for type T. +/// Does not remove const, volatile, & and && modifiers from T. +/// +/// If T has no const, volatile, & and && modifiers, then returns exactly +/// the same result as in case of calling `type_id()`. +/// +/// \b Example: +/// \code +/// type_index ti = type_id_with_cvr(); +/// std::cout << ti.pretty_name(); // Outputs 'int&' +/// \endcode +/// +/// \tparam T Type for which type_index must be created. +/// \throw Nothing. +/// \return boost::typeindex::type_index with information about the specified type T. +template +inline type_index type_id_with_cvr() BOOST_NOEXCEPT { + return type_index::type_id_with_cvr(); +} + +/// Function that works exactly like C++ typeid(rtti_val) call, but returns boost::type_index. +/// +/// Returns runtime information about specified type. +/// +/// \b Requirements: RTTI available or Base and Derived classes must be marked with BOOST_TYPE_INDEX_REGISTER_CLASS. +/// +/// \b Example: +/// \code +/// struct Base { virtual ~Base(){} }; +/// struct Derived: public Base {}; +/// ... +/// Derived d; +/// Base& b = d; +/// type_index ti = type_id_runtime(b); +/// std::cout << ti.pretty_name(); // Outputs 'Derived' +/// \endcode +/// +/// \param runtime_val Variable which runtime type must be returned. +/// \throw Nothing. +/// \return boost::typeindex::type_index with information about the specified variable. +template +inline type_index type_id_runtime(const T& runtime_val) BOOST_NOEXCEPT { + return type_index::type_id_runtime(runtime_val); +} + +}} // namespace boost::typeindex + + + +#endif // BOOST_TYPE_INDEX_HPP + diff --git a/contrib/src/boost/type_index/ctti_type_index.hpp b/contrib/src/boost/type_index/ctti_type_index.hpp new file mode 100644 index 0000000..611ad92 --- /dev/null +++ b/contrib/src/boost/type_index/ctti_type_index.hpp @@ -0,0 +1,212 @@ +// +// Copyright (c) Antony Polukhin, 2013-2016. +// +// +// 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_TYPE_INDEX_CTTI_TYPE_INDEX_HPP +#define BOOST_TYPE_INDEX_CTTI_TYPE_INDEX_HPP + +/// \file ctti_type_index.hpp +/// \brief Contains boost::typeindex::ctti_type_index class that is constexpr if C++14 constexpr is supported by compiler. +/// +/// boost::typeindex::ctti_type_index class can be used as a drop-in replacement +/// for std::type_index. +/// +/// It is used in situations when typeid() method is not available or +/// BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY macro is defined. + +#include +#include + +#include +#include +#include +#include + +#ifdef BOOST_HAS_PRAGMA_ONCE +# pragma once +#endif + +namespace boost { namespace typeindex { + +namespace detail { + +// That's the most trickiest part of the TypeIndex library: +// 1) we do not want to give user ability to manually construct and compare `struct-that-represents-type` +// 2) we need to distinguish between `struct-that-represents-type` and `const char*` +// 3) we need a thread-safe way to have references to instances `struct-that-represents-type` +// 4) we need a compile-time control to make sure that user does not copy or +// default construct `struct-that-represents-type` +// +// Solution would be the following: + +/// \class ctti_data +/// Standard-layout class with private constructors and assignment operators. +/// +/// You can not work with this class directly. The purpose of this class is to hold type info +/// \b when \b RTTI \b is \b off and allow ctti_type_index construction from itself. +/// +/// \b Example: +/// \code +/// const detail::ctti_data& foo(); +/// ... +/// type_index ti = type_index(foo()); +/// std::cout << ti.pretty_name(); +/// \endcode +class ctti_data { +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS +public: + ctti_data() = delete; + ctti_data(const ctti_data&) = delete; + ctti_data& operator=(const ctti_data&) = delete; +#else +private: + ctti_data(); + ctti_data(const ctti_data&); + ctti_data& operator=(const ctti_data&); +#endif +}; + +} // namespace detail + +/// Helper method for getting detail::ctti_data of a template parameter T. +template +inline const detail::ctti_data& ctti_construct() BOOST_NOEXCEPT { + // Standard C++11, 5.2.10 Reinterpret cast: + // An object pointer can be explicitly converted to an object pointer of a different type. When a prvalue + // v of type "pointer to T1" is converted to the type "pointer to cv T2", the result is static_cast(static_cast(v)) if both T1 and T2 are standard-layout types (3.9) and the alignment + // requirements of T2 are no stricter than those of T1, or if either type is void. Converting a prvalue of type + // "pointer to T1" to the type "pointer to T2" (where T1 and T2 are object types and where the alignment + // requirements of T2 are no stricter than those of T1) and back to its original type yields the original pointer + // value. + // + // Alignments are checked in `type_index_test_ctti_alignment.cpp` test. + return *reinterpret_cast(boost::detail::ctti::n()); +} + +/// \class ctti_type_index +/// This class is a wrapper that pretends to work exactly like stl_type_index, but does +/// not require RTTI support. \b For \b description \b of \b functions \b see type_index_facade. +/// +/// This class on C++14 compatible compilers has following functions marked as constexpr: +/// * default constructor +/// * copy constructors and assignemnt operations +/// * class methods: name(), before(const ctti_type_index& rhs), equal(const ctti_type_index& rhs) +/// * static methods type_id(), type_id_with_cvr() +/// * comparison operators +/// +/// This class produces slightly longer type names, so consider using stl_type_index +/// in situations when typeid() is working. +class ctti_type_index: public type_index_facade { + const char* data_; + + inline std::size_t get_raw_name_length() const BOOST_NOEXCEPT; + + BOOST_CXX14_CONSTEXPR inline explicit ctti_type_index(const char* data) BOOST_NOEXCEPT + : data_(data) + {} + +public: + typedef detail::ctti_data type_info_t; + + BOOST_CXX14_CONSTEXPR inline ctti_type_index() BOOST_NOEXCEPT + : data_(boost::detail::ctti::n()) + {} + + inline ctti_type_index(const type_info_t& data) BOOST_NOEXCEPT + : data_(reinterpret_cast(&data)) + {} + + inline const type_info_t& type_info() const BOOST_NOEXCEPT; + BOOST_CXX14_CONSTEXPR inline const char* raw_name() const BOOST_NOEXCEPT; + BOOST_CXX14_CONSTEXPR inline const char* name() const BOOST_NOEXCEPT; + inline std::string pretty_name() const; + inline std::size_t hash_code() const BOOST_NOEXCEPT; + + BOOST_CXX14_CONSTEXPR inline bool equal(const ctti_type_index& rhs) const BOOST_NOEXCEPT; + BOOST_CXX14_CONSTEXPR inline bool before(const ctti_type_index& rhs) const BOOST_NOEXCEPT; + + template + BOOST_CXX14_CONSTEXPR inline static ctti_type_index type_id() BOOST_NOEXCEPT; + + template + BOOST_CXX14_CONSTEXPR inline static ctti_type_index type_id_with_cvr() BOOST_NOEXCEPT; + + template + inline static ctti_type_index type_id_runtime(const T& variable) BOOST_NOEXCEPT; +}; + + +inline const ctti_type_index::type_info_t& ctti_type_index::type_info() const BOOST_NOEXCEPT { + return *reinterpret_cast(data_); +} + + +BOOST_CXX14_CONSTEXPR inline bool ctti_type_index::equal(const ctti_type_index& rhs) const BOOST_NOEXCEPT { + const char* const left = raw_name(); + const char* const right = rhs.raw_name(); + return /*left == right ||*/ !boost::typeindex::detail::constexpr_strcmp(left, right); +} + +BOOST_CXX14_CONSTEXPR inline bool ctti_type_index::before(const ctti_type_index& rhs) const BOOST_NOEXCEPT { + const char* const left = raw_name(); + const char* const right = rhs.raw_name(); + return /*left != right &&*/ boost::typeindex::detail::constexpr_strcmp(left, right) < 0; +} + + +template +BOOST_CXX14_CONSTEXPR inline ctti_type_index ctti_type_index::type_id() BOOST_NOEXCEPT { + typedef BOOST_DEDUCED_TYPENAME boost::remove_reference::type no_ref_t; + typedef BOOST_DEDUCED_TYPENAME boost::remove_cv::type no_cvr_t; + return ctti_type_index(boost::detail::ctti::n()); +} + + + +template +BOOST_CXX14_CONSTEXPR inline ctti_type_index ctti_type_index::type_id_with_cvr() BOOST_NOEXCEPT { + return ctti_type_index(boost::detail::ctti::n()); +} + + +template +inline ctti_type_index ctti_type_index::type_id_runtime(const T& variable) BOOST_NOEXCEPT { + return variable.boost_type_index_type_id_runtime_(); +} + + +BOOST_CXX14_CONSTEXPR inline const char* ctti_type_index::raw_name() const BOOST_NOEXCEPT { + return data_; +} + + +BOOST_CXX14_CONSTEXPR inline const char* ctti_type_index::name() const BOOST_NOEXCEPT { + return data_; +} + +inline std::size_t ctti_type_index::get_raw_name_length() const BOOST_NOEXCEPT { + return std::strlen(raw_name() + detail::ctti_skip_size_at_end); +} + + +inline std::string ctti_type_index::pretty_name() const { + std::size_t len = get_raw_name_length(); + while (raw_name()[len - 1] == ' ') --len; // MSVC sometimes adds whitespaces + return std::string(raw_name(), len); +} + + +inline std::size_t ctti_type_index::hash_code() const BOOST_NOEXCEPT { + return boost::hash_range(raw_name(), raw_name() + get_raw_name_length()); +} + + +}} // namespace boost::typeindex + +#endif // BOOST_TYPE_INDEX_CTTI_TYPE_INDEX_HPP + diff --git a/contrib/src/boost/type_index/detail/compile_time_type_info.hpp b/contrib/src/boost/type_index/detail/compile_time_type_info.hpp new file mode 100644 index 0000000..a2a89ae --- /dev/null +++ b/contrib/src/boost/type_index/detail/compile_time_type_info.hpp @@ -0,0 +1,289 @@ +// +// Copyright (c) Antony Polukhin, 2012-2016. +// +// +// 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_TYPE_INDEX_DETAIL_COMPILE_TIME_TYPE_INFO_HPP +#define BOOST_TYPE_INDEX_DETAIL_COMPILE_TIME_TYPE_INFO_HPP + +/// \file compile_time_type_info.hpp +/// \brief Contains helper macros and implementation details of boost::typeindex::ctti_type_index. +/// Not intended for inclusion from user's code. + +#include +#include +#include + +#ifdef BOOST_HAS_PRAGMA_ONCE +# pragma once +#endif + +/// @cond +#define BOOST_TYPE_INDEX_REGISTER_CTTI_PARSING_PARAMS(begin_skip, end_skip, runtime_skip, runtime_skip_until) \ + namespace boost { namespace typeindex { namespace detail { \ + BOOST_STATIC_CONSTEXPR std::size_t ctti_skip_size_at_begin = begin_skip; \ + BOOST_STATIC_CONSTEXPR std::size_t ctti_skip_size_at_end = end_skip; \ + BOOST_STATIC_CONSTEXPR bool ctti_skip_more_at_runtime = runtime_skip; \ + BOOST_STATIC_CONSTEXPR char ctti_skip_until_runtime[] = runtime_skip_until; \ + }}} /* namespace boost::typeindex::detail */ \ + /**/ +/// @endcond + + +#if defined(BOOST_TYPE_INDEX_DOXYGEN_INVOKED) + /* Nothing to document. All the macro docs are moved to */ +#elif defined(BOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING) +# include + BOOST_PP_EXPAND( BOOST_TYPE_INDEX_REGISTER_CTTI_PARSING_PARAMS BOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING ) +#elif defined(_MSC_VER) && defined (BOOST_NO_CXX11_NOEXCEPT) + // sizeof("const char *__cdecl boost::detail::ctti<") - 1, sizeof(">::n(void)") - 1 + BOOST_TYPE_INDEX_REGISTER_CTTI_PARSING_PARAMS(40, 10, false, "") +#elif defined(_MSC_VER) && !defined (BOOST_NO_CXX11_NOEXCEPT) + // sizeof("const char *__cdecl boost::detail::ctti<") - 1, sizeof(">::n(void) noexcept") - 1 + BOOST_TYPE_INDEX_REGISTER_CTTI_PARSING_PARAMS(40, 19, false, "") +#elif defined(__clang__) && defined(__APPLE__) + // Someone made __clang_major__ equal to LLVM version rather than compiler version + // on APPLE platform. + // + // Using less efficient solution because there is no good way to detect real version of Clang. + // sizeof("static const char *boost::detail::ctti<") - 1, sizeof("]") - 1, true, "???????????>::n() [T = int" + BOOST_TYPE_INDEX_REGISTER_CTTI_PARSING_PARAMS(39, 1, true, "T = ") +#elif defined(__clang__) && (__clang_major__ < 3 || (__clang_major__ == 3 && __clang_minor__ == 0)) + // sizeof("static const char *boost::detail::ctti<") - 1, sizeof(">::n()") - 1 + // note: checked on 3.0 + BOOST_TYPE_INDEX_REGISTER_CTTI_PARSING_PARAMS(39, 6, false, "") +#elif defined(__clang__) && (__clang_major__ >= 4 || (__clang_major__ == 3 && __clang_minor__ > 0)) + // sizeof("static const char *boost::detail::ctti<") - 1, sizeof("]") - 1, true, "int>::n() [T = int" + // note: checked on 3.1, 3.4 + BOOST_TYPE_INDEX_REGISTER_CTTI_PARSING_PARAMS(39, 1, true, "T = ") +#elif defined(__GNUC__) && !defined(BOOST_NO_CXX14_CONSTEXPR) + // sizeof("static contexpr char boost::detail::ctti::s() [with unsigned int I = 0u; T = ") - 1, sizeof("]") - 1 + BOOST_TYPE_INDEX_REGISTER_CTTI_PARSING_PARAMS(81, 1, false, "") +#elif defined(__GNUC__) && defined(BOOST_NO_CXX14_CONSTEXPR) + // sizeof("static const char* boost::detail::ctti::n() [with T = ") - 1, sizeof("]") - 1 + BOOST_TYPE_INDEX_REGISTER_CTTI_PARSING_PARAMS(57, 1, false, "") +#else + // Deafult code for other platforms... Just skip nothing! + BOOST_TYPE_INDEX_REGISTER_CTTI_PARSING_PARAMS(0, 0, false, "") +#endif + +#undef BOOST_TYPE_INDEX_REGISTER_CTTI_PARSING_PARAMS + +namespace boost { namespace typeindex { namespace detail { + template + BOOST_CXX14_CONSTEXPR inline void assert_compile_time_legths() BOOST_NOEXCEPT { + BOOST_STATIC_ASSERT_MSG( + Condition, + "TypeIndex library is misconfigured for your compiler. " + "Please define BOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING to correct values. See section " + "'RTTI emulation limitations' of the documentation for more information." + ); + } + + template + BOOST_CXX14_CONSTEXPR inline void failed_to_get_function_name() BOOST_NOEXCEPT { + BOOST_STATIC_ASSERT_MSG( + sizeof(T) && false, + "TypeIndex library could not detect your compiler. " + "Please make the BOOST_TYPE_INDEX_FUNCTION_SIGNATURE macro use " + "correct compiler macro for getting the whole function name. " + "Define BOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING to correct value after that." + ); + } + + template + BOOST_CXX14_CONSTEXPR inline const char* skip_begining_runtime(const char* begin, boost::mpl::false_) BOOST_NOEXCEPT { + return begin; + } + + template + BOOST_CXX14_CONSTEXPR inline ForwardIterator1 constexpr_search( + ForwardIterator1 first1, + ForwardIterator1 last1, + ForwardIterator2 first2, + ForwardIterator2 last2) BOOST_NOEXCEPT + { + if (first2 == last2) { + return first1; // specified in C++11 + } + + while (first1 != last1) { + ForwardIterator1 it1 = first1; + ForwardIterator2 it2 = first2; + + while (*it1 == *it2) { + ++it1; + ++it2; + if (it2 == last2) return first1; + if (it1 == last1) return last1; + } + + ++first1; + } + + return last1; + } + + BOOST_CXX14_CONSTEXPR inline int constexpr_strcmp(const char *v1, const char *v2) BOOST_NOEXCEPT { + while (*v1 != '\0' && *v1 == *v2) { + ++v1; + ++v2; + }; + + return static_cast(*v1) - *v2; + } + + template + BOOST_CXX14_CONSTEXPR inline const char* skip_begining_runtime(const char* begin, boost::mpl::true_) BOOST_NOEXCEPT { + const char* const it = constexpr_search( + begin, begin + ArrayLength, + ctti_skip_until_runtime, ctti_skip_until_runtime + sizeof(ctti_skip_until_runtime) - 1 + ); + return (it == begin + ArrayLength ? begin : it + sizeof(ctti_skip_until_runtime) - 1); + } + + template + BOOST_CXX14_CONSTEXPR inline const char* skip_begining(const char* begin) BOOST_NOEXCEPT { + assert_compile_time_legths<(ArrayLength > ctti_skip_size_at_begin + ctti_skip_size_at_end)>(); + return skip_begining_runtime( + begin + ctti_skip_size_at_begin, + boost::mpl::bool_() + ); + } + +#if !defined(__clang__) && defined(__GNUC__) && !defined(BOOST_NO_CXX14_CONSTEXPR) + template + struct index_seq {}; + + template + struct make_index_sequence_join; + + template + struct make_index_sequence_join, index_seq > { + typedef index_seq type; + }; + + template + struct make_index_seq_impl { + typedef typename make_index_sequence_join< + typename make_index_seq_impl::type, + typename make_index_seq_impl::type + >::type type; + }; + + template + struct make_index_seq_impl { + typedef index_seq<> type; + }; + + template + struct make_index_seq_impl { + typedef index_seq type; + }; + + template + struct cstring { + static constexpr unsigned int size_ = sizeof...(C); + static constexpr char data_[size_] = { C... }; + }; + + template + constexpr char cstring::data_[]; +#endif + +}}} // namespace boost::typeindex::detail + +namespace boost { namespace detail { + +/// Noncopyable type_info that does not require RTTI. +/// CTTI == Compile Time Type Info. +/// This name must be as short as possible, to avoid code bloat +template +struct ctti { + +#if !defined(__clang__) && defined(__GNUC__) && !defined(BOOST_NO_CXX14_CONSTEXPR) + //helper functions + template + constexpr static char s() BOOST_NOEXCEPT { // step + constexpr unsigned int offset = + (I >= 10u ? 1u : 0u) + + (I >= 100u ? 1u : 0u) + + (I >= 1000u ? 1u : 0u) + + (I >= 10000u ? 1u : 0u) + + (I >= 100000u ? 1u : 0u) + + (I >= 1000000u ? 1u : 0u) + ; + + #if defined(BOOST_TYPE_INDEX_FUNCTION_SIGNATURE) + return BOOST_TYPE_INDEX_FUNCTION_SIGNATURE[I + offset]; + #elif defined(__FUNCSIG__) + return __FUNCSIG__[I + offset]; + #else + return __PRETTY_FUNCTION__[I + offset]; + #endif + } + + template + constexpr static const char* impl(::boost::typeindex::detail::index_seq ) BOOST_NOEXCEPT { + return ::boost::typeindex::detail::cstring()...>::data_; + } + + template // `D` means `Dummy` + constexpr static const char* n() BOOST_NOEXCEPT { + #if defined(BOOST_TYPE_INDEX_FUNCTION_SIGNATURE) + constexpr unsigned int size = sizeof(BOOST_TYPE_INDEX_FUNCTION_SIGNATURE); + #elif defined(__FUNCSIG__) + constexpr unsigned int size = sizeof(__FUNCSIG__); + #elif defined(__PRETTY_FUNCTION__) \ + || defined(__GNUC__) \ + || (defined(__SUNPRO_CC) && (__SUNPRO_CC >= 0x5130)) \ + || (defined(__MWERKS__) && (__MWERKS__ >= 0x3000)) \ + || (defined(__ICC) && (__ICC >= 600)) \ + || defined(__ghs__) \ + || defined(__DMC__) + constexpr unsigned int size = sizeof(__PRETTY_FUNCTION__); + #else + boost::typeindex::detail::failed_to_get_function_name(); + #endif + + boost::typeindex::detail::assert_compile_time_legths< + (size > boost::typeindex::detail::ctti_skip_size_at_begin + boost::typeindex::detail::ctti_skip_size_at_end + sizeof("const *") - 1) + >(); + static_assert(!boost::typeindex::detail::ctti_skip_more_at_runtime, "Skipping for GCC in C++14 mode is unsupported"); + + typedef typename boost::typeindex::detail::make_index_seq_impl< + boost::typeindex::detail::ctti_skip_size_at_begin, + size - sizeof("const *") + 1 - boost::typeindex::detail::ctti_skip_size_at_begin + >::type idx_seq; + return impl(idx_seq()); + } +#else + /// Returns raw name. Must be as short, as possible, to avoid code bloat + BOOST_CXX14_CONSTEXPR static const char* n() BOOST_NOEXCEPT { + #if defined(BOOST_TYPE_INDEX_FUNCTION_SIGNATURE) + return boost::typeindex::detail::skip_begining< sizeof(BOOST_TYPE_INDEX_FUNCTION_SIGNATURE) >(BOOST_TYPE_INDEX_FUNCTION_SIGNATURE); + #elif defined(__FUNCSIG__) + return boost::typeindex::detail::skip_begining< sizeof(__FUNCSIG__) >(__FUNCSIG__); + #elif defined(__PRETTY_FUNCTION__) \ + || defined(__GNUC__) \ + || (defined(__SUNPRO_CC) && (__SUNPRO_CC >= 0x5130)) \ + || (defined(__MWERKS__) && (__MWERKS__ >= 0x3000)) \ + || (defined(__ICC) && (__ICC >= 600)) \ + || defined(__ghs__) \ + || defined(__DMC__) + return boost::typeindex::detail::skip_begining< sizeof(__PRETTY_FUNCTION__) >(__PRETTY_FUNCTION__); + #else + boost::typeindex::detail::failed_to_get_function_name(); + return ""; + #endif + } +#endif +}; + +}} // namespace boost::detail + +#endif // BOOST_TYPE_INDEX_DETAIL_COMPILE_TIME_TYPE_INFO_HPP + diff --git a/contrib/src/boost/type_index/detail/ctti_register_class.hpp b/contrib/src/boost/type_index/detail/ctti_register_class.hpp new file mode 100644 index 0000000..a8cef2c --- /dev/null +++ b/contrib/src/boost/type_index/detail/ctti_register_class.hpp @@ -0,0 +1,40 @@ +// +// Copyright (c) Antony Polukhin, 2013-2014. +// +// +// 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_TYPE_INDEX_CTTI_REGISTER_CLASS_HPP +#define BOOST_TYPE_INDEX_CTTI_REGISTER_CLASS_HPP + +/// \file ctti_register_class.hpp +/// \brief Contains BOOST_TYPE_INDEX_REGISTER_CLASS macro implementation that uses boost::typeindex::ctti_type_index. +/// Not intended for inclusion from user's code. + +#include + +#ifdef BOOST_HAS_PRAGMA_ONCE +# pragma once +#endif + +namespace boost { namespace typeindex { namespace detail { + +template +inline const ctti_data& ctti_construct_typeid_ref(const T*) BOOST_NOEXCEPT { + return ctti_construct(); +} + +}}} // namespace boost::typeindex::detail + +/// @cond +#define BOOST_TYPE_INDEX_REGISTER_CLASS \ + virtual const boost::typeindex::detail::ctti_data& boost_type_index_type_id_runtime_() const BOOST_NOEXCEPT { \ + return boost::typeindex::detail::ctti_construct_typeid_ref(this); \ + } \ +/**/ +/// @endcond + +#endif // BOOST_TYPE_INDEX_CTTI_REGISTER_CLASS_HPP + diff --git a/contrib/src/boost/type_index/detail/stl_register_class.hpp b/contrib/src/boost/type_index/detail/stl_register_class.hpp new file mode 100644 index 0000000..95a26f7 --- /dev/null +++ b/contrib/src/boost/type_index/detail/stl_register_class.hpp @@ -0,0 +1,40 @@ +// +// Copyright (c) Antony Polukhin, 2013-2014. +// +// +// 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_TYPE_INDEX_STL_REGISTER_CLASS_HPP +#define BOOST_TYPE_INDEX_STL_REGISTER_CLASS_HPP + +/// \file stl_register_class.hpp +/// \brief Contains BOOST_TYPE_INDEX_REGISTER_CLASS macro implementation that uses boost::typeindex::stl_type_index. +/// Not intended for inclusion from user's code. + +#include + +#ifdef BOOST_HAS_PRAGMA_ONCE +# pragma once +#endif + +namespace boost { namespace typeindex { namespace detail { + +template +inline const stl_type_index::type_info_t& stl_construct_typeid_ref(const T*) BOOST_NOEXCEPT { + return typeid(T); +} + +}}} // namespace boost::typeindex::detail + +/// @cond +#define BOOST_TYPE_INDEX_REGISTER_CLASS \ + virtual const boost::typeindex::stl_type_index::type_info_t& boost_type_index_type_id_runtime_() const BOOST_NOEXCEPT { \ + return boost::typeindex::detail::stl_construct_typeid_ref(this); \ + } \ +/**/ +/// @endcond + +#endif // BOOST_TYPE_INDEX_STL_REGISTER_CLASS_HPP + diff --git a/contrib/src/boost/type_index/stl_type_index.hpp b/contrib/src/boost/type_index/stl_type_index.hpp new file mode 100644 index 0000000..a5add88 --- /dev/null +++ b/contrib/src/boost/type_index/stl_type_index.hpp @@ -0,0 +1,272 @@ +// +// Copyright (c) Antony Polukhin, 2013-2015. +// +// +// 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_TYPE_INDEX_STL_TYPE_INDEX_HPP +#define BOOST_TYPE_INDEX_STL_TYPE_INDEX_HPP + +/// \file stl_type_index.hpp +/// \brief Contains boost::typeindex::stl_type_index class. +/// +/// boost::typeindex::stl_type_index class can be used as a drop-in replacement +/// for std::type_index. +/// +/// It is used in situations when RTTI is enabled or typeid() method is available. +/// When typeid() is disabled or BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY macro +/// is defined boost::typeindex::ctti is usually used instead of boost::typeindex::stl_type_index. + +#include + +// MSVC is capable of calling typeid(T) even when RTTI is off +#if defined(BOOST_NO_RTTI) && !defined(BOOST_MSVC) +#error "File boost/type_index/stl_type_index.ipp is not usable when typeid() is not available." +#endif + +#include +#include // std::strcmp, std::strlen, std::strstr +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if (defined(__EDG_VERSION__) && __EDG_VERSION__ < 245) \ + || (defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 744) +# include +# include +# include +#endif + +#ifdef BOOST_HAS_PRAGMA_ONCE +# pragma once +#endif + +namespace boost { namespace typeindex { + +/// \class stl_type_index +/// This class is a wrapper around std::type_info, that workarounds issues and provides +/// much more rich interface. \b For \b description \b of \b functions \b see type_index_facade. +/// +/// This class requires typeid() to work. For cases when RTTI is disabled see ctti_type_index. +class stl_type_index + : public type_index_facade< + stl_type_index, + #ifdef BOOST_NO_STD_TYPEINFO + type_info + #else + std::type_info + #endif + > +{ +public: +#ifdef BOOST_NO_STD_TYPEINFO + typedef type_info type_info_t; +#else + typedef std::type_info type_info_t; +#endif + +private: + const type_info_t* data_; + +public: + inline stl_type_index() BOOST_NOEXCEPT + : data_(&typeid(void)) + {} + + inline stl_type_index(const type_info_t& data) BOOST_NOEXCEPT + : data_(&data) + {} + + inline const type_info_t& type_info() const BOOST_NOEXCEPT; + + inline const char* raw_name() const BOOST_NOEXCEPT; + inline const char* name() const BOOST_NOEXCEPT; + inline std::string pretty_name() const; + + inline std::size_t hash_code() const BOOST_NOEXCEPT; + inline bool equal(const stl_type_index& rhs) const BOOST_NOEXCEPT; + inline bool before(const stl_type_index& rhs) const BOOST_NOEXCEPT; + + template + inline static stl_type_index type_id() BOOST_NOEXCEPT; + + template + inline static stl_type_index type_id_with_cvr() BOOST_NOEXCEPT; + + template + inline static stl_type_index type_id_runtime(const T& value) BOOST_NOEXCEPT; +}; + +inline const stl_type_index::type_info_t& stl_type_index::type_info() const BOOST_NOEXCEPT { + return *data_; +} + + +inline const char* stl_type_index::raw_name() const BOOST_NOEXCEPT { +#ifdef _MSC_VER + return data_->raw_name(); +#else + return data_->name(); +#endif +} + +inline const char* stl_type_index::name() const BOOST_NOEXCEPT { + return data_->name(); +} + +inline std::string stl_type_index::pretty_name() const { + static const char cvr_saver_name[] = "boost::typeindex::detail::cvr_saver<"; + static BOOST_CONSTEXPR_OR_CONST std::string::size_type cvr_saver_name_len = sizeof(cvr_saver_name) - 1; + + // In case of MSVC demangle() is a no-op, and name() already returns demangled name. + // In case of GCC and Clang (on non-Windows systems) name() returns mangled name and demangle() undecorates it. + const boost::core::scoped_demangled_name demangled_name(data_->name()); + + const char* begin = demangled_name.get(); + if (!begin) { + boost::throw_exception(std::runtime_error("Type name demangling failed")); + } + + const std::string::size_type len = std::strlen(begin); + const char* end = begin + len; + + if (len > cvr_saver_name_len) { + const char* b = std::strstr(begin, cvr_saver_name); + if (b) { + b += cvr_saver_name_len; + + // Trim leading spaces + while (*b == ' ') { // the string is zero terminated, we won't exceed the buffer size + ++ b; + } + + // Skip the closing angle bracket + const char* e = end - 1; + while (e > b && *e != '>') { + -- e; + } + + // Trim trailing spaces + while (e > b && *(e - 1) == ' ') { + -- e; + } + + if (b < e) { + // Parsing seems to have succeeded, the type name is not empty + begin = b; + end = e; + } + } + } + + return std::string(begin, end); +} + + +inline std::size_t stl_type_index::hash_code() const BOOST_NOEXCEPT { +#if _MSC_VER > 1600 || (__GNUC__ == 4 && __GNUC_MINOR__ > 5 && defined(__GXX_EXPERIMENTAL_CXX0X__)) + return data_->hash_code(); +#else + return boost::hash_range(raw_name(), raw_name() + std::strlen(raw_name())); +#endif +} + + +/// @cond + +// for this compiler at least, cross-shared-library type_info +// comparisons don't work, so we are using typeid(x).name() instead. +# if (defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5))) \ + || defined(_AIX) \ + || (defined(__sgi) && defined(__host_mips)) \ + || (defined(__hpux) && defined(__HP_aCC)) \ + || (defined(linux) && defined(__INTEL_COMPILER) && defined(__ICC)) +# define BOOST_CLASSINFO_COMPARE_BY_NAMES +# endif + +/// @endcond + +inline bool stl_type_index::equal(const stl_type_index& rhs) const BOOST_NOEXCEPT { +#ifdef BOOST_CLASSINFO_COMPARE_BY_NAMES + return raw_name() == rhs.raw_name() || !std::strcmp(raw_name(), rhs.raw_name()); +#else + return !!(*data_ == *rhs.data_); +#endif +} + +inline bool stl_type_index::before(const stl_type_index& rhs) const BOOST_NOEXCEPT { +#ifdef BOOST_CLASSINFO_COMPARE_BY_NAMES + return raw_name() != rhs.raw_name() && std::strcmp(raw_name(), rhs.raw_name()) < 0; +#else + return !!data_->before(*rhs.data_); +#endif +} + +#ifdef BOOST_CLASSINFO_COMPARE_BY_NAMES +#undef BOOST_CLASSINFO_COMPARE_BY_NAMES +#endif + + + +template +inline stl_type_index stl_type_index::type_id() BOOST_NOEXCEPT { + typedef BOOST_DEDUCED_TYPENAME boost::remove_reference::type no_ref_t; + typedef BOOST_DEDUCED_TYPENAME boost::remove_cv::type no_cvr_prefinal_t; + + # if (defined(__EDG_VERSION__) && __EDG_VERSION__ < 245) \ + || (defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 744) + + // Old EDG-based compilers seem to mistakenly distinguish 'integral' from 'signed integral' + // in typeid() expressions. Full template specialization for 'integral' fixes that issue: + typedef BOOST_DEDUCED_TYPENAME boost::mpl::if_< + boost::is_signed, + boost::make_signed, + boost::mpl::identity + >::type no_cvr_prefinal_lazy_t; + + typedef BOOST_DEDUCED_TYPENAME no_cvr_prefinal_t::type no_cvr_t; + #else + typedef no_cvr_prefinal_t no_cvr_t; + #endif + + return typeid(no_cvr_t); +} + +namespace detail { + template class cvr_saver{}; +} + +template +inline stl_type_index stl_type_index::type_id_with_cvr() BOOST_NOEXCEPT { + typedef BOOST_DEDUCED_TYPENAME boost::mpl::if_< + boost::mpl::or_, boost::is_const, boost::is_volatile >, + detail::cvr_saver, + T + >::type type; + + return typeid(type); +} + + +template +inline stl_type_index stl_type_index::type_id_runtime(const T& value) BOOST_NOEXCEPT { +#ifdef BOOST_NO_RTTI + return value.boost_type_index_type_id_runtime_(); +#else + return typeid(value); +#endif +} + +}} // namespace boost::typeindex + +#endif // BOOST_TYPE_INDEX_STL_TYPE_INDEX_HPP diff --git a/contrib/src/boost/type_index/type_index_facade.hpp b/contrib/src/boost/type_index/type_index_facade.hpp new file mode 100644 index 0000000..dd35df2 --- /dev/null +++ b/contrib/src/boost/type_index/type_index_facade.hpp @@ -0,0 +1,300 @@ +// +// Copyright (c) Antony Polukhin, 2013-2015. +// +// +// 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_TYPE_INDEX_TYPE_INDEX_FACADE_HPP +#define BOOST_TYPE_INDEX_TYPE_INDEX_FACADE_HPP + +#include +#include +#include + +#if !defined(BOOST_NO_IOSTREAM) +#if !defined(BOOST_NO_IOSFWD) +#include // for std::basic_ostream +#else +#include +#endif +#endif + +#ifdef BOOST_HAS_PRAGMA_ONCE +# pragma once +#endif + +// Forward declaration from #include +namespace boost { + template std::size_t hash_range(It, It); +} + +namespace boost { namespace typeindex { + +/// \class type_index_facade +/// +/// This class takes care about the comparison operators, hash functions and +/// ostream operators. Use this class as a public base class for defining new +/// type_info-conforming classes. +/// +/// \b Example: +/// \code +/// class stl_type_index: public type_index_facade +/// { +/// public: +/// typedef std::type_info type_info_t; +/// private: +/// const type_info_t* data_; +/// +/// public: +/// stl_type_index(const type_info_t& data) noexcept +/// : data_(&data) +/// {} +/// // ... +/// }; +/// \endcode +/// +/// \tparam Derived Class derived from type_index_facade. +/// \tparam TypeInfo Class that will be used as a base type_info class. +/// \note Take a look at the protected methods. They are \b not \b defined in type_index_facade. +/// Protected member functions raw_name() \b must be defined in Derived class. All the other +/// methods are mandatory. +/// \see 'Making a custom type_index' section for more information about +/// creating your own type_index using type_index_facade. +template +class type_index_facade { +private: + /// @cond + BOOST_CXX14_CONSTEXPR const Derived & derived() const BOOST_NOEXCEPT { + return *static_cast(this); + } + /// @endcond +public: + typedef TypeInfo type_info_t; + + /// \b Override: This function \b may be redefined in Derived class. Overrides \b must not throw. + /// \return Name of a type. By default returns Derived::raw_name(). + inline const char* name() const BOOST_NOEXCEPT { + return derived().raw_name(); + } + + /// \b Override: This function \b may be redefined in Derived class. Overrides may throw. + /// \return Human readable type name. By default returns Derived::name(). + inline std::string pretty_name() const { + return derived().name(); + } + + /// \b Override: This function \b may be redefined in Derived class. Overrides \b must not throw. + /// \return True if two types are equal. By default compares types by raw_name(). + inline bool equal(const Derived& rhs) const BOOST_NOEXCEPT { + const char* const left = derived().raw_name(); + const char* const right = rhs.raw_name(); + return left == right || !std::strcmp(left, right); + } + + /// \b Override: This function \b may be redefined in Derived class. Overrides \b must not throw. + /// \return True if rhs is greater than this. By default compares types by raw_name(). + inline bool before(const Derived& rhs) const BOOST_NOEXCEPT { + const char* const left = derived().raw_name(); + const char* const right = rhs.raw_name(); + return left != right && std::strcmp(left, right) < 0; + } + + /// \b Override: This function \b may be redefined in Derived class. Overrides \b must not throw. + /// \return Hash code of a type. By default hashes types by raw_name(). + /// \note has to be included if this function is used. + inline std::size_t hash_code() const BOOST_NOEXCEPT { + const char* const name_raw = derived().raw_name(); + return boost::hash_range(name_raw, name_raw + std::strlen(name_raw)); + } + +#if defined(BOOST_TYPE_INDEX_DOXYGEN_INVOKED) +protected: + /// \b Override: This function \b must be redefined in Derived class. Overrides \b must not throw. + /// \return Pointer to unredable/raw type name. + inline const char* raw_name() const BOOST_NOEXCEPT; + + /// \b Override: This function \b may be redefined in Derived class. Overrides \b must not throw. + /// \return Const reference to underlying low level type_info_t. + inline const type_info_t& type_info() const BOOST_NOEXCEPT; + + /// This is a factory method that is used to create instances of Derived classes. + /// boost::typeindex::type_id() will call this method, if Derived has same type as boost::typeindex::type_index. + /// + /// \b Override: This function \b may be redefined and made public in Derived class. Overrides \b must not throw. + /// Overrides \b must remove const, volatile && and & modifiers from T. + /// \tparam T Type for which type_index must be created. + /// \return type_index for type T. + template + static Derived type_id() BOOST_NOEXCEPT; + + /// This is a factory method that is used to create instances of Derived classes. + /// boost::typeindex::type_id_with_cvr() will call this method, if Derived has same type as boost::typeindex::type_index. + /// + /// \b Override: This function \b may be redefined and made public in Derived class. Overrides \b must not throw. + /// Overrides \b must \b not remove const, volatile && and & modifiers from T. + /// \tparam T Type for which type_index must be created. + /// \return type_index for type T. + template + static Derived type_id_with_cvr() BOOST_NOEXCEPT; + + /// This is a factory method that is used to create instances of Derived classes. + /// boost::typeindex::type_id_runtime(const T&) will call this method, if Derived has same type as boost::typeindex::type_index. + /// + /// \b Override: This function \b may be redefined and made public in Derived class. + /// \param variable Variable which runtime type will be stored in type_index. + /// \return type_index with runtime type of variable. + template + static Derived type_id_runtime(const T& variable) BOOST_NOEXCEPT; + +#endif + +}; + +/// @cond +template +BOOST_CXX14_CONSTEXPR inline bool operator == (const type_index_facade& lhs, const type_index_facade& rhs) BOOST_NOEXCEPT { + return static_cast(lhs).equal(static_cast(rhs)); +} + +template +BOOST_CXX14_CONSTEXPR inline bool operator < (const type_index_facade& lhs, const type_index_facade& rhs) BOOST_NOEXCEPT { + return static_cast(lhs).before(static_cast(rhs)); +} + + + +template +BOOST_CXX14_CONSTEXPR inline bool operator > (const type_index_facade& lhs, const type_index_facade& rhs) BOOST_NOEXCEPT { + return rhs < lhs; +} + +template +BOOST_CXX14_CONSTEXPR inline bool operator <= (const type_index_facade& lhs, const type_index_facade& rhs) BOOST_NOEXCEPT { + return !(lhs > rhs); +} + +template +BOOST_CXX14_CONSTEXPR inline bool operator >= (const type_index_facade& lhs, const type_index_facade& rhs) BOOST_NOEXCEPT { + return !(lhs < rhs); +} + +template +BOOST_CXX14_CONSTEXPR inline bool operator != (const type_index_facade& lhs, const type_index_facade& rhs) BOOST_NOEXCEPT { + return !(lhs == rhs); +} + +// ######################### COMPARISONS with Derived ############################ // +template +inline bool operator == (const TypeInfo& lhs, const type_index_facade& rhs) BOOST_NOEXCEPT { + return Derived(lhs) == rhs; +} + +template +inline bool operator < (const TypeInfo& lhs, const type_index_facade& rhs) BOOST_NOEXCEPT { + return Derived(lhs) < rhs; +} + +template +inline bool operator > (const TypeInfo& lhs, const type_index_facade& rhs) BOOST_NOEXCEPT { + return rhs < Derived(lhs); +} + +template +inline bool operator <= (const TypeInfo& lhs, const type_index_facade& rhs) BOOST_NOEXCEPT { + return !(Derived(lhs) > rhs); +} + +template +inline bool operator >= (const TypeInfo& lhs, const type_index_facade& rhs) BOOST_NOEXCEPT { + return !(Derived(lhs) < rhs); +} + +template +inline bool operator != (const TypeInfo& lhs, const type_index_facade& rhs) BOOST_NOEXCEPT { + return !(Derived(lhs) == rhs); +} + + +template +inline bool operator == (const type_index_facade& lhs, const TypeInfo& rhs) BOOST_NOEXCEPT { + return lhs == Derived(rhs); +} + +template +inline bool operator < (const type_index_facade& lhs, const TypeInfo& rhs) BOOST_NOEXCEPT { + return lhs < Derived(rhs); +} + +template +inline bool operator > (const type_index_facade& lhs, const TypeInfo& rhs) BOOST_NOEXCEPT { + return Derived(rhs) < lhs; +} + +template +inline bool operator <= (const type_index_facade& lhs, const TypeInfo& rhs) BOOST_NOEXCEPT { + return !(lhs > Derived(rhs)); +} + +template +inline bool operator >= (const type_index_facade& lhs, const TypeInfo& rhs) BOOST_NOEXCEPT { + return !(lhs < Derived(rhs)); +} + +template +inline bool operator != (const type_index_facade& lhs, const TypeInfo& rhs) BOOST_NOEXCEPT { + return !(lhs == Derived(rhs)); +} + +// ######################### COMPARISONS with Derived END ############################ // + +/// @endcond + +#if defined(BOOST_TYPE_INDEX_DOXYGEN_INVOKED) + +/// noexcept comparison operators for type_index_facade classes. +bool operator ==, !=, <, ... (const type_index_facade& lhs, const type_index_facade& rhs) noexcept; + +/// noexcept comparison operators for type_index_facade and it's TypeInfo classes. +bool operator ==, !=, <, ... (const type_index_facade& lhs, const TypeInfo& rhs) noexcept; + +/// noexcept comparison operators for type_index_facade's TypeInfo and type_index_facade classes. +bool operator ==, !=, <, ... (const TypeInfo& lhs, const type_index_facade& rhs) noexcept; + +#endif + +#ifndef BOOST_NO_IOSTREAM +#ifdef BOOST_NO_TEMPLATED_IOSTREAMS +/// @cond +/// Ostream operator that will output demangled name +template +inline std::ostream& operator<<(std::ostream& ostr, const type_index_facade& ind) { + ostr << static_cast(ind).pretty_name(); + return ostr; +} +/// @endcond +#else +/// Ostream operator that will output demangled name. +template +inline std::basic_ostream& operator<<( + std::basic_ostream& ostr, + const type_index_facade& ind) +{ + ostr << static_cast(ind).pretty_name(); + return ostr; +} +#endif // BOOST_NO_TEMPLATED_IOSTREAMS +#endif // BOOST_NO_IOSTREAM + +/// This free function is used by Boost's unordered containers. +/// \note has to be included if this function is used. +template +inline std::size_t hash_value(const type_index_facade& lhs) BOOST_NOEXCEPT { + return static_cast(lhs).hash_code(); +} + +}} // namespace boost::typeindex + +#endif // BOOST_TYPE_INDEX_TYPE_INDEX_FACADE_HPP + diff --git a/contrib/src/boost/type_traits/add_reference.hpp b/contrib/src/boost/type_traits/add_reference.hpp index 526f259..3c91415 100644 --- a/contrib/src/boost/type_traits/add_reference.hpp +++ b/contrib/src/boost/type_traits/add_reference.hpp @@ -49,9 +49,9 @@ template struct add_reference // these full specialisations are always required: template <> struct add_reference { typedef void type; }; #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -template <> struct add_reference { typedef void type; }; -template <> struct add_reference { typedef void type; }; -template <> struct add_reference { typedef void type; }; +template <> struct add_reference { typedef const void type; }; +template <> struct add_reference { typedef const volatile void type; }; +template <> struct add_reference { typedef volatile void type; }; #endif } // namespace boost diff --git a/contrib/src/boost/type_traits/has_trivial_copy.hpp b/contrib/src/boost/type_traits/has_trivial_copy.hpp index 9d3265d..fd6ad2d 100644 --- a/contrib/src/boost/type_traits/has_trivial_copy.hpp +++ b/contrib/src/boost/type_traits/has_trivial_copy.hpp @@ -9,6 +9,7 @@ #ifndef BOOST_TT_HAS_TRIVIAL_COPY_HPP_INCLUDED #define BOOST_TT_HAS_TRIVIAL_COPY_HPP_INCLUDED +#include // size_t #include #include #include diff --git a/contrib/src/boost/type_traits/has_trivial_destructor.hpp b/contrib/src/boost/type_traits/has_trivial_destructor.hpp index 763283d..9a3a61f 100644 --- a/contrib/src/boost/type_traits/has_trivial_destructor.hpp +++ b/contrib/src/boost/type_traits/has_trivial_destructor.hpp @@ -21,7 +21,7 @@ #include #endif -#if defined(__GNUC__) || defined(__clang) || defined(__SUNPRO_CC) +#if defined(__GNUC__) || defined(__clang__) || defined(__SUNPRO_CC) #include #endif diff --git a/contrib/src/boost/type_traits/is_abstract.hpp b/contrib/src/boost/type_traits/is_abstract.hpp index 7715c5c..781d94a 100644 --- a/contrib/src/boost/type_traits/is_abstract.hpp +++ b/contrib/src/boost/type_traits/is_abstract.hpp @@ -48,6 +48,7 @@ // to degrade gracefully, rather than trash the compiler (John Maddock). // +#include // size_t #include #include #ifndef BOOST_IS_ABSTRACT diff --git a/contrib/src/boost/type_traits/is_array.hpp b/contrib/src/boost/type_traits/is_array.hpp index 497dc49..53e1613 100644 --- a/contrib/src/boost/type_traits/is_array.hpp +++ b/contrib/src/boost/type_traits/is_array.hpp @@ -15,7 +15,7 @@ #define BOOST_TT_IS_ARRAY_HPP_INCLUDED #include -#include +#include // size_t namespace boost { diff --git a/contrib/src/boost/type_traits/is_const.hpp b/contrib/src/boost/type_traits/is_const.hpp index d9dd2aa..e0ed88a 100644 --- a/contrib/src/boost/type_traits/is_const.hpp +++ b/contrib/src/boost/type_traits/is_const.hpp @@ -21,6 +21,7 @@ #ifndef BOOST_TT_IS_CONST_HPP_INCLUDED #define BOOST_TT_IS_CONST_HPP_INCLUDED +#include // size_t #include namespace boost { @@ -35,7 +36,7 @@ namespace boost { template struct is_const : public false_type {}; template struct is_const : public true_type{}; - template struct is_const : public true_type{}; + template struct is_const : public true_type{}; template struct is_const : public true_type{}; #endif diff --git a/contrib/src/boost/type_traits/is_default_constructible.hpp b/contrib/src/boost/type_traits/is_default_constructible.hpp index 7fd63f8..fa5d76a 100644 --- a/contrib/src/boost/type_traits/is_default_constructible.hpp +++ b/contrib/src/boost/type_traits/is_default_constructible.hpp @@ -9,9 +9,14 @@ #ifndef BOOST_TT_IS_DEFAULT_CONSTRUCTIBLE_HPP_INCLUDED #define BOOST_TT_IS_DEFAULT_CONSTRUCTIBLE_HPP_INCLUDED +#include // size_t #include #include +#if BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40700) +#include +#endif + #if !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1800) && !BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40500) #include @@ -28,10 +33,25 @@ namespace boost{ template static boost::type_traits::no_type test(...); }; - +#if BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40700) + template + struct is_default_constructible_abstract_filter + { + static const bool value = sizeof(is_default_constructible_imp::test(0)) == sizeof(boost::type_traits::yes_type); + }; + template + struct is_default_constructible_abstract_filter + { + static const bool value = false; + }; +#endif } +#if BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40700) + template struct is_default_constructible : public integral_constant::value>::value>{}; +#else template struct is_default_constructible : public integral_constant(0)) == sizeof(boost::type_traits::yes_type)>{}; +#endif template struct is_default_constructible : public is_default_constructible{}; template struct is_default_constructible : public is_default_constructible{}; template struct is_default_constructible : public integral_constant{}; diff --git a/contrib/src/boost/type_traits/is_destructible.hpp b/contrib/src/boost/type_traits/is_destructible.hpp index 9f1e5d9..742d990 100644 --- a/contrib/src/boost/type_traits/is_destructible.hpp +++ b/contrib/src/boost/type_traits/is_destructible.hpp @@ -9,6 +9,7 @@ #ifndef BOOST_TT_IS_DESTRUCTIBLE_HPP_INCLUDED #define BOOST_TT_IS_DESTRUCTIBLE_HPP_INCLUDED +#include // size_t #include #include diff --git a/contrib/src/boost/type_traits/is_pod.hpp b/contrib/src/boost/type_traits/is_pod.hpp index 9204c93..9bd1962 100644 --- a/contrib/src/boost/type_traits/is_pod.hpp +++ b/contrib/src/boost/type_traits/is_pod.hpp @@ -9,6 +9,7 @@ #ifndef BOOST_TT_IS_POD_HPP_INCLUDED #define BOOST_TT_IS_POD_HPP_INCLUDED +#include // size_t #include #include #include diff --git a/contrib/src/boost/type_traits/is_volatile.hpp b/contrib/src/boost/type_traits/is_volatile.hpp index cefe987..5b8e716 100644 --- a/contrib/src/boost/type_traits/is_volatile.hpp +++ b/contrib/src/boost/type_traits/is_volatile.hpp @@ -21,6 +21,7 @@ #ifndef BOOST_TT_IS_VOLATILE_HPP_INCLUDED #define BOOST_TT_IS_VOLATILE_HPP_INCLUDED +#include // size_t #include namespace boost { @@ -35,7 +36,7 @@ namespace boost { template struct is_volatile : public false_type {}; template struct is_volatile : public true_type{}; - template struct is_volatile : public true_type{}; + template struct is_volatile : public true_type{}; template struct is_volatile : public true_type{}; #endif diff --git a/contrib/src/boost/type_traits/remove_const.hpp b/contrib/src/boost/type_traits/remove_const.hpp index b47f851..e238962 100644 --- a/contrib/src/boost/type_traits/remove_const.hpp +++ b/contrib/src/boost/type_traits/remove_const.hpp @@ -12,7 +12,7 @@ #define BOOST_TT_REMOVE_CONST_HPP_INCLUDED #include -#include +#include // size_t #include namespace boost { diff --git a/contrib/src/boost/type_traits/remove_cv.hpp b/contrib/src/boost/type_traits/remove_cv.hpp index b50607f..08393cf 100644 --- a/contrib/src/boost/type_traits/remove_cv.hpp +++ b/contrib/src/boost/type_traits/remove_cv.hpp @@ -13,7 +13,7 @@ #include #include -#include +#include // size_t namespace boost { diff --git a/contrib/src/boost/type_traits/remove_pointer.hpp b/contrib/src/boost/type_traits/remove_pointer.hpp index fb79e59..9216652 100644 --- a/contrib/src/boost/type_traits/remove_pointer.hpp +++ b/contrib/src/boost/type_traits/remove_pointer.hpp @@ -18,7 +18,7 @@ namespace boost { -#ifdef BOOST_MSVC +#if BOOST_WORKAROUND(BOOST_MSVC, < 1900) namespace detail{ diff --git a/contrib/src/boost/type_traits/type_with_alignment.hpp b/contrib/src/boost/type_traits/type_with_alignment.hpp index ffa054a..ddf1d98 100644 --- a/contrib/src/boost/type_traits/type_with_alignment.hpp +++ b/contrib/src/boost/type_traits/type_with_alignment.hpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include // size_t #include #ifdef BOOST_MSVC diff --git a/contrib/src/boost/utility/base_from_member.hpp b/contrib/src/boost/utility/base_from_member.hpp index fc0e13c..604541d 100644 --- a/contrib/src/boost/utility/base_from_member.hpp +++ b/contrib/src/boost/utility/base_from_member.hpp @@ -47,11 +47,11 @@ // {} // This macro should only persist within this file. -#define BOOST_PRIVATE_CTR_DEF( z, n, data ) \ - template < BOOST_PP_ENUM_PARAMS(n, typename T) > \ - explicit base_from_member( BOOST_PP_ENUM_BINARY_PARAMS(n, T, x) ) \ - : member( BOOST_PP_ENUM_PARAMS(n, x) ) \ - {} \ +#define BOOST_PRIVATE_CTR_DEF( z, n, data ) \ + template < BOOST_PP_ENUM_PARAMS(n, typename T) > \ + base_from_member( BOOST_PP_ENUM_BINARY_PARAMS(n, T, x) ) \ + : member( BOOST_PP_ENUM_PARAMS(n, x) ) \ + {} \ /**/ @@ -142,7 +142,8 @@ protected: : member() {} - BOOST_PP_REPEAT_FROM_TO( 1, BOOST_PP_INC(BOOST_BASE_FROM_MEMBER_MAX_ARITY), + template < typename T0 > explicit base_from_member( T0 x0 ) : member( x0 ) {} + BOOST_PP_REPEAT_FROM_TO( 2, BOOST_PP_INC(BOOST_BASE_FROM_MEMBER_MAX_ARITY), BOOST_PRIVATE_CTR_DEF, _ ) #endif diff --git a/contrib/src/boost/uuid/detail/uuid_x86.hpp b/contrib/src/boost/uuid/detail/uuid_x86.hpp index 5c73670..120b8d6 100644 --- a/contrib/src/boost/uuid/detail/uuid_x86.hpp +++ b/contrib/src/boost/uuid/detail/uuid_x86.hpp @@ -49,7 +49,7 @@ BOOST_FORCEINLINE __m128i load_unaligned_si128(const uint8_t* p) BOOST_NOEXCEPT return _mm_lddqu_si128(reinterpret_cast< const __m128i* >(p)); #elif !defined(BOOST_UUID_DETAIL_MSVC_BUG981648) return _mm_loadu_si128(reinterpret_cast< const __m128i* >(p)); -#elif BOOST_MSVC >= 1600 +#elif defined(BOOST_MSVC) && BOOST_MSVC >= 1600 __m128i mm = _mm_loadu_si128(reinterpret_cast< const __m128i* >(p)); // Make sure this load doesn't get merged with the subsequent instructions _ReadWriteBarrier(); @@ -68,7 +68,7 @@ inline bool uuid::is_nil() const BOOST_NOEXCEPT #if defined(BOOST_UUID_USE_SSE41) return _mm_test_all_zeros(mm, mm) != 0; #else - mm = _mm_cmpeq_epi8(mm, _mm_setzero_si128()); + mm = _mm_cmpeq_epi32(mm, _mm_setzero_si128()); return _mm_movemask_epi8(mm) == 0xFFFF; #endif } @@ -86,11 +86,11 @@ inline bool operator== (uuid const& lhs, uuid const& rhs) BOOST_NOEXCEPT __m128i mm_left = uuids::detail::load_unaligned_si128(lhs.data); __m128i mm_right = uuids::detail::load_unaligned_si128(rhs.data); - __m128i mm_cmp = _mm_cmpeq_epi32(mm_left, mm_right); - #if defined(BOOST_UUID_USE_SSE41) - return _mm_test_all_ones(mm_cmp) != 0; + __m128i mm = _mm_xor_si128(mm_left, mm_right); + return _mm_test_all_zeros(mm, mm) != 0; #else + __m128i mm_cmp = _mm_cmpeq_epi32(mm_left, mm_right); return _mm_movemask_epi8(mm_cmp) == 0xFFFF; #endif } diff --git a/contrib/src/boost/uuid/name_generator.hpp b/contrib/src/boost/uuid/name_generator.hpp deleted file mode 100644 index 2e5d8c1..0000000 --- a/contrib/src/boost/uuid/name_generator.hpp +++ /dev/null @@ -1,125 +0,0 @@ -// Boost name_generator.hpp header file ----------------------------------------------// - -// Copyright 2010 Andy Tompkins. -// 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_UUID_NAME_GENERATOR_HPP -#define BOOST_UUID_NAME_GENERATOR_HPP - -#include -#include -#include -#include -#include // for strlen, wcslen - -#ifdef BOOST_NO_STDC_NAMESPACE -namespace std { - using ::strlen; - using ::wcslen; -} //namespace std -#endif //BOOST_NO_STDC_NAMESPACE - -namespace boost { -namespace uuids { - -// generate a name-based uuid -// TODO: add in common namesspace uuids -class name_generator { -public: - typedef uuid result_type; - - explicit name_generator(uuid const& namespace_uuid_) - : namespace_uuid(namespace_uuid_) - {} - - uuid operator()(const char* name) { - reset(); - process_characters(name, std::strlen(name)); - return sha_to_uuid(); - } - - uuid operator()(const wchar_t* name) { - reset(); - process_characters(name, std::wcslen(name)); - return sha_to_uuid(); - } - - template - uuid operator()(std::basic_string const& name) { - reset(); - process_characters(name.c_str(), name.length()); - return sha_to_uuid(); - } - - uuid operator()(void const* buffer, std::size_t byte_count) { - reset(); - sha.process_bytes(buffer, byte_count); - return sha_to_uuid(); - }; - -private: - // we convert all characters to uint32_t so that each - // character is 4 bytes reguardless of sizeof(char) or - // sizeof(wchar_t). We want the name string on any - // platform / compiler to generate the same uuid - // except for char - template - void process_characters(char_type const*const characters, size_t count) { - BOOST_ASSERT(sizeof(uint32_t) >= sizeof(char_type)); - - for (size_t i=0; i((c >> 0) & 0xFF)); - sha.process_byte(static_cast((c >> 8) & 0xFF)); - sha.process_byte(static_cast((c >> 16) & 0xFF)); - sha.process_byte(static_cast((c >> 24) & 0xFF)); - } - } - - void process_characters(char const*const characters, size_t count) { - sha.process_bytes(characters, count); - } - - void reset() - { - sha.reset(); - sha.process_bytes(namespace_uuid.begin(), namespace_uuid.size()); - } - - uuid sha_to_uuid() - { - unsigned int digest[5]; - - sha.get_digest(digest); - - uuid u; - for (int i=0; i<4; ++i) { - *(u.begin() + i*4+0) = static_cast((digest[i] >> 24) & 0xFF); - *(u.begin() + i*4+1) = static_cast((digest[i] >> 16) & 0xFF); - *(u.begin() + i*4+2) = static_cast((digest[i] >> 8) & 0xFF); - *(u.begin() + i*4+3) = static_cast((digest[i] >> 0) & 0xFF); - } - - // set variant - // must be 0b10xxxxxx - *(u.begin()+8) &= 0xBF; - *(u.begin()+8) |= 0x80; - - // set version - // must be 0b0101xxxx - *(u.begin()+6) &= 0x5F; //0b01011111 - *(u.begin()+6) |= 0x50; //0b01010000 - - return u; - } - -private: - uuid namespace_uuid; - detail::sha1 sha; -}; - -}} // namespace boost::uuids - -#endif // BOOST_UUID_NAME_GENERATOR_HPP diff --git a/contrib/src/boost/uuid/nil_generator.hpp b/contrib/src/boost/uuid/nil_generator.hpp deleted file mode 100644 index c3c5818..0000000 --- a/contrib/src/boost/uuid/nil_generator.hpp +++ /dev/null @@ -1,34 +0,0 @@ -// Boost nil_generator.hpp header file ----------------------------------------------// - -// Copyright 2010 Andy Tompkins. -// 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_UUID_NIL_GENERATOR_HPP -#define BOOST_UUID_NIL_GENERATOR_HPP - -#include - -namespace boost { -namespace uuids { - -// generate a nil uuid -struct nil_generator { - typedef uuid result_type; - - uuid operator()() const { - // initialize to all zeros - uuid u = {{0}}; - return u; - } -}; - -inline uuid nil_uuid() { - return nil_generator()(); -} - -}} // namespace boost::uuids - -#endif // BOOST_UUID_NIL_GENERATOR_HPP - diff --git a/contrib/src/boost/uuid/random_generator.hpp b/contrib/src/boost/uuid/random_generator.hpp index 0f4a0ab..7ca025b 100644 --- a/contrib/src/boost/uuid/random_generator.hpp +++ b/contrib/src/boost/uuid/random_generator.hpp @@ -34,7 +34,7 @@ private: public: typedef uuid result_type; - + // default constructor creates the random number generator basic_random_generator() : pURNG(new UniformRandomNumberGenerator) @@ -49,7 +49,7 @@ public: // seed the random number generator detail::seed(*pURNG); } - + // keep a reference to a random number generator // don't seed a given random number generator explicit basic_random_generator(UniformRandomNumberGenerator& gen) @@ -62,7 +62,7 @@ public: ) ) {} - + // keep a pointer to a random number generator // don't seed a given random number generator explicit basic_random_generator(UniformRandomNumberGenerator* pGen) @@ -77,11 +77,11 @@ public: { BOOST_ASSERT(pURNG); } - + uuid operator()() { uuid u; - + int i=0; unsigned long random_value = generator(); for (uuid::iterator it=u.begin(); it!=u.end(); ++it, ++i) { @@ -90,7 +90,7 @@ public: i = 0; } - // static_cast gets rid of warnings of converting unsigned long to boost::uint8_t + // static_cast gets rid of warnings of converting unsigned long to boost::uint8_t *it = static_cast((random_value >> (i*8)) & 0xFF); } diff --git a/contrib/src/boost/uuid/seed_rng.hpp b/contrib/src/boost/uuid/seed_rng.hpp index 5299b04..388a8f9 100644 --- a/contrib/src/boost/uuid/seed_rng.hpp +++ b/contrib/src/boost/uuid/seed_rng.hpp @@ -40,14 +40,18 @@ #if defined(_MSC_VER) # pragma warning(push) // Save warning settings. # pragma warning(disable : 4996) // Disable deprecated std::fopen +#if defined(_WIN32_WCE) +# pragma comment(lib, "coredll.lib") +#else # pragma comment(lib, "advapi32.lib") #endif +#endif #if defined(BOOST_WINDOWS) # include // for CryptAcquireContextA, CryptGenRandom, CryptReleaseContext # include -# include -# include +# include +# include #else # include // for gettimeofday # include // for pid_t @@ -92,7 +96,7 @@ public: , random_(NULL) { #if defined(BOOST_WINDOWS) - if (!boost::detail::winapi::CryptAcquireContextA( + if (!boost::detail::winapi::CryptAcquireContextW( &random_, NULL, NULL, @@ -107,7 +111,7 @@ public: std::memset(rd_, 0, sizeof(rd_)); } - + ~seed_rng() BOOST_NOEXCEPT { if (random_) { diff --git a/contrib/src/boost/uuid/string_generator.hpp b/contrib/src/boost/uuid/string_generator.hpp deleted file mode 100644 index 538ebe8..0000000 --- a/contrib/src/boost/uuid/string_generator.hpp +++ /dev/null @@ -1,185 +0,0 @@ -// Boost string_generator.hpp header file ----------------------------------------------// - -// Copyright 2010 Andy Tompkins. -// 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_UUID_STRING_GENERATOR_HPP -#define BOOST_UUID_STRING_GENERATOR_HPP - -#include -#include -#include // for strlen, wcslen -#include -#include // for find -#include -#include - -#ifdef BOOST_NO_STDC_NAMESPACE -namespace std { - using ::strlen; - using ::wcslen; -} //namespace std -#endif //BOOST_NO_STDC_NAMESPACE - -namespace boost { -namespace uuids { - -// generate a uuid from a string -// lexical_cast works fine using uuid_io.hpp -// but this generator should accept more forms -// and be more efficient -// would like to accept the following forms: -// 0123456789abcdef0123456789abcdef -// 01234567-89ab-cdef-0123456789abcdef -// {01234567-89ab-cdef-0123456789abcdef} -// {0123456789abcdef0123456789abcdef} -// others? -struct string_generator { - typedef uuid result_type; - - template - uuid operator()(std::basic_string const& s) const { - return operator()(s.begin(), s.end()); - } - - uuid operator()(char const*const s) const { - return operator()(s, s+std::strlen(s)); - } - - uuid operator()(wchar_t const*const s) const { - return operator()(s, s+std::wcslen(s)); - } - - template - uuid operator()(CharIterator begin, CharIterator end) const - { - typedef typename std::iterator_traits::value_type char_type; - - // check open brace - char_type c = get_next_char(begin, end); - bool has_open_brace = is_open_brace(c); - char_type open_brace_char = c; - if (has_open_brace) { - c = get_next_char(begin, end); - } - - bool has_dashes = false; - - uuid u; - int i=0; - for (uuid::iterator it_byte=u.begin(); it_byte!=u.end(); ++it_byte, ++i) { - if (it_byte != u.begin()) { - c = get_next_char(begin, end); - } - - if (i == 4) { - has_dashes = is_dash(c); - if (has_dashes) { - c = get_next_char(begin, end); - } - } - - if (has_dashes) { - if (i == 6 || i == 8 || i == 10) { - if (is_dash(c)) { - c = get_next_char(begin, end); - } else { - throw_invalid(); - } - } - } - - *it_byte = get_value(c); - - c = get_next_char(begin, end); - *it_byte <<= 4; - *it_byte |= get_value(c); - } - - // check close brace - if (has_open_brace) { - c = get_next_char(begin, end); - check_close_brace(c, open_brace_char); - } - - return u; - } - -private: - template - typename std::iterator_traits::value_type - get_next_char(CharIterator& begin, CharIterator end) const { - if (begin == end) { - throw_invalid(); - } - return *begin++; - } - - unsigned char get_value(char c) const { - static char const*const digits_begin = "0123456789abcdefABCDEF"; - static char const*const digits_end = digits_begin + 22; - - static unsigned char const values[] = - { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,10,11,12,13,14,15 - , static_cast(-1) }; - - char const* d = std::find(digits_begin, digits_end, c); - return values[d - digits_begin]; - } - - unsigned char get_value(wchar_t c) const { - static wchar_t const*const digits_begin = L"0123456789abcdefABCDEF"; - static wchar_t const*const digits_end = digits_begin + 22; - - static unsigned char const values[] = - { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,10,11,12,13,14,15 - , static_cast(-1) }; - - wchar_t const* d = std::find(digits_begin, digits_end, c); - return values[d - digits_begin]; - } - - bool is_dash(char c) const { - return c == '-'; - } - - bool is_dash(wchar_t c) const { - return c == L'-'; - } - - // return closing brace - bool is_open_brace(char c) const { - return (c == '{'); - } - - bool is_open_brace(wchar_t c) const { - return (c == L'{'); - } - - void check_close_brace(char c, char open_brace) const { - if (open_brace == '{' && c == '}') { - //great - } else { - throw_invalid(); - } - } - - void check_close_brace(wchar_t c, wchar_t open_brace) const { - if (open_brace == L'{' && c == L'}') { - // great - } else { - throw_invalid(); - } - } - - void throw_invalid() const { - BOOST_THROW_EXCEPTION(std::runtime_error("invalid uuid string")); - } -}; - -}} // namespace boost::uuids - -#endif //BOOST_UUID_STRING_GENERATOR_HPP - diff --git a/contrib/src/boost/uuid/uuid_generators.hpp b/contrib/src/boost/uuid/uuid_generators.hpp deleted file mode 100644 index 29d39cc..0000000 --- a/contrib/src/boost/uuid/uuid_generators.hpp +++ /dev/null @@ -1,19 +0,0 @@ -// Boost uuid_generators.hpp header file ----------------------------------------------// - -// Copyright 2006 Andy Tompkins. -// 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) - -// Revision History -// 06 Feb 2006 - Initial Revision - -#ifndef BOOST_UUID_GENERATORS_HPP -#define BOOST_UUID_GENERATORS_HPP - -#include -#include -#include -#include - -#endif //BOOST_UUID_GENERATORS_HPP diff --git a/contrib/src/boost/uuid/uuid_io.hpp b/contrib/src/boost/uuid/uuid_io.hpp index 1d30618..e92e881 100644 --- a/contrib/src/boost/uuid/uuid_io.hpp +++ b/contrib/src/boost/uuid/uuid_io.hpp @@ -46,7 +46,7 @@ template } } - os << std::hex; + os << std::hex << std::right; os.fill(os.widen('0')); std::size_t i=0; @@ -57,13 +57,13 @@ template os << os.widen('-'); } } - + if (flags & std::ios_base::left) { for (std::streamsize s=uuid_width; s to select which library version to link to. -#define BOOST_LIB_VERSION "1_60" +#define BOOST_LIB_VERSION "1_63" #endif -- cgit v0.12