From: Jean-Marc Lasgouttes Date: Sat, 22 Oct 2016 14:28:52 +0000 (+0200) Subject: Update boost to version 1.62. X-Git-Tag: 2.2.3~215 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=447254eb59fac5fb8a24b142d5605e29cdecc02f;p=features.git Update boost to version 1.62. --- diff --git a/3rdparty/boost/boost/align/align.hpp b/3rdparty/boost/boost/align/align.hpp index 648a65e295..3582dcc051 100644 --- a/3rdparty/boost/boost/align/align.hpp +++ b/3rdparty/boost/boost/align/align.hpp @@ -1,5 +1,5 @@ /* -(c) 2014 Glen Joseph Fernandes +(c) 2014-2015 Glen Joseph Fernandes Distributed under the Boost Software diff --git a/3rdparty/boost/boost/align/detail/address.hpp b/3rdparty/boost/boost/align/detail/address.hpp deleted file mode 100644 index b38e571534..0000000000 --- a/3rdparty/boost/boost/align/detail/address.hpp +++ /dev/null @@ -1,29 +0,0 @@ -/* -(c) 2014 Glen Joseph Fernandes - - -Distributed under the Boost Software -License, Version 1.0. -http://boost.org/LICENSE_1_0.txt -*/ -#ifndef BOOST_ALIGN_DETAIL_ADDRESS_HPP -#define BOOST_ALIGN_DETAIL_ADDRESS_HPP - -#include -#include - -namespace boost { -namespace alignment { -namespace detail { - -#if defined(BOOST_HAS_INTPTR_T) -typedef boost::uintptr_t address; -#else -typedef std::size_t address; -#endif - -} /* .detail */ -} /* .alignment */ -} /* .boost */ - -#endif diff --git a/3rdparty/boost/boost/align/detail/align.hpp b/3rdparty/boost/boost/align/detail/align.hpp index d2404b3e6d..77055e0328 100644 --- a/3rdparty/boost/boost/align/detail/align.hpp +++ b/3rdparty/boost/boost/align/detail/align.hpp @@ -1,5 +1,5 @@ /* -(c) 2014 Glen Joseph Fernandes +(c) 2014-2016 Glen Joseph Fernandes Distributed under the Boost Software @@ -9,10 +9,8 @@ http://boost.org/LICENSE_1_0.txt #ifndef BOOST_ALIGN_DETAIL_ALIGN_HPP #define BOOST_ALIGN_DETAIL_ALIGN_HPP -#include -#include #include -#include +#include namespace boost { namespace alignment { @@ -21,17 +19,17 @@ inline void* align(std::size_t alignment, std::size_t size, void*& ptr, std::size_t& space) { BOOST_ASSERT(detail::is_alignment(alignment)); - std::size_t n = detail::address(ptr) & (alignment - 1); - if (n != 0) { - n = alignment - n; - } - void* p = 0; - if (n <= space && size <= space - n) { - p = static_cast(ptr) + n; - ptr = p; - space -= n; + if (size <= space) { + char* p = (char*)(((std::size_t)ptr + alignment - 1) & + ~(alignment - 1)); + std::size_t n = space - (p - static_cast(ptr)); + if (size <= n) { + ptr = p; + space = n; + return p; + } } - return p; + return 0; } } /* .alignment */ diff --git a/3rdparty/boost/boost/bind/bind.hpp b/3rdparty/boost/boost/bind/bind.hpp index f793551d1a..85d675a0e3 100644 --- a/3rdparty/boost/boost/bind/bind.hpp +++ b/3rdparty/boost/boost/bind/bind.hpp @@ -887,9 +887,17 @@ public: template T & operator[] (reference_wrapper const & v) const { return v.get(); } - template typename result_traits::type operator[] (bind_t & b) const { return b.eval(*this); } + template typename result_traits::type operator[] (bind_t & b) const + { + rrlist1 a( a1_ ); + return b.eval( a ); + } - template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } + template typename result_traits::type operator[] (bind_t const & b) const + { + rrlist1 a( a1_ ); + return b.eval( a ); + } }; template< class A1, class A2 > class rrlist2 @@ -915,9 +923,17 @@ public: template T & operator[] (reference_wrapper const & v) const { return v.get(); } - template typename result_traits::type operator[] (bind_t & b) const { return b.eval(*this); } + template typename result_traits::type operator[] (bind_t & b) const + { + rrlist2 a( a1_, a2_ ); + return b.eval( a ); + } - template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } + template typename result_traits::type operator[] (bind_t const & b) const + { + rrlist2 a( a1_, a2_ ); + return b.eval( a ); + } }; template< class A1, class A2, class A3 > class rrlist3 @@ -946,9 +962,17 @@ public: template T & operator[] (reference_wrapper const & v) const { return v.get(); } - template typename result_traits::type operator[] (bind_t & b) const { return b.eval(*this); } + template typename result_traits::type operator[] (bind_t & b) const + { + rrlist3 a( a1_, a2_, a3_ ); + return b.eval( a ); + } - template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } + template typename result_traits::type operator[] (bind_t const & b) const + { + rrlist3 a( a1_, a2_, a3_ ); + return b.eval( a ); + } }; template< class A1, class A2, class A3, class A4 > class rrlist4 @@ -980,9 +1004,17 @@ public: template T & operator[] (reference_wrapper const & v) const { return v.get(); } - template typename result_traits::type operator[] (bind_t & b) const { return b.eval(*this); } + template typename result_traits::type operator[] (bind_t & b) const + { + rrlist4 a( a1_, a2_, a3_, a4_ ); + return b.eval( a ); + } - template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } + template typename result_traits::type operator[] (bind_t const & b) const + { + rrlist4 a( a1_, a2_, a3_, a4_ ); + return b.eval( a ); + } }; template< class A1, class A2, class A3, class A4, class A5 > class rrlist5 @@ -1017,9 +1049,17 @@ public: template T & operator[] (reference_wrapper const & v) const { return v.get(); } - template typename result_traits::type operator[] (bind_t & b) const { return b.eval(*this); } + template typename result_traits::type operator[] (bind_t & b) const + { + rrlist5 a( a1_, a2_, a3_, a4_, a5_ ); + return b.eval( a ); + } - template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } + template typename result_traits::type operator[] (bind_t const & b) const + { + rrlist5 a( a1_, a2_, a3_, a4_, a5_ ); + return b.eval( a ); + } }; template< class A1, class A2, class A3, class A4, class A5, class A6 > class rrlist6 @@ -1057,9 +1097,17 @@ public: template T & operator[] (reference_wrapper const & v) const { return v.get(); } - template typename result_traits::type operator[] (bind_t & b) const { return b.eval(*this); } + template typename result_traits::type operator[] (bind_t & b) const + { + rrlist6 a( a1_, a2_, a3_, a4_, a5_, a6_ ); + return b.eval( a ); + } - template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } + template typename result_traits::type operator[] (bind_t const & b) const + { + rrlist6 a( a1_, a2_, a3_, a4_, a5_, a6_ ); + return b.eval( a ); + } }; template< class A1, class A2, class A3, class A4, class A5, class A6, class A7 > class rrlist7 @@ -1100,9 +1148,17 @@ public: template T & operator[] (reference_wrapper const & v) const { return v.get(); } - template typename result_traits::type operator[] (bind_t & b) const { return b.eval(*this); } + template typename result_traits::type operator[] (bind_t & b) const + { + rrlist7 a( a1_, a2_, a3_, a4_, a5_, a6_, a7_ ); + return b.eval( a ); + } - template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } + template typename result_traits::type operator[] (bind_t const & b) const + { + rrlist7 a( a1_, a2_, a3_, a4_, a5_, a6_, a7_ ); + return b.eval( a ); + } }; template< class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 > class rrlist8 @@ -1146,9 +1202,17 @@ public: template T & operator[] (reference_wrapper const & v) const { return v.get(); } - template typename result_traits::type operator[] (bind_t & b) const { return b.eval(*this); } + template typename result_traits::type operator[] (bind_t & b) const + { + rrlist8 a( a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_ ); + return b.eval( a ); + } - template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } + template typename result_traits::type operator[] (bind_t const & b) const + { + rrlist8 a( a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_ ); + return b.eval( a ); + } }; template< class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9 > class rrlist9 @@ -1195,9 +1259,17 @@ public: template T & operator[] (reference_wrapper const & v) const { return v.get(); } - template typename result_traits::type operator[] (bind_t & b) const { return b.eval(*this); } + template typename result_traits::type operator[] (bind_t & b) const + { + rrlist9 a( a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_, a9_ ); + return b.eval( a ); + } - template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } + template typename result_traits::type operator[] (bind_t const & b) const + { + rrlist9 a( a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_, a9_ ); + return b.eval( a ); + } }; template class bind_t diff --git a/3rdparty/boost/boost/config/compiler/borland.hpp b/3rdparty/boost/boost/config/compiler/borland.hpp index 80dd230034..ccd930ea53 100644 --- a/3rdparty/boost/boost/config/compiler/borland.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/config/compiler/clang.hpp b/3rdparty/boost/boost/config/compiler/clang.hpp index 5481e5ee62..150e3c0d52 100644 --- a/3rdparty/boost/boost/config/compiler/clang.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/config/compiler/codegear.hpp b/3rdparty/boost/boost/config/compiler/codegear.hpp index 02bd792a15..e2f6061b37 100644 --- a/3rdparty/boost/boost/config/compiler/codegear.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/config/compiler/comeau.hpp b/3rdparty/boost/boost/config/compiler/comeau.hpp index 278222dcfd..09841604f9 100644 --- a/3rdparty/boost/boost/config/compiler/comeau.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/config/compiler/common_edg.hpp b/3rdparty/boost/boost/config/compiler/common_edg.hpp index b92e574d60..c09faeb0dd 100644 --- a/3rdparty/boost/boost/config/compiler/common_edg.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/config/compiler/compaq_cxx.hpp b/3rdparty/boost/boost/config/compiler/compaq_cxx.hpp index b44486c673..4d6b8ab3ac 100644 --- a/3rdparty/boost/boost/config/compiler/compaq_cxx.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/config/compiler/cray.hpp b/3rdparty/boost/boost/config/compiler/cray.hpp index 3f66043357..837f815234 100644 --- a/3rdparty/boost/boost/config/compiler/cray.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/config/compiler/digitalmars.hpp b/3rdparty/boost/boost/config/compiler/digitalmars.hpp index a3d293c7b5..c344aae044 100644 --- a/3rdparty/boost/boost/config/compiler/digitalmars.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/config/compiler/gcc.hpp b/3rdparty/boost/boost/config/compiler/gcc.hpp index d9dd59dc5f..e319d04958 100644 --- a/3rdparty/boost/boost/config/compiler/gcc.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/config/compiler/gcc_xml.hpp b/3rdparty/boost/boost/config/compiler/gcc_xml.hpp index c11f29dd01..b56c78628c 100644 --- a/3rdparty/boost/boost/config/compiler/gcc_xml.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/config/compiler/greenhills.hpp b/3rdparty/boost/boost/config/compiler/greenhills.hpp index 038b6b2b52..a76a07cf4a 100644 --- a/3rdparty/boost/boost/config/compiler/greenhills.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/config/compiler/hp_acc.hpp b/3rdparty/boost/boost/config/compiler/hp_acc.hpp index fb63839a57..a773b8c442 100644 --- a/3rdparty/boost/boost/config/compiler/hp_acc.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/config/compiler/intel.hpp b/3rdparty/boost/boost/config/compiler/intel.hpp index 7789b94464..80969e9edd 100644 --- a/3rdparty/boost/boost/config/compiler/intel.hpp +++ b/3rdparty/boost/boost/config/compiler/intel.hpp @@ -90,7 +90,7 @@ #else -#include "boost/config/compiler/common_edg.hpp" +#include #if defined(__INTEL_COMPILER) #if __INTEL_COMPILER == 9999 @@ -514,7 +514,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/3rdparty/boost/boost/config/compiler/kai.hpp b/3rdparty/boost/boost/config/compiler/kai.hpp index 2337e6a8dd..960d501c86 100644 --- a/3rdparty/boost/boost/config/compiler/kai.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/config/compiler/metrowerks.hpp b/3rdparty/boost/boost/config/compiler/metrowerks.hpp index c930143450..3c5e22868a 100644 --- a/3rdparty/boost/boost/config/compiler/metrowerks.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/config/compiler/mpw.hpp b/3rdparty/boost/boost/config/compiler/mpw.hpp index 76045bcd3f..084f9e154f 100644 --- a/3rdparty/boost/boost/config/compiler/mpw.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/config/compiler/nvcc.hpp b/3rdparty/boost/boost/config/compiler/nvcc.hpp index bbe81f6ee5..5a047070af 100644 --- a/3rdparty/boost/boost/config/compiler/nvcc.hpp +++ b/3rdparty/boost/boost/config/compiler/nvcc.hpp @@ -14,3 +14,11 @@ // 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 diff --git a/3rdparty/boost/boost/config/compiler/pathscale.hpp b/3rdparty/boost/boost/config/compiler/pathscale.hpp index 7c211c4517..a5e65af49b 100644 --- a/3rdparty/boost/boost/config/compiler/pathscale.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/config/compiler/pgi.hpp b/3rdparty/boost/boost/config/compiler/pgi.hpp index e5605c9ec2..fa2d5e402d 100644 --- a/3rdparty/boost/boost/config/compiler/pgi.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/config/compiler/sgi_mipspro.hpp b/3rdparty/boost/boost/config/compiler/sgi_mipspro.hpp index 90688314ad..54433c9978 100644 --- a/3rdparty/boost/boost/config/compiler/sgi_mipspro.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/config/compiler/sunpro_cc.hpp b/3rdparty/boost/boost/config/compiler/sunpro_cc.hpp index 6017660cbb..8f07e0e9a2 100644 --- a/3rdparty/boost/boost/config/compiler/sunpro_cc.hpp +++ b/3rdparty/boost/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 @@ -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/3rdparty/boost/boost/config/compiler/vacpp.hpp b/3rdparty/boost/boost/config/compiler/vacpp.hpp index 6c228eab6e..3fbed9fafe 100644 --- a/3rdparty/boost/boost/config/compiler/vacpp.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/config/compiler/visualc.hpp b/3rdparty/boost/boost/config/compiler/visualc.hpp index baaab589ef..72caff4974 100644 --- a/3rdparty/boost/boost/config/compiler/visualc.hpp +++ b/3rdparty/boost/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,14 @@ # 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 // MSVC including version 14 has not yet completely @@ -193,15 +206,11 @@ // 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_TWO_PHASE_NAME_LOOKUP // -#define BOOST_NO_CXX11_CONSTEXPR - // C++ 14: #if !defined(__cpp_aggregate_nsdmi) || (__cpp_aggregate_nsdmi < 201304) # define BOOST_NO_CXX14_AGGREGATE_NSDMI @@ -209,9 +218,6 @@ #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 // // prefix and suffix headers: diff --git a/3rdparty/boost/boost/config/compiler/xlcpp.hpp b/3rdparty/boost/boost/config/compiler/xlcpp.hpp index e369ecefd2..2aaafc3b66 100644 --- a/3rdparty/boost/boost/config/compiler/xlcpp.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/config/platform/linux.hpp b/3rdparty/boost/boost/config/platform/linux.hpp index 6fa5f45be4..8c43c7b6d3 100644 --- a/3rdparty/boost/boost/config/platform/linux.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/config/select_compiler_config.hpp b/3rdparty/boost/boost/config/select_compiler_config.hpp index 4d87093af3..7a75708428 100644 --- a/3rdparty/boost/boost/config/select_compiler_config.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/config/stdlib/libcpp.hpp b/3rdparty/boost/boost/config/stdlib/libcpp.hpp index ab5d123544..096b8c0de2 100644 --- a/3rdparty/boost/boost/config/stdlib/libcpp.hpp +++ b/3rdparty/boost/boost/config/stdlib/libcpp.hpp @@ -53,19 +53,35 @@ # 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 + +#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/3rdparty/boost/boost/config/stdlib/libstdcpp3.hpp b/3rdparty/boost/boost/config/stdlib/libstdcpp3.hpp index 9718bedcf2..1d8f6ccbce 100644 --- a/3rdparty/boost/boost/config/stdlib/libstdcpp3.hpp +++ b/3rdparty/boost/boost/config/stdlib/libstdcpp3.hpp @@ -151,13 +151,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) @@ -247,7 +263,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/3rdparty/boost/boost/config/suffix.hpp b/3rdparty/boost/boost/config/suffix.hpp index 17bf1020f5..eeaec2bf69 100644 --- a/3rdparty/boost/boost/config/suffix.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/core/demangle.hpp b/3rdparty/boost/boost/core/demangle.hpp index 44aeb8ded7..f13c26a7f4 100644 --- a/3rdparty/boost/boost/core/demangle.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/detail/iterator.hpp b/3rdparty/boost/boost/detail/iterator.hpp index c2e8f1e2a5..2498ef448f 100644 --- a/3rdparty/boost/boost/detail/iterator.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/exception/exception.hpp b/3rdparty/boost/boost/exception/exception.hpp index 1f2bd9c200..213af3dbb8 100644 --- a/3rdparty/boost/boost/exception/exception.hpp +++ b/3rdparty/boost/boost/exception/exception.hpp @@ -182,6 +182,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 +276,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/3rdparty/boost/boost/format/parsing.hpp b/3rdparty/boost/boost/format/parsing.hpp index 04ddf368e1..bfddfef761 100644 --- a/3rdparty/boost/boost/format/parsing.hpp +++ b/3rdparty/boost/boost/format/parsing.hpp @@ -19,6 +19,7 @@ #include #include #include +#include namespace boost { @@ -267,6 +268,7 @@ namespace detail { switch ( wrap_narrow(fac, *start, 0) ) { case 'X': fpar->fmtstate_.flags_ |= std::ios_base::uppercase; + BOOST_FALLTHROUGH; case 'p': // pointer => set hex. case 'x': fpar->fmtstate_.flags_ &= ~std::ios_base::basefield; @@ -280,6 +282,7 @@ namespace detail { case 'E': fpar->fmtstate_.flags_ |= std::ios_base::uppercase; + BOOST_FALLTHROUGH; case 'e': fpar->fmtstate_.flags_ &= ~std::ios_base::floatfield; fpar->fmtstate_.flags_ |= std::ios_base::scientific; @@ -291,6 +294,7 @@ namespace detail { case 'f': fpar->fmtstate_.flags_ &= ~std::ios_base::floatfield; fpar->fmtstate_.flags_ |= std::ios_base::fixed; + BOOST_FALLTHROUGH; case 'u': case 'd': case 'i': diff --git a/3rdparty/boost/boost/function/function_base.hpp b/3rdparty/boost/boost/function/function_base.hpp index 35c1995ece..21a0c0da7f 100644 --- a/3rdparty/boost/boost/function/function_base.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/function/function_template.hpp b/3rdparty/boost/boost/function/function_template.hpp index 211b81dbe3..82c81d7697 100644 --- a/3rdparty/boost/boost/function/function_template.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/functional/hash/hash.hpp b/3rdparty/boost/boost/functional/hash/hash.hpp index 2fb9f21116..0a8ceeb474 100644 --- a/3rdparty/boost/boost/functional/hash/hash.hpp +++ b/3rdparty/boost/boost/functional/hash/hash.hpp @@ -212,7 +212,6 @@ namespace boost seed ^= value + 0x9e3779b9 + (seed<<6) + (seed>>2); } - template inline void hash_combine_impl(boost::uint32_t& h1, boost::uint32_t k1) { @@ -229,12 +228,11 @@ namespace boost } -// Don't define 64-bit hash combine on platforms with 64 bit integers, +// Don't define 64-bit hash combine on platforms without 64 bit integers, // and also not for 32-bit gcc as it warns about the 64-bit constant. #if !defined(BOOST_NO_INT64_T) && \ !(defined(__GNUC__) && ULONG_MAX == 0xffffffff) - template inline void hash_combine_impl(boost::uint64_t& h, boost::uint64_t k) { @@ -247,6 +245,10 @@ namespace boost h ^= k; h *= m; + + // Completely arbitrary number, to prevent 0's + // from hashing to 0. + h += 0xe6546b64; } #endif // BOOST_NO_INT64_T diff --git a/3rdparty/boost/boost/lexical_cast.hpp b/3rdparty/boost/boost/lexical_cast.hpp index dc3d7e3fb7..3dc21f88a4 100644 --- a/3rdparty/boost/boost/lexical_cast.hpp +++ b/3rdparty/boost/boost/lexical_cast.hpp @@ -36,7 +36,7 @@ namespace boost template inline Target lexical_cast(const Source &arg) { - Target result; + Target result = Target(); if (!boost::conversion::detail::try_lexical_convert(arg, result)) { boost::conversion::detail::throw_bad_cast(); diff --git a/3rdparty/boost/boost/lexical_cast/detail/converter_lexical_streams.hpp b/3rdparty/boost/boost/lexical_cast/detail/converter_lexical_streams.hpp index ba8d3b4dc3..981594995a 100644 --- a/3rdparty/boost/boost/lexical_cast/detail/converter_lexical_streams.hpp +++ b/3rdparty/boost/boost/lexical_cast/detail/converter_lexical_streams.hpp @@ -467,7 +467,7 @@ namespace boost { template bool operator<<(boost::array const& input) BOOST_NOEXCEPT { - return shl_char_array_limited(input.begin(), N); + return shl_char_array_limited(input.data(), N); } template @@ -697,7 +697,7 @@ namespace boost { template bool operator>>(std::array& output) BOOST_NOEXCEPT { BOOST_STATIC_ASSERT_MSG( - (sizeof(boost::array) == sizeof(boost::array)), + (sizeof(std::array) == sizeof(boost::array)), "std::array and boost::array must have exactly the same layout." ); return ((*this) >> reinterpret_cast& >(output)); diff --git a/3rdparty/boost/boost/lexical_cast/try_lexical_convert.hpp b/3rdparty/boost/boost/lexical_cast/try_lexical_convert.hpp index 1881cdf371..b079fd42ae 100644 --- a/3rdparty/boost/boost/lexical_cast/try_lexical_convert.hpp +++ b/3rdparty/boost/boost/lexical_cast/try_lexical_convert.hpp @@ -1,6 +1,6 @@ // Copyright Kevlin Henney, 2000-2005. // Copyright Alexander Nasonov, 2006-2010. -// Copyright Antony Polukhin, 2011-2014. +// Copyright Antony Polukhin, 2011-2016. // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at @@ -57,8 +57,15 @@ namespace boost { : boost::true_type {}; + // Sun Studio has problem with partial specialization of templates differing only in namespace. + // We workaround that by making `is_booststring` trait, instead of specializing `is_stdstring` for `boost::container::basic_string`. + template + struct is_booststring + : boost::false_type + {}; + template - struct is_stdstring< boost::container::basic_string > + struct is_booststring< boost::container::basic_string > : boost::true_type {}; @@ -111,13 +118,20 @@ namespace boost { : boost::true_type {}; + // Sun Studio has problem with partial specialization of templates differing only in namespace. + // We workaround that by making `is_char_array_to_booststring` trait, instead of specializing `is_char_array_to_stdstring` for `boost::container::basic_string`. + template + struct is_char_array_to_booststring + : boost::false_type + {}; + template - struct is_char_array_to_stdstring< boost::container::basic_string, CharT* > + struct is_char_array_to_booststring< boost::container::basic_string, CharT* > : boost::true_type {}; template - struct is_char_array_to_stdstring< boost::container::basic_string, const CharT* > + struct is_char_array_to_booststring< boost::container::basic_string, const CharT* > : boost::true_type {}; @@ -151,9 +165,10 @@ namespace boost { typedef boost::mpl::bool_< boost::detail::is_xchar_to_xchar::value || boost::detail::is_char_array_to_stdstring::value || + boost::detail::is_char_array_to_booststring::value || ( boost::is_same::value && - boost::detail::is_stdstring::value + (boost::detail::is_stdstring::value || boost::detail::is_booststring::value) ) || ( boost::is_same::value && diff --git a/3rdparty/boost/boost/math/policies/policy.hpp b/3rdparty/boost/boost/math/policies/policy.hpp index de813fb8aa..c1e1a7be4a 100644 --- a/3rdparty/boost/boost/math/policies/policy.hpp +++ b/3rdparty/boost/boost/math/policies/policy.hpp @@ -914,11 +914,9 @@ struct series_factor_calc template struct series_factor_calc { - BOOST_STATIC_CONSTANT(boost::uintmax_t, v = static_cast(1u) << (Digits::value - 1)); - static BOOST_MATH_CONSTEXPR T get() BOOST_MATH_NOEXCEPT(T) { - return 1 / static_cast(v); + return 1 / static_cast(static_cast(1u) << (Digits::value - 1)); } }; template diff --git a/3rdparty/boost/boost/math/special_functions/fpclassify.hpp b/3rdparty/boost/boost/math/special_functions/fpclassify.hpp index 0a4e1ac7aa..d83e111c48 100644 --- a/3rdparty/boost/boost/math/special_functions/fpclassify.hpp +++ b/3rdparty/boost/boost/math/special_functions/fpclassify.hpp @@ -81,7 +81,12 @@ is used. #include #endif #ifdef BOOST_MATH_USE_FLOAT128 +#ifdef __has_include +#if __has_include("quadmath.h") #include "quadmath.h" +#define BOOST_MATH_HAS_QUADMATH_H +#endif +#endif #endif #ifdef BOOST_NO_STDC_NAMESPACE @@ -124,9 +129,18 @@ inline bool is_nan_helper(T, const boost::false_type&) { return false; } -#ifdef BOOST_MATH_USE_FLOAT128 +#if defined(BOOST_MATH_USE_FLOAT128) +#if defined(BOOST_MATH_HAS_QUADMATH_H) inline bool is_nan_helper(__float128 f, const boost::true_type&) { return ::isnanq(f); } inline bool is_nan_helper(__float128 f, const boost::false_type&) { return ::isnanq(f); } +#elif defined(BOOST_GNU_STDLIB) && BOOST_GNU_STDLIB && \ + _GLIBCXX_USE_C99_MATH && !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC +inline bool is_nan_helper(__float128 f, const boost::true_type&) { return std::isnan(static_cast(f)); } +inline bool is_nan_helper(__float128 f, const boost::false_type&) { return std::isnan(static_cast(f)); } +#else +inline bool is_nan_helper(__float128 f, const boost::true_type&) { return ::isnan(static_cast(f)); } +inline bool is_nan_helper(__float128 f, const boost::false_type&) { return ::isnan(static_cast(f)); } +#endif #endif } @@ -519,7 +533,7 @@ inline bool (isinf)(long double x) return detail::isinf_impl(static_cast(x), method()); } #endif -#ifdef BOOST_MATH_USE_FLOAT128 +#if defined(BOOST_MATH_USE_FLOAT128) && defined(BOOST_MATH_HAS_QUADMATH_H) template<> inline bool (isinf)(__float128 x) { @@ -611,7 +625,7 @@ inline bool (isnan)(long double x) return detail::isnan_impl(x, method()); } #endif -#ifdef BOOST_MATH_USE_FLOAT128 +#if defined(BOOST_MATH_USE_FLOAT128) && defined(BOOST_MATH_HAS_QUADMATH_H) template<> inline bool (isnan)(__float128 x) { diff --git a/3rdparty/boost/boost/math/tools/config.hpp b/3rdparty/boost/boost/math/tools/config.hpp index ffd0ab43a6..32375e6a6e 100644 --- a/3rdparty/boost/boost/math/tools/config.hpp +++ b/3rdparty/boost/boost/math/tools/config.hpp @@ -265,18 +265,6 @@ # define BOOST_MATH_INT_VALUE_SUFFIX(RV, SUF) RV##SUF #endif // -// Test whether to support __float128, if we don't have quadmath.h then this can't currently work: -// -#ifndef BOOST_MATH_USE_FLOAT128 -#ifdef __has_include -#if ! __has_include("quadmath.h") -#define BOOST_MATH_DISABLE_FLOAT128 -#endif -#elif !defined(BOOST_ARCH_X86) -#define BOOST_MATH_DISABLE_FLOAT128 -#endif -#endif -// // And then the actual configuration: // #if defined(_GLIBCXX_USE_FLOAT128) && defined(BOOST_GCC) && !defined(__STRICT_ANSI__) \ @@ -454,8 +442,16 @@ namespace boost{ namespace math{ #endif -#endif // BOOST_MATH_TOOLS_CONFIG_HPP +// +// Thread local storage: +// +#if !defined(BOOST_NO_CXX11_THREAD_LOCAL) && !defined(BOOST_INTEL) +# define BOOST_MATH_THREAD_LOCAL thread_local +#else +# define BOOST_MATH_THREAD_LOCAL +#endif +#endif // BOOST_MATH_TOOLS_CONFIG_HPP diff --git a/3rdparty/boost/boost/move/core.hpp b/3rdparty/boost/boost/move/core.hpp index 54aece0b71..1dd8a8c271 100644 --- a/3rdparty/boost/boost/move/core.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/move/detail/config_begin.hpp b/3rdparty/boost/boost/move/detail/config_begin.hpp index 342390b816..637eb158bd 100644 --- a/3rdparty/boost/boost/move/detail/config_begin.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/move/detail/meta_utils.hpp b/3rdparty/boost/boost/move/detail/meta_utils.hpp index 323c13af10..e45394c97d 100644 --- a/3rdparty/boost/boost/move/detail/meta_utils.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/move/detail/meta_utils_core.hpp b/3rdparty/boost/boost/move/detail/meta_utils_core.hpp index 4d715a060a..40dbb6efc3 100644 --- a/3rdparty/boost/boost/move/detail/meta_utils_core.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/move/detail/type_traits.hpp b/3rdparty/boost/boost/move/detail/type_traits.hpp index 816fdca7b2..1b5d8388e4 100644 --- a/3rdparty/boost/boost/move/detail/type_traits.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/move/detail/workaround.hpp b/3rdparty/boost/boost/move/detail/workaround.hpp index b3f81b117f..befe141e96 100644 --- a/3rdparty/boost/boost/move/detail/workaround.hpp +++ b/3rdparty/boost/boost/move/detail/workaround.hpp @@ -52,4 +52,17 @@ #define BOOST_MOVE_MSVC_AUTO_MOVE_RETURN_BUG #endif +#define BOOST_MOVE_DISABLE_FORCEINLINE + +#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 +#else + #define BOOST_MOVE_FORCEINLINE BOOST_FORCEINLINE +#endif + #endif //#ifndef BOOST_MOVE_DETAIL_WORKAROUND_HPP diff --git a/3rdparty/boost/boost/move/utility.hpp b/3rdparty/boost/boost/move/utility.hpp index 8f9c20b65f..28de7935c8 100644 --- a/3rdparty/boost/boost/move/utility.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/move/utility_core.hpp b/3rdparty/boost/boost/move/utility_core.hpp index 7fd1ea1443..55042a9bb1 100644 --- a/3rdparty/boost/boost/move/utility_core.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/none.hpp b/3rdparty/boost/boost/none.hpp index db744e58ac..a37c45c514 100644 --- a/3rdparty/boost/boost/none.hpp +++ b/3rdparty/boost/boost/none.hpp @@ -1,5 +1,5 @@ // Copyright (C) 2003, Fernando Luis Cacciola Carballal. -// Copyright (C) 2014 Andrzej Krzemienski. +// Copyright (C) 2014, 2015 Andrzej Krzemienski. // // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at diff --git a/3rdparty/boost/boost/none_t.hpp b/3rdparty/boost/boost/none_t.hpp index 608cb0c354..008f369d1c 100644 --- a/3rdparty/boost/boost/none_t.hpp +++ b/3rdparty/boost/boost/none_t.hpp @@ -1,5 +1,5 @@ // Copyright (C) 2003, Fernando Luis Cacciola Carballal. -// Copyright (C) 2014 Andrzej Krzemienski. +// Copyright (C) 2014, 2015 Andrzej Krzemienski. // // Use, modification, and distribution is subject to the Boost Software // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -29,7 +29,7 @@ class none_t {}; struct none_t { struct init_tag{}; - explicit none_t(init_tag){} // to prevent default constructor + explicit none_t(init_tag){} // to disable default constructor }; #endif // old implementation workarounds @@ -37,4 +37,3 @@ struct none_t } // namespace boost #endif // header guard - diff --git a/3rdparty/boost/boost/operators.hpp b/3rdparty/boost/boost/operators.hpp index ab203304c7..3fc08d5e8d 100644 --- a/3rdparty/boost/boost/operators.hpp +++ b/3rdparty/boost/boost/operators.hpp @@ -1,6 +1,7 @@ // Boost operators.hpp header file ----------------------------------------// // (C) Copyright David Abrahams, Jeremy Siek, Daryle Walker 1999-2001. +// (C) Copyright Daniel Frey 2002-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) @@ -8,6 +9,8 @@ // See http://www.boost.org/libs/utility/operators.htm for documentation. // Revision History +// 22 Feb 16 Added ADL protection, preserve old work-arounds in +// operators_v1.hpp and clean up this file. (Daniel Frey) // 16 Dec 10 Limit warning suppression for 4284 to older versions of VC++ // (Matthew Bradbury, fixes #4432) // 07 Aug 08 Added "euclidean" spelling. (Daniel Frey) @@ -24,8 +27,8 @@ // additional classes for groups of related operators added; // workaround for empty base class optimization // bug of GCC 3.0 (Helmut Zeisel) -// 25 Jun 01 output_iterator_helper changes: removed default template -// parameters, added support for self-proxying, additional +// 25 Jun 01 output_iterator_helper changes: removed default template +// parameters, added support for self-proxying, additional // documentation and tests (Aleksey Gurtovoy) // 29 May 01 Added operator classes for << and >>. Added input and output // iterator helper classes. Added classes to connect equality and @@ -38,18 +41,18 @@ // 04 Jul 00 Fixed NO_OPERATORS_IN_NAMESPACE bugs, major cleanup and // refactoring of compiler workarounds, additional documentation // (Alexy Gurtovoy and Mark Rodgers with some help and prompting from -// Dave Abrahams) +// Dave Abrahams) // 28 Jun 00 General cleanup and integration of bugfixes from Mark Rodgers and // Jeremy Siek (Dave Abrahams) // 20 Jun 00 Changes to accommodate Borland C++Builder 4 and Borland C++ 5.5 // (Mark Rodgers) // 20 Jun 00 Minor fixes to the prior revision (Aleksey Gurtovoy) // 10 Jun 00 Support for the base class chaining technique was added -// (Aleksey Gurtovoy). See documentation and the comments below -// for the details. +// (Aleksey Gurtovoy). See documentation and the comments below +// for the details. // 12 Dec 99 Initial version with iterator operators (Jeremy Siek) // 18 Nov 99 Change name "divideable" to "dividable", remove unnecessary -// specializations of dividable, subtractable, modable (Ed Brey) +// specializations of dividable, subtractable, modable (Ed Brey) // 17 Nov 99 Add comments (Beman Dawes) // Remove unnecessary specialization of operators<> (Ed Brey) // 15 Nov 99 Fix less_than_comparable second operand type for first two @@ -60,8 +63,8 @@ // 10 Nov 99 Initial version // 10 Jun 00: -// An additional optional template parameter was added to most of -// operator templates to support the base class chaining technique (see +// An additional optional template parameter was added to most of +// operator templates to support the base class chaining technique (see // documentation for the details). Unfortunately, a straightforward // implementation of this change would have broken compatibility with the // previous version of the library by making it impossible to use the same @@ -70,18 +73,24 @@ // issue at the cost of some simplicity. // // One of the complications is an existence of special auxiliary class template -// 'is_chained_base<>' (see 'detail' namespace below), which is used +// 'is_chained_base<>' (see 'operators_detail' namespace below), which is used // to determine whether its template parameter is a library's operator template -// or not. You have to specialize 'is_chained_base<>' for each new +// or not. You have to specialize 'is_chained_base<>' for each new // operator template you add to the library. // -// However, most of the non-trivial implementation details are hidden behind +// However, most of the non-trivial implementation details are hidden behind // several local macros defined below, and as soon as you understand them, -// you understand the whole library implementation. +// you understand the whole library implementation. #ifndef BOOST_OPERATORS_HPP #define BOOST_OPERATORS_HPP +// If old work-arounds are needed, refer to the preserved version without +// ADL protection. +#if defined(BOOST_NO_OPERATORS_IN_NAMESPACE) || defined(BOOST_USE_OPERATORS_V1) +#include "operators_v1.hpp" +#else + #include #include @@ -93,35 +102,30 @@ #endif #if BOOST_WORKAROUND(BOOST_MSVC, < 1600) -# pragma warning( disable : 4284 ) // complaint about return type of +# pragma warning( disable : 4284 ) // complaint about return type of #endif // operator-> not begin a UDT -namespace boost { -namespace detail { - -template class empty_base {}; - -} // namespace detail -} // namespace boost - // In this section we supply the xxxx1 and xxxx2 forms of the operator // templates, which are explicitly targeted at the 1-type-argument and -// 2-type-argument operator forms, respectively. Some compilers get confused -// when inline friend functions are overloaded in namespaces other than the -// global namespace. When BOOST_NO_OPERATORS_IN_NAMESPACE is defined, all of -// these templates must go in the global namespace. +// 2-type-argument operator forms, respectively. -#ifndef BOOST_NO_OPERATORS_IN_NAMESPACE namespace boost { -#endif +namespace operators_impl +{ +namespace operators_detail +{ + +template class empty_base {}; + +} // namespace operators_detail // Basic operator classes (contributed by Dave Abrahams) ------------------// // Note that friend functions defined in a class are implicitly inline. // See the C++ std, 11.4 [class.friend] paragraph 5 -template > +template > struct less_than_comparable2 : B { friend bool operator<=(const T& x, const U& y) { return !static_cast(x > y); } @@ -132,7 +136,7 @@ struct less_than_comparable2 : B friend bool operator>=(const U& x, const T& y) { return !static_cast(y > x); } }; -template > +template > struct less_than_comparable1 : B { friend bool operator>(const T& x, const T& y) { return y < x; } @@ -140,7 +144,7 @@ struct less_than_comparable1 : B friend bool operator>=(const T& x, const T& y) { return !static_cast(x < y); } }; -template > +template > struct equality_comparable2 : B { friend bool operator==(const U& y, const T& x) { return x == y; } @@ -148,7 +152,7 @@ struct equality_comparable2 : B friend bool operator!=(const T& y, const U& x) { return !static_cast(y == x); } }; -template > +template > struct equality_comparable1 : B { friend bool operator!=(const T& x, const T& y) { return !static_cast(x == y); } @@ -166,39 +170,39 @@ struct equality_comparable1 : B // If the compiler has no NRVO, this is the best symmetric // implementation available. -#define BOOST_BINARY_OPERATOR_COMMUTATIVE( NAME, OP ) \ -template > \ -struct NAME##2 : B \ -{ \ - friend T operator OP( const T& lhs, const U& rhs ) \ - { T nrv( lhs ); nrv OP##= rhs; return nrv; } \ - friend T operator OP( const U& lhs, const T& rhs ) \ - { T nrv( rhs ); nrv OP##= lhs; return nrv; } \ -}; \ - \ -template > \ -struct NAME##1 : B \ -{ \ - friend T operator OP( const T& lhs, const T& rhs ) \ - { T nrv( lhs ); nrv OP##= rhs; return nrv; } \ +#define BOOST_BINARY_OPERATOR_COMMUTATIVE( NAME, OP ) \ +template > \ +struct NAME##2 : B \ +{ \ + friend T operator OP( const T& lhs, const U& rhs ) \ + { T nrv( lhs ); nrv OP##= rhs; return nrv; } \ + friend T operator OP( const U& lhs, const T& rhs ) \ + { T nrv( rhs ); nrv OP##= lhs; return nrv; } \ +}; \ + \ +template > \ +struct NAME##1 : B \ +{ \ + friend T operator OP( const T& lhs, const T& rhs ) \ + { T nrv( lhs ); nrv OP##= rhs; return nrv; } \ }; #define BOOST_BINARY_OPERATOR_NON_COMMUTATIVE( NAME, OP ) \ -template > \ +template > \ struct NAME##2 : B \ { \ friend T operator OP( const T& lhs, const U& rhs ) \ { T nrv( lhs ); nrv OP##= rhs; return nrv; } \ }; \ \ -template > \ +template > \ struct BOOST_OPERATOR2_LEFT(NAME) : B \ { \ friend T operator OP( const U& lhs, const T& rhs ) \ { T nrv( lhs ); nrv OP##= rhs; return nrv; } \ }; \ \ -template > \ +template > \ struct NAME##1 : B \ { \ friend T operator OP( const T& lhs, const T& rhs ) \ @@ -213,34 +217,34 @@ struct NAME##1 : B \ // optimization opportunities to the compiler :) #define BOOST_BINARY_OPERATOR_COMMUTATIVE( NAME, OP ) \ -template > \ +template > \ struct NAME##2 : B \ { \ friend T operator OP( T lhs, const U& rhs ) { return lhs OP##= rhs; } \ friend T operator OP( const U& lhs, T rhs ) { return rhs OP##= lhs; } \ }; \ \ -template > \ +template > \ struct NAME##1 : B \ { \ friend T operator OP( T lhs, const T& rhs ) { return lhs OP##= rhs; } \ }; #define BOOST_BINARY_OPERATOR_NON_COMMUTATIVE( NAME, OP ) \ -template > \ +template > \ struct NAME##2 : B \ { \ friend T operator OP( T lhs, const U& rhs ) { return lhs OP##= rhs; } \ }; \ \ -template > \ +template > \ struct BOOST_OPERATOR2_LEFT(NAME) : B \ { \ friend T operator OP( const U& lhs, const T& rhs ) \ { return T( lhs ) OP##= rhs; } \ }; \ \ -template > \ +template > \ struct NAME##1 : B \ { \ friend T operator OP( T lhs, const T& rhs ) { return lhs OP##= rhs; } \ @@ -263,7 +267,7 @@ BOOST_BINARY_OPERATOR_COMMUTATIVE( orable, | ) // incrementable and decrementable contributed by Jeremy Siek -template > +template > struct incrementable : B { friend T operator++(T& x, int) @@ -276,7 +280,7 @@ private: // The use of this typedef works around a Borland bug typedef T incrementable_type; }; -template > +template > struct decrementable : B { friend T operator--(T& x, int) @@ -291,16 +295,16 @@ private: // The use of this typedef works around a Borland bug // Iterator operator classes (contributed by Jeremy Siek) ------------------// -template > +template > struct dereferenceable : B { P operator->() const - { - return &*static_cast(*this); + { + return &*static_cast(*this); } }; -template > +template > struct indexable : B { R operator[](I n) const @@ -314,34 +318,34 @@ struct indexable : B #if defined(BOOST_HAS_NRVO) || defined(BOOST_FORCE_SYMMETRIC_OPERATORS) -#define BOOST_BINARY_OPERATOR( NAME, OP ) \ -template > \ -struct NAME##2 : B \ -{ \ - friend T operator OP( const T& lhs, const U& rhs ) \ - { T nrv( lhs ); nrv OP##= rhs; return nrv; } \ -}; \ - \ -template > \ -struct NAME##1 : B \ -{ \ - friend T operator OP( const T& lhs, const T& rhs ) \ - { T nrv( lhs ); nrv OP##= rhs; return nrv; } \ +#define BOOST_BINARY_OPERATOR( NAME, OP ) \ +template > \ +struct NAME##2 : B \ +{ \ + friend T operator OP( const T& lhs, const U& rhs ) \ + { T nrv( lhs ); nrv OP##= rhs; return nrv; } \ +}; \ + \ +template > \ +struct NAME##1 : B \ +{ \ + friend T operator OP( const T& lhs, const T& rhs ) \ + { T nrv( lhs ); nrv OP##= rhs; return nrv; } \ }; #else // defined(BOOST_HAS_NRVO) || defined(BOOST_FORCE_SYMMETRIC_OPERATORS) -#define BOOST_BINARY_OPERATOR( NAME, OP ) \ -template > \ -struct NAME##2 : B \ -{ \ - friend T operator OP( T lhs, const U& rhs ) { return lhs OP##= rhs; } \ -}; \ - \ -template > \ -struct NAME##1 : B \ -{ \ - friend T operator OP( T lhs, const T& rhs ) { return lhs OP##= rhs; } \ +#define BOOST_BINARY_OPERATOR( NAME, OP ) \ +template > \ +struct NAME##2 : B \ +{ \ + friend T operator OP( T lhs, const U& rhs ) { return lhs OP##= rhs; } \ +}; \ + \ +template > \ +struct NAME##1 : B \ +{ \ + friend T operator OP( T lhs, const T& rhs ) { return lhs OP##= rhs; } \ }; #endif // defined(BOOST_HAS_NRVO) || defined(BOOST_FORCE_SYMMETRIC_OPERATORS) @@ -351,7 +355,7 @@ BOOST_BINARY_OPERATOR( right_shiftable, >> ) #undef BOOST_BINARY_OPERATOR -template > +template > struct equivalent2 : B { friend bool operator==(const T& x, const U& y) @@ -360,7 +364,7 @@ struct equivalent2 : B } }; -template > +template > struct equivalent1 : B { friend bool operator==(const T&x, const T&y) @@ -369,7 +373,7 @@ struct equivalent1 : B } }; -template > +template > struct partially_ordered2 : B { friend bool operator<=(const T& x, const U& y) @@ -386,7 +390,7 @@ struct partially_ordered2 : B { return static_cast(y < x) || static_cast(y == x); } }; -template > +template > struct partially_ordered1 : B { friend bool operator>(const T& x, const T& y) @@ -399,161 +403,161 @@ struct partially_ordered1 : B // Combined operator classes (contributed by Daryle Walker) ----------------// -template > +template > struct totally_ordered2 : less_than_comparable2 > {}; -template > +template > struct totally_ordered1 : less_than_comparable1 > {}; -template > +template > struct additive2 : addable2 > {}; -template > +template > struct additive1 : addable1 > {}; -template > +template > struct multiplicative2 : multipliable2 > {}; -template > +template > struct multiplicative1 : multipliable1 > {}; -template > +template > struct integer_multiplicative2 : multiplicative2 > {}; -template > +template > struct integer_multiplicative1 : multiplicative1 > {}; -template > +template > struct arithmetic2 : additive2 > {}; -template > +template > struct arithmetic1 : additive1 > {}; -template > +template > struct integer_arithmetic2 : additive2 > {}; -template > +template > struct integer_arithmetic1 : additive1 > {}; -template > +template > struct bitwise2 : xorable2 > > {}; -template > +template > struct bitwise1 : xorable1 > > {}; -template > +template > struct unit_steppable : incrementable > {}; -template > +template > struct shiftable2 : left_shiftable2 > {}; -template > +template > struct shiftable1 : left_shiftable1 > {}; -template > +template > struct ring_operators2 : additive2 > > {}; -template > +template > struct ring_operators1 : additive1 > {}; -template > +template > struct ordered_ring_operators2 : ring_operators2 > {}; -template > +template > struct ordered_ring_operators1 : ring_operators1 > {}; -template > +template > struct field_operators2 : ring_operators2 > > {}; -template > +template > struct field_operators1 : ring_operators1 > {}; -template > +template > struct ordered_field_operators2 : field_operators2 > {}; -template > +template > struct ordered_field_operators1 : field_operators1 > {}; -template > +template > struct euclidian_ring_operators2 : ring_operators2 > > > > {}; -template > +template > struct euclidian_ring_operators1 : ring_operators1 > > {}; -template > +template > struct ordered_euclidian_ring_operators2 : totally_ordered2 > {}; -template > +template > struct ordered_euclidian_ring_operators1 : totally_ordered1 > {}; -template > +template > struct euclidean_ring_operators2 : ring_operators2 > > > > {}; -template > +template > struct euclidean_ring_operators1 : ring_operators1 > > {}; -template > +template > struct ordered_euclidean_ring_operators2 : totally_ordered2 > {}; -template > +template > struct ordered_euclidean_ring_operators1 : totally_ordered1 > {}; -template > +template > struct input_iteratable : equality_comparable1 > > {}; -template > +template > struct output_iteratable : incrementable {}; -template > +template > struct forward_iteratable : input_iteratable {}; -template > +template > struct bidirectional_iteratable : forward_iteratable > +template > struct random_access_iteratable : bidirectional_iteratable > > > {}; -#ifndef BOOST_NO_OPERATORS_IN_NAMESPACE -} // namespace boost -#endif // BOOST_NO_OPERATORS_IN_NAMESPACE - -// BOOST_IMPORT_TEMPLATE1 .. BOOST_IMPORT_TEMPLATE4 - // -// When BOOST_NO_OPERATORS_IN_NAMESPACE is defined we need a way to import an -// operator template into the boost namespace. BOOST_IMPORT_TEMPLATE1 is used -// for one-argument forms of operator templates; BOOST_IMPORT_TEMPLATE2 for -// two-argument forms. Note that these macros expect to be invoked from within -// boost. - -#ifndef BOOST_NO_OPERATORS_IN_NAMESPACE - - // The template is already in boost so we have nothing to do. -# define BOOST_IMPORT_TEMPLATE4(template_name) -# define BOOST_IMPORT_TEMPLATE3(template_name) -# define BOOST_IMPORT_TEMPLATE2(template_name) -# define BOOST_IMPORT_TEMPLATE1(template_name) - -#else // BOOST_NO_OPERATORS_IN_NAMESPACE - -# ifndef BOOST_NO_USING_TEMPLATE - - // Bring the names in with a using-declaration - // to avoid stressing the compiler. -# define BOOST_IMPORT_TEMPLATE4(template_name) using ::template_name; -# define BOOST_IMPORT_TEMPLATE3(template_name) using ::template_name; -# define BOOST_IMPORT_TEMPLATE2(template_name) using ::template_name; -# define BOOST_IMPORT_TEMPLATE1(template_name) using ::template_name; - -# else - - // Otherwise, because a Borland C++ 5.5 bug prevents a using declaration - // from working, we are forced to use inheritance for that compiler. -# define BOOST_IMPORT_TEMPLATE4(template_name) \ - template > \ - struct template_name : ::template_name {}; - -# define BOOST_IMPORT_TEMPLATE3(template_name) \ - template > \ - struct template_name : ::template_name {}; - -# define BOOST_IMPORT_TEMPLATE2(template_name) \ - template > \ - struct template_name : ::template_name {}; - -# define BOOST_IMPORT_TEMPLATE1(template_name) \ - template > \ - struct template_name : ::template_name {}; +// Here's where we put it all together, defining the xxxx forms of the templates. +// We also define specializations of is_chained_base<> for +// the xxxx, xxxx1, and xxxx2 templates. +// -# endif // BOOST_NO_USING_TEMPLATE +namespace operators_detail +{ -#endif // BOOST_NO_OPERATORS_IN_NAMESPACE +// A type parameter is used instead of a plain bool because Borland's compiler +// didn't cope well with the more obvious non-type template parameter. +struct true_t {}; +struct false_t {}; -// -// Here's where we put it all together, defining the xxxx forms of the templates -// in namespace boost. We also define specializations of is_chained_base<> for -// the xxxx, xxxx1, and xxxx2 templates, importing them into boost:: as -// necessary. -// +} // namespace operators_detail // is_chained_base<> - a traits class used to distinguish whether an operator // template argument is being used for base class chaining, or is specifying a // 2nd argument type. -namespace boost { -// A type parameter is used instead of a plain bool because Borland's compiler -// didn't cope well with the more obvious non-type template parameter. -namespace detail { - struct true_t {}; - struct false_t {}; -} // namespace detail - // Unspecialized version assumes that most types are not being used for base // class chaining. We specialize for the operator templates defined in this // library. template struct is_chained_base { - typedef ::boost::detail::false_t value; + typedef operators_detail::false_t value; }; -} // namespace boost - -// Import a 4-type-argument operator template into boost (if necessary) and -// provide a specialization of 'is_chained_base<>' for it. -# define BOOST_OPERATOR_TEMPLATE4(template_name4) \ - BOOST_IMPORT_TEMPLATE4(template_name4) \ - template \ - struct is_chained_base< ::boost::template_name4 > { \ - typedef ::boost::detail::true_t value; \ +// Provide a specialization of 'is_chained_base<>' +// for a 4-type-argument operator template. +# define BOOST_OPERATOR_TEMPLATE4(template_name4) \ + template \ + struct is_chained_base< template_name4 > { \ + typedef operators_detail::true_t value; \ }; -// Import a 3-type-argument operator template into boost (if necessary) and -// provide a specialization of 'is_chained_base<>' for it. -# define BOOST_OPERATOR_TEMPLATE3(template_name3) \ - BOOST_IMPORT_TEMPLATE3(template_name3) \ - template \ - struct is_chained_base< ::boost::template_name3 > { \ - typedef ::boost::detail::true_t value; \ +// Provide a specialization of 'is_chained_base<>' +// for a 3-type-argument operator template. +# define BOOST_OPERATOR_TEMPLATE3(template_name3) \ + template \ + struct is_chained_base< template_name3 > { \ + typedef operators_detail::true_t value; \ }; -// Import a 2-type-argument operator template into boost (if necessary) and -// provide a specialization of 'is_chained_base<>' for it. -# define BOOST_OPERATOR_TEMPLATE2(template_name2) \ - BOOST_IMPORT_TEMPLATE2(template_name2) \ - template \ - struct is_chained_base< ::boost::template_name2 > { \ - typedef ::boost::detail::true_t value; \ +// Provide a specialization of 'is_chained_base<>' +// for a 2-type-argument operator template. +# define BOOST_OPERATOR_TEMPLATE2(template_name2) \ + template \ + struct is_chained_base< template_name2 > { \ + typedef operators_detail::true_t value; \ }; -// Import a 1-type-argument operator template into boost (if necessary) and -// provide a specialization of 'is_chained_base<>' for it. -# define BOOST_OPERATOR_TEMPLATE1(template_name1) \ - BOOST_IMPORT_TEMPLATE1(template_name1) \ - template \ - struct is_chained_base< ::boost::template_name1 > { \ - typedef ::boost::detail::true_t value; \ +// Provide a specialization of 'is_chained_base<>' +// for a 1-type-argument operator template. +# define BOOST_OPERATOR_TEMPLATE1(template_name1) \ + template \ + struct is_chained_base< template_name1 > { \ + typedef operators_detail::true_t value; \ }; // BOOST_OPERATOR_TEMPLATE(template_name) defines template_name<> such that it @@ -778,34 +722,34 @@ template struct is_chained_base { // implementation in terms of either '1' or '2'. // -# define BOOST_OPERATOR_TEMPLATE(template_name) \ -template \ - ,class O = typename is_chained_base::value \ - > \ -struct template_name : template_name##2 {}; \ - \ -template \ -struct template_name \ - : template_name##1 {}; \ - \ -template \ -struct template_name \ - : template_name##1 {}; \ - \ -template \ -struct is_chained_base< ::boost::template_name > { \ - typedef ::boost::detail::true_t value; \ -}; \ - \ -BOOST_OPERATOR_TEMPLATE2(template_name##2) \ +# define BOOST_OPERATOR_TEMPLATE(template_name) \ +template \ + ,class O = typename is_chained_base::value \ + > \ +struct template_name; \ + \ +template \ +struct template_name \ + : template_name##2 {}; \ + \ +template \ +struct template_name, operators_detail::true_t> \ + : template_name##1 {}; \ + \ +template \ +struct template_name \ + : template_name##1 {}; \ + \ +template \ +struct is_chained_base< template_name > { \ + typedef operators_detail::true_t value; \ +}; \ + \ +BOOST_OPERATOR_TEMPLATE2(template_name##2) \ BOOST_OPERATOR_TEMPLATE1(template_name##1) - - -namespace boost { - BOOST_OPERATOR_TEMPLATE(less_than_comparable) BOOST_OPERATOR_TEMPLATE(equality_comparable) BOOST_OPERATOR_TEMPLATE(multipliable) @@ -859,13 +803,7 @@ BOOST_OPERATOR_TEMPLATE4(random_access_iteratable) #undef BOOST_OPERATOR_TEMPLATE3 #undef BOOST_OPERATOR_TEMPLATE2 #undef BOOST_OPERATOR_TEMPLATE1 -#undef BOOST_IMPORT_TEMPLATE1 -#undef BOOST_IMPORT_TEMPLATE2 -#undef BOOST_IMPORT_TEMPLATE3 -#undef BOOST_IMPORT_TEMPLATE4 -// The following 'operators' classes can only be used portably if the derived class -// declares ALL of the required member operators. template struct operators2 : totally_ordered2 > {}; template @@ -941,10 +879,14 @@ struct random_access_iterator_helper } }; // random_access_iterator_helper +} // namespace operators_impl +using namespace operators_impl; + } // namespace boost #if defined(__sgi) && !defined(__GNUC__) #pragma reset woff 1234 #endif +#endif // BOOST_NO_OPERATORS_IN_NAMESPACE #endif // BOOST_OPERATORS_HPP diff --git a/3rdparty/boost/boost/optional/detail/old_optional_implementation.hpp b/3rdparty/boost/boost/optional/detail/old_optional_implementation.hpp new file mode 100644 index 0000000000..f2e6718402 --- /dev/null +++ b/3rdparty/boost/boost/optional/detail/old_optional_implementation.hpp @@ -0,0 +1,1059 @@ +// Copyright (C) 2003, 2008 Fernando Luis Cacciola Carballal. +// Copyright (C) 2014-2016 Andrzej Krzemienski. +// +// Use, modification, and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// See http://www.boost.org/libs/optional for documentation. +// +// You are welcome to contact the maintainer at: +// akrzemi1@gmail.com + +#ifndef BOOST_OPTIONAL_DETAIL_OLD_OPTIONAL_IMPLEMENTATION_AJK_28JAN2015_HPP +#define BOOST_OPTIONAL_DETAIL_OLD_OPTIONAL_IMPLEMENTATION_AJK_28JAN2015_HPP + +#include +#include +#include +#include +#include + +namespace boost { + +namespace optional_detail { + + +template +struct types_when_isnt_ref +{ + typedef T const& reference_const_type ; + typedef T & reference_type ; +#ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES + typedef T && rval_reference_type ; + typedef T && reference_type_of_temporary_wrapper; +#ifdef BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES + // GCC 4.4 has support for an early draft of rvalue references. The conforming version below + // causes warnings about returning references to a temporary. + static T&& move(T&& r) { return r; } +#else + static rval_reference_type move(reference_type r) { return boost::move(r); } +#endif +#endif + typedef T const* pointer_const_type ; + typedef T * pointer_type ; + typedef T const& argument_type ; +} ; + +template +struct types_when_is_ref +{ + typedef BOOST_DEDUCED_TYPENAME remove_reference::type raw_type ; + + typedef raw_type& reference_const_type ; + typedef raw_type& reference_type ; +#ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES + typedef BOOST_DEDUCED_TYPENAME remove_const::type&& rval_reference_type ; + typedef raw_type& reference_type_of_temporary_wrapper; + static reference_type move(reference_type r) { return r; } +#endif + typedef raw_type* pointer_const_type ; + typedef raw_type* pointer_type ; + typedef raw_type& argument_type ; +} ; + +template +void prevent_binding_rvalue_ref_to_optional_lvalue_ref() +{ +#ifndef BOOST_OPTIONAL_CONFIG_ALLOW_BINDING_TO_RVALUES + BOOST_STATIC_ASSERT_MSG( + !boost::is_lvalue_reference::value || !boost::is_rvalue_reference::value, + "binding rvalue references to optional lvalue references is disallowed"); +#endif +} + +struct optional_tag {} ; + +template +class optional_base : public optional_tag +{ + private : + + typedef +#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) + BOOST_DEDUCED_TYPENAME +#endif + ::boost::detail::make_reference_content::type internal_type ; + + typedef aligned_storage storage_type ; + + typedef types_when_isnt_ref types_when_not_ref ; + typedef types_when_is_ref types_when_ref ; + + typedef optional_base this_type ; + + protected : + + typedef T value_type ; + + typedef mpl::true_ is_reference_tag ; + typedef mpl::false_ is_not_reference_tag ; + + typedef BOOST_DEDUCED_TYPENAME is_reference::type is_reference_predicate ; + + public: + typedef BOOST_DEDUCED_TYPENAME mpl::if_::type types ; + + protected: + typedef BOOST_DEDUCED_TYPENAME types::reference_type reference_type ; + typedef BOOST_DEDUCED_TYPENAME types::reference_const_type reference_const_type ; +#ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES + typedef BOOST_DEDUCED_TYPENAME types::rval_reference_type rval_reference_type ; + typedef BOOST_DEDUCED_TYPENAME types::reference_type_of_temporary_wrapper reference_type_of_temporary_wrapper ; +#endif + typedef BOOST_DEDUCED_TYPENAME types::pointer_type pointer_type ; + typedef BOOST_DEDUCED_TYPENAME types::pointer_const_type pointer_const_type ; + typedef BOOST_DEDUCED_TYPENAME types::argument_type argument_type ; + + // Creates an optional uninitialized. + // No-throw + optional_base() + : + m_initialized(false) {} + + // Creates an optional uninitialized. + // No-throw + optional_base ( none_t ) + : + m_initialized(false) {} + + // Creates an optional initialized with 'val'. + // Can throw if T::T(T const&) does + optional_base ( argument_type val ) + : + m_initialized(false) + { + construct(val); + } + +#ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES + // move-construct an optional initialized from an rvalue-ref to 'val'. + // Can throw if T::T(T&&) does + optional_base ( rval_reference_type val ) + : + m_initialized(false) + { + construct( boost::move(val) ); + } +#endif + + // Creates an optional initialized with 'val' IFF cond is true, otherwise creates an uninitialzed optional. + // Can throw if T::T(T const&) does + optional_base ( bool cond, argument_type val ) + : + m_initialized(false) + { + if ( cond ) + construct(val); + } + + // Creates a deep copy of another optional + // Can throw if T::T(T const&) does + optional_base ( optional_base const& rhs ) + : + m_initialized(false) + { + if ( rhs.is_initialized() ) + construct(rhs.get_impl()); + } + +#ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES + // Creates a deep move of another optional + // Can throw if T::T(T&&) does + optional_base ( optional_base&& rhs ) + : + m_initialized(false) + { + if ( rhs.is_initialized() ) + construct( boost::move(rhs.get_impl()) ); + } +#endif + +#ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES + + template + explicit optional_base ( Expr&& expr, PtrExpr const* tag ) + : + m_initialized(false) + { + construct(boost::forward(expr),tag); + } + +#else + // This is used for both converting and in-place constructions. + // Derived classes use the 'tag' to select the appropriate + // implementation (the correct 'construct()' overload) + template + explicit optional_base ( Expr const& expr, Expr const* tag ) + : + m_initialized(false) + { + construct(expr,tag); + } + +#endif + + + // No-throw (assuming T::~T() doesn't) + ~optional_base() { destroy() ; } + + // Assigns from another optional (deep-copies the rhs value) + void assign ( optional_base const& rhs ) + { + if (is_initialized()) + { + if ( rhs.is_initialized() ) + assign_value(rhs.get_impl(), is_reference_predicate() ); + else destroy(); + } + else + { + if ( rhs.is_initialized() ) + construct(rhs.get_impl()); + } + } + +#ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES + // Assigns from another optional (deep-moves the rhs value) + void assign ( optional_base&& rhs ) + { + if (is_initialized()) + { + if ( rhs.is_initialized() ) + assign_value(boost::move(rhs.get_impl()), is_reference_predicate() ); + else destroy(); + } + else + { + if ( rhs.is_initialized() ) + construct(boost::move(rhs.get_impl())); + } + } +#endif + + // Assigns from another _convertible_ optional (deep-copies the rhs value) + template + void assign ( optional const& rhs ) + { + if (is_initialized()) + { + if ( rhs.is_initialized() ) +#ifndef BOOST_OPTIONAL_CONFIG_RESTORE_ASSIGNMENT_OF_NONCONVERTIBLE_TYPES + assign_value(rhs.get(), is_reference_predicate() ); +#else + assign_value(static_cast(rhs.get()), is_reference_predicate() ); +#endif + + else destroy(); + } + else + { + if ( rhs.is_initialized() ) +#ifndef BOOST_OPTIONAL_CONFIG_RESTORE_ASSIGNMENT_OF_NONCONVERTIBLE_TYPES + construct(rhs.get()); +#else + construct(static_cast(rhs.get())); +#endif + } + } + +#ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES + // move-assigns from another _convertible_ optional (deep-moves from the rhs value) + template + void assign ( optional&& rhs ) + { + typedef BOOST_DEDUCED_TYPENAME optional::rval_reference_type ref_type; + if (is_initialized()) + { + if ( rhs.is_initialized() ) + assign_value(static_cast(rhs.get()), is_reference_predicate() ); + else destroy(); + } + else + { + if ( rhs.is_initialized() ) + construct(static_cast(rhs.get())); + } + } +#endif + + // Assigns from a T (deep-copies the rhs value) + void assign ( argument_type val ) + { + if (is_initialized()) + assign_value(val, is_reference_predicate() ); + else construct(val); + } + +#ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES + // Assigns from a T (deep-moves the rhs value) + void assign ( rval_reference_type val ) + { + if (is_initialized()) + assign_value( boost::move(val), is_reference_predicate() ); + else construct( boost::move(val) ); + } +#endif + + // Assigns from "none", destroying the current value, if any, leaving this UNINITIALIZED + // No-throw (assuming T::~T() doesn't) + void assign ( none_t ) BOOST_NOEXCEPT { destroy(); } + +#ifndef BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT + +#ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES + template + void assign_expr ( Expr&& expr, ExprPtr const* tag ) + { + if (is_initialized()) + assign_expr_to_initialized(boost::forward(expr),tag); + else construct(boost::forward(expr),tag); + } +#else + template + void assign_expr ( Expr const& expr, Expr const* tag ) + { + if (is_initialized()) + assign_expr_to_initialized(expr,tag); + else construct(expr,tag); + } +#endif + +#endif + + public : + + // **DEPPRECATED** Destroys the current value, if any, leaving this UNINITIALIZED + // No-throw (assuming T::~T() doesn't) + void reset() BOOST_NOEXCEPT { destroy(); } + + // **DEPPRECATED** Replaces the current value -if any- with 'val' + void reset ( argument_type val ) { assign(val); } + + // Returns a pointer to the value if this is initialized, otherwise, + // returns NULL. + // No-throw + pointer_const_type get_ptr() const { return m_initialized ? get_ptr_impl() : 0 ; } + pointer_type get_ptr() { return m_initialized ? get_ptr_impl() : 0 ; } + + bool is_initialized() const { return m_initialized ; } + + protected : + + void construct ( argument_type val ) + { + ::new (m_storage.address()) internal_type(val) ; + m_initialized = true ; + } + +#ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES + void construct ( rval_reference_type val ) + { + ::new (m_storage.address()) internal_type( types::move(val) ) ; + m_initialized = true ; + } +#endif + + +#if (!defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES) && (!defined BOOST_NO_CXX11_VARIADIC_TEMPLATES) + // Constructs in-place + // upon exception *this is always uninitialized + template + void emplace_assign ( Args&&... args ) + { + destroy(); + ::new (m_storage.address()) internal_type( boost::forward(args)... ); + m_initialized = true ; + } +#elif (!defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES) + template + void emplace_assign ( Arg&& arg ) + { + destroy(); + ::new (m_storage.address()) internal_type( boost::forward(arg) ); + m_initialized = true ; + } + + void emplace_assign () + { + destroy(); + ::new (m_storage.address()) internal_type(); + m_initialized = true ; + } +#else + template + void emplace_assign ( const Arg& arg ) + { + destroy(); + ::new (m_storage.address()) internal_type( arg ); + m_initialized = true ; + } + + template + void emplace_assign ( Arg& arg ) + { + destroy(); + ::new (m_storage.address()) internal_type( arg ); + m_initialized = true ; + } + + void emplace_assign () + { + destroy(); + ::new (m_storage.address()) internal_type(); + m_initialized = true ; + } +#endif + +#ifndef BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT + +#ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES + // Constructs in-place using the given factory + template + void construct ( Expr&& factory, in_place_factory_base const* ) + { + BOOST_STATIC_ASSERT ( ::boost::mpl::not_::value ) ; + boost_optional_detail::construct(factory, m_storage.address()); + m_initialized = true ; + } + + // Constructs in-place using the given typed factory + template + void construct ( Expr&& factory, typed_in_place_factory_base const* ) + { + BOOST_STATIC_ASSERT ( ::boost::mpl::not_::value ) ; + factory.apply(m_storage.address()) ; + m_initialized = true ; + } + + template + void assign_expr_to_initialized ( Expr&& factory, in_place_factory_base const* tag ) + { + destroy(); + construct(factory,tag); + } + + // Constructs in-place using the given typed factory + template + void assign_expr_to_initialized ( Expr&& factory, typed_in_place_factory_base const* tag ) + { + destroy(); + construct(factory,tag); + } + +#else + // Constructs in-place using the given factory + template + void construct ( Expr const& factory, in_place_factory_base const* ) + { + BOOST_STATIC_ASSERT ( ::boost::mpl::not_::value ) ; + boost_optional_detail::construct(factory, m_storage.address()); + m_initialized = true ; + } + + // Constructs in-place using the given typed factory + template + void construct ( Expr const& factory, typed_in_place_factory_base const* ) + { + BOOST_STATIC_ASSERT ( ::boost::mpl::not_::value ) ; + factory.apply(m_storage.address()) ; + m_initialized = true ; + } + + template + void assign_expr_to_initialized ( Expr const& factory, in_place_factory_base const* tag ) + { + destroy(); + construct(factory,tag); + } + + // Constructs in-place using the given typed factory + template + void assign_expr_to_initialized ( Expr const& factory, typed_in_place_factory_base const* tag ) + { + destroy(); + construct(factory,tag); + } +#endif + +#endif + +#ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES + // Constructs using any expression implicitly convertible to the single argument + // of a one-argument T constructor. + // Converting constructions of optional from optional uses this function with + // 'Expr' being of type 'U' and relying on a converting constructor of T from U. + template + void construct ( Expr&& expr, void const* ) + { + new (m_storage.address()) internal_type(boost::forward(expr)) ; + m_initialized = true ; + } + + // Assigns using a form any expression implicitly convertible to the single argument + // of a T's assignment operator. + // Converting assignments of optional from optional uses this function with + // 'Expr' being of type 'U' and relying on a converting assignment of T from U. + template + void assign_expr_to_initialized ( Expr&& expr, void const* ) + { + assign_value(boost::forward(expr), is_reference_predicate()); + } +#else + // Constructs using any expression implicitly convertible to the single argument + // of a one-argument T constructor. + // Converting constructions of optional from optional uses this function with + // 'Expr' being of type 'U' and relying on a converting constructor of T from U. + template + void construct ( Expr const& expr, void const* ) + { + new (m_storage.address()) internal_type(expr) ; + m_initialized = true ; + } + + // Assigns using a form any expression implicitly convertible to the single argument + // of a T's assignment operator. + // Converting assignments of optional from optional uses this function with + // 'Expr' being of type 'U' and relying on a converting assignment of T from U. + template + void assign_expr_to_initialized ( Expr const& expr, void const* ) + { + assign_value(expr, is_reference_predicate()); + } + +#endif + +#ifdef BOOST_OPTIONAL_WEAK_OVERLOAD_RESOLUTION + // BCB5.64 (and probably lower versions) workaround. + // The in-place factories are supported by means of catch-all constructors + // and assignment operators (the functions are parameterized in terms of + // an arbitrary 'Expr' type) + // This compiler incorrectly resolves the overload set and sinks optional and optional + // to the 'Expr'-taking functions even though explicit overloads are present for them. + // Thus, the following overload is needed to properly handle the case when the 'lhs' + // is another optional. + // + // For VC<=70 compilers this workaround dosen't work becasue the comnpiler issues and error + // instead of choosing the wrong overload + // +#ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES + // Notice that 'Expr' will be optional or optional (but not optional_base<..>) + template + void construct ( Expr&& expr, optional_tag const* ) + { + if ( expr.is_initialized() ) + { + // An exception can be thrown here. + // It it happens, THIS will be left uninitialized. + new (m_storage.address()) internal_type(types::move(expr.get())) ; + m_initialized = true ; + } + } +#else + // Notice that 'Expr' will be optional or optional (but not optional_base<..>) + template + void construct ( Expr const& expr, optional_tag const* ) + { + if ( expr.is_initialized() ) + { + // An exception can be thrown here. + // It it happens, THIS will be left uninitialized. + new (m_storage.address()) internal_type(expr.get()) ; + m_initialized = true ; + } + } +#endif +#endif // defined BOOST_OPTIONAL_WEAK_OVERLOAD_RESOLUTION + + void assign_value ( argument_type val, is_not_reference_tag ) { get_impl() = val; } + void assign_value ( argument_type val, is_reference_tag ) { construct(val); } +#ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES + void assign_value ( rval_reference_type val, is_not_reference_tag ) { get_impl() = static_cast(val); } + void assign_value ( rval_reference_type val, is_reference_tag ) { construct( static_cast(val) ); } +#endif + + void destroy() + { + if ( m_initialized ) + destroy_impl(is_reference_predicate()) ; + } + + reference_const_type get_impl() const { return dereference(get_object(), is_reference_predicate() ) ; } + reference_type get_impl() { return dereference(get_object(), is_reference_predicate() ) ; } + + pointer_const_type get_ptr_impl() const { return cast_ptr(get_object(), is_reference_predicate() ) ; } + pointer_type get_ptr_impl() { return cast_ptr(get_object(), is_reference_predicate() ) ; } + + private : + + // internal_type can be either T or reference_content +#if defined(BOOST_OPTIONAL_DETAIL_USE_ATTRIBUTE_MAY_ALIAS) + // This workaround is supposed to silence GCC warnings about broken strict aliasing rules + internal_type const* get_object() const + { + union { void const* ap_pvoid; internal_type const* as_ptype; } caster = { m_storage.address() }; + return caster.as_ptype; + } + internal_type * get_object() + { + union { void* ap_pvoid; internal_type* as_ptype; } caster = { m_storage.address() }; + return caster.as_ptype; + } +#else + internal_type const* get_object() const { return static_cast(m_storage.address()); } + internal_type * get_object() { return static_cast (m_storage.address()); } +#endif + + // reference_content lacks an implicit conversion to T&, so the following is needed to obtain a proper reference. + reference_const_type dereference( internal_type const* p, is_not_reference_tag ) const { return *p ; } + reference_type dereference( internal_type* p, is_not_reference_tag ) { return *p ; } + reference_const_type dereference( internal_type const* p, is_reference_tag ) const { return p->get() ; } + reference_type dereference( internal_type* p, is_reference_tag ) { return p->get() ; } + +#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x581)) + void destroy_impl ( is_not_reference_tag ) { get_ptr_impl()->internal_type::~internal_type() ; m_initialized = false ; } +#else + void destroy_impl ( is_not_reference_tag ) { get_ptr_impl()->~T() ; m_initialized = false ; } +#endif + + void destroy_impl ( is_reference_tag ) { m_initialized = false ; } + + // If T is of reference type, trying to get a pointer to the held value must result in a compile-time error. + // Decent compilers should disallow conversions from reference_content* to T*, but just in case, + // the following olverloads are used to filter out the case and guarantee an error in case of T being a reference. + pointer_const_type cast_ptr( internal_type const* p, is_not_reference_tag ) const { return p ; } + pointer_type cast_ptr( internal_type * p, is_not_reference_tag ) { return p ; } + pointer_const_type cast_ptr( internal_type const* p, is_reference_tag ) const { return &p->get() ; } + pointer_type cast_ptr( internal_type * p, is_reference_tag ) { return &p->get() ; } + + bool m_initialized ; + storage_type m_storage ; +} ; + +} // namespace optional_detail + +template +class optional : public optional_detail::optional_base +{ + typedef optional_detail::optional_base base ; + + public : + + typedef optional this_type ; + + typedef BOOST_DEDUCED_TYPENAME base::value_type value_type ; + typedef BOOST_DEDUCED_TYPENAME base::reference_type reference_type ; + typedef BOOST_DEDUCED_TYPENAME base::reference_const_type reference_const_type ; +#ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES + typedef BOOST_DEDUCED_TYPENAME base::rval_reference_type rval_reference_type ; + typedef BOOST_DEDUCED_TYPENAME base::reference_type_of_temporary_wrapper reference_type_of_temporary_wrapper ; +#endif + typedef BOOST_DEDUCED_TYPENAME base::pointer_type pointer_type ; + typedef BOOST_DEDUCED_TYPENAME base::pointer_const_type pointer_const_type ; + typedef BOOST_DEDUCED_TYPENAME base::argument_type argument_type ; + + // Creates an optional uninitialized. + // No-throw + optional() BOOST_NOEXCEPT : base() {} + + // Creates an optional uninitialized. + // No-throw + optional( none_t none_ ) BOOST_NOEXCEPT : base(none_) {} + + // Creates an optional initialized with 'val'. + // Can throw if T::T(T const&) does + optional ( argument_type val ) : base(val) {} + +#ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES + // Creates an optional initialized with 'move(val)'. + // Can throw if T::T(T &&) does + optional ( rval_reference_type val ) : base( boost::forward(val) ) + {optional_detail::prevent_binding_rvalue_ref_to_optional_lvalue_ref();} +#endif + + // Creates an optional initialized with 'val' IFF cond is true, otherwise creates an uninitialized optional. + // Can throw if T::T(T const&) does + optional ( bool cond, argument_type val ) : base(cond,val) {} + + // NOTE: MSVC needs templated versions first + + // Creates a deep copy of another convertible optional + // Requires a valid conversion from U to T. + // Can throw if T::T(U const&) does + template + explicit optional ( optional const& rhs ) + : + base() + { + if ( rhs.is_initialized() ) + this->construct(rhs.get()); + } + +#ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES + // Creates a deep move of another convertible optional + // Requires a valid conversion from U to T. + // Can throw if T::T(U&&) does + template + explicit optional ( optional && rhs ) + : + base() + { + if ( rhs.is_initialized() ) + this->construct( boost::move(rhs.get()) ); + } +#endif + +#ifndef BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT + // Creates an optional with an expression which can be either + // (a) An instance of InPlaceFactory (i.e. in_place(a,b,...,n); + // (b) An instance of TypedInPlaceFactory ( i.e. in_place(a,b,...,n); + // (c) Any expression implicitly convertible to the single type + // of a one-argument T's constructor. + // (d*) Weak compilers (BCB) might also resolved Expr as optional and optional + // even though explicit overloads are present for these. + // Depending on the above some T ctor is called. + // Can throw if the resolved T ctor throws. +#ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES + + + template + explicit optional ( Expr&& expr, + BOOST_DEDUCED_TYPENAME boost::disable_if_c< + (boost::is_base_of::type>::value) || + boost::is_same::type, none_t>::value >::type* = 0 + ) + : base(boost::forward(expr),boost::addressof(expr)) + {optional_detail::prevent_binding_rvalue_ref_to_optional_lvalue_ref();} + +#else + template + explicit optional ( Expr const& expr ) : base(expr,boost::addressof(expr)) {} +#endif // !defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES +#endif // !defined BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT + + // Creates a deep copy of another optional + // Can throw if T::T(T const&) does + optional ( optional const& rhs ) : base( static_cast(rhs) ) {} + +#ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES + // Creates a deep move of another optional + // Can throw if T::T(T&&) does + optional ( optional && rhs ) + BOOST_NOEXCEPT_IF(::boost::is_nothrow_move_constructible::value) + : base( boost::move(rhs) ) + {} + +#endif + // No-throw (assuming T::~T() doesn't) + ~optional() {} + +#if !defined(BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT) && !defined(BOOST_OPTIONAL_WEAK_OVERLOAD_RESOLUTION) + // Assigns from an expression. See corresponding constructor. + // Basic Guarantee: If the resolved T ctor throws, this is left UNINITIALIZED +#ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES + + template + BOOST_DEDUCED_TYPENAME boost::disable_if_c< + boost::is_base_of::type>::value || + boost::is_same::type, none_t>::value, + optional& + >::type + operator= ( Expr&& expr ) + { + optional_detail::prevent_binding_rvalue_ref_to_optional_lvalue_ref(); + this->assign_expr(boost::forward(expr),boost::addressof(expr)); + return *this ; + } + +#else + template + optional& operator= ( Expr const& expr ) + { + this->assign_expr(expr,boost::addressof(expr)); + return *this ; + } +#endif // !defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES +#endif // !defined(BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT) && !defined(BOOST_OPTIONAL_WEAK_OVERLOAD_RESOLUTION) + + // Copy-assigns from another convertible optional (converts && deep-copies the rhs value) + // Requires a valid conversion from U to T. + // Basic Guarantee: If T::T( U const& ) throws, this is left UNINITIALIZED + template + optional& operator= ( optional const& rhs ) + { + this->assign(rhs); + return *this ; + } + +#ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES + // Move-assigns from another convertible optional (converts && deep-moves the rhs value) + // Requires a valid conversion from U to T. + // Basic Guarantee: If T::T( U && ) throws, this is left UNINITIALIZED + template + optional& operator= ( optional && rhs ) + { + this->assign(boost::move(rhs)); + return *this ; + } +#endif + + // Assigns from another optional (deep-copies the rhs value) + // Basic Guarantee: If T::T( T const& ) throws, this is left UNINITIALIZED + // (NOTE: On BCB, this operator is not actually called and left is left UNMODIFIED in case of a throw) + optional& operator= ( optional const& rhs ) + { + this->assign( static_cast(rhs) ) ; + return *this ; + } + +#ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES + // Assigns from another optional (deep-moves the rhs value) + optional& operator= ( optional && rhs ) + BOOST_NOEXCEPT_IF(::boost::is_nothrow_move_constructible::value && ::boost::is_nothrow_move_assignable::value) + { + this->assign( static_cast(rhs) ) ; + return *this ; + } +#endif + + // Assigns from a T (deep-copies the rhs value) + // Basic Guarantee: If T::( T const& ) throws, this is left UNINITIALIZED + optional& operator= ( argument_type val ) + { + this->assign( val ) ; + return *this ; + } + +#ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES + // Assigns from a T (deep-moves the rhs value) + optional& operator= ( rval_reference_type val ) + { + optional_detail::prevent_binding_rvalue_ref_to_optional_lvalue_ref(); + this->assign( boost::move(val) ) ; + return *this ; + } +#endif + + // Assigns from a "none" + // Which destroys the current value, if any, leaving this UNINITIALIZED + // No-throw (assuming T::~T() doesn't) + optional& operator= ( none_t none_ ) BOOST_NOEXCEPT + { + this->assign( none_ ) ; + return *this ; + } + +#if (!defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES) && (!defined BOOST_NO_CXX11_VARIADIC_TEMPLATES) + // Constructs in-place + // upon exception *this is always uninitialized + template + void emplace ( Args&&... args ) + { + this->emplace_assign( boost::forward(args)... ); + } +#elif (!defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES) + template + void emplace ( Arg&& arg ) + { + this->emplace_assign( boost::forward(arg) ); + } + + void emplace () + { + this->emplace_assign(); + } +#else + template + void emplace ( const Arg& arg ) + { + this->emplace_assign( arg ); + } + + template + void emplace ( Arg& arg ) + { + this->emplace_assign( arg ); + } + + void emplace () + { + this->emplace_assign(); + } +#endif + + void swap( optional & arg ) + BOOST_NOEXCEPT_IF(::boost::is_nothrow_move_constructible::value && ::boost::is_nothrow_move_assignable::value) + { + // allow for Koenig lookup + boost::swap(*this, arg); + } + + + // Returns a reference to the value if this is initialized, otherwise, + // the behaviour is UNDEFINED + // No-throw + reference_const_type get() const { BOOST_ASSERT(this->is_initialized()) ; return this->get_impl(); } + reference_type get() { BOOST_ASSERT(this->is_initialized()) ; return this->get_impl(); } + + // Returns a copy of the value if this is initialized, 'v' otherwise + reference_const_type get_value_or ( reference_const_type v ) const { return this->is_initialized() ? get() : v ; } + reference_type get_value_or ( reference_type v ) { return this->is_initialized() ? get() : v ; } + + // Returns a pointer to the value if this is initialized, otherwise, + // the behaviour is UNDEFINED + // No-throw + pointer_const_type operator->() const { BOOST_ASSERT(this->is_initialized()) ; return this->get_ptr_impl() ; } + pointer_type operator->() { BOOST_ASSERT(this->is_initialized()) ; return this->get_ptr_impl() ; } + + // Returns a reference to the value if this is initialized, otherwise, + // the behaviour is UNDEFINED + // No-throw +#if (!defined BOOST_NO_CXX11_REF_QUALIFIERS) && (!defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES) + reference_const_type operator *() const& { return this->get() ; } + reference_type operator *() & { return this->get() ; } + reference_type_of_temporary_wrapper operator *() && { return base::types::move(this->get()) ; } +#else + reference_const_type operator *() const { return this->get() ; } + reference_type operator *() { return this->get() ; } +#endif // !defined BOOST_NO_CXX11_REF_QUALIFIERS + +#if (!defined BOOST_NO_CXX11_REF_QUALIFIERS) && (!defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES) + reference_const_type value() const& + { + if (this->is_initialized()) + return this->get() ; + else + throw_exception(bad_optional_access()); + } + + reference_type value() & + { + if (this->is_initialized()) + return this->get() ; + else + throw_exception(bad_optional_access()); + } + + reference_type_of_temporary_wrapper value() && + { + if (this->is_initialized()) + return base::types::move(this->get()) ; + else + throw_exception(bad_optional_access()); + } + +#else + reference_const_type value() const + { + if (this->is_initialized()) + return this->get() ; + else + throw_exception(bad_optional_access()); + } + + reference_type value() + { + if (this->is_initialized()) + return this->get() ; + else + throw_exception(bad_optional_access()); + } +#endif + + +#ifndef BOOST_NO_CXX11_REF_QUALIFIERS + template + value_type value_or ( U&& v ) const& + { + if (this->is_initialized()) + return get(); + else + return boost::forward(v); + } + + template + value_type value_or ( U&& v ) && + { + if (this->is_initialized()) + return base::types::move(get()); + else + return boost::forward(v); + } +#elif !defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES + template + value_type value_or ( U&& v ) const + { + if (this->is_initialized()) + return get(); + else + return boost::forward(v); + } +#else + template + value_type value_or ( U const& v ) const + { + if (this->is_initialized()) + return get(); + else + return v; + } + + template + value_type value_or ( U& v ) const + { + if (this->is_initialized()) + return get(); + else + return v; + } +#endif + + +#ifndef BOOST_NO_CXX11_REF_QUALIFIERS + template + value_type value_or_eval ( F f ) const& + { + if (this->is_initialized()) + return get(); + else + return f(); + } + + template + value_type value_or_eval ( F f ) && + { + if (this->is_initialized()) + return base::types::move(get()); + else + return f(); + } +#else + template + value_type value_or_eval ( F f ) const + { + if (this->is_initialized()) + return get(); + else + return f(); + } +#endif + + bool operator!() const BOOST_NOEXCEPT { return !this->is_initialized() ; } + + BOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT() +} ; + +} // namespace boost + + +#endif // header guard diff --git a/3rdparty/boost/boost/optional/detail/optional_aligned_storage.hpp b/3rdparty/boost/boost/optional/detail/optional_aligned_storage.hpp new file mode 100644 index 0000000000..6c7d58148e --- /dev/null +++ b/3rdparty/boost/boost/optional/detail/optional_aligned_storage.hpp @@ -0,0 +1,75 @@ +// Copyright (C) 2003, 2008 Fernando Luis Cacciola Carballal. +// Copyright (C) 2016 Andrzej Krzemienski. +// +// Use, modification, and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// See http://www.boost.org/libs/optional for documentation. +// +// You are welcome to contact the author at: +// fernando_cacciola@hotmail.com +// akrzemi1@gmail.com + +#ifndef BOOST_OPTIONAL_OPTIONAL_DETAIL_OPTIONAL_ALIGNED_STORAGE_AJK_12FEB2016_HPP +#define BOOST_OPTIONAL_OPTIONAL_DETAIL_OPTIONAL_ALIGNED_STORAGE_AJK_12FEB2016_HPP + +namespace boost { + +namespace optional_detail { +// This local class is used instead of that in "aligned_storage.hpp" +// because I've found the 'official' class to ICE BCB5.5 +// when some types are used with optional<> +// (due to sizeof() passed down as a non-type template parameter) +template +class aligned_storage +{ + // Borland ICEs if unnamed unions are used for this! + union + // This works around GCC warnings about breaking strict aliasing rules when casting storage address to T* +#if defined(BOOST_OPTIONAL_DETAIL_USE_ATTRIBUTE_MAY_ALIAS) + __attribute__((__may_alias__)) +#endif + dummy_u + { + char data[ sizeof(T) ]; + BOOST_DEDUCED_TYPENAME type_with_alignment< + ::boost::alignment_of::value >::type aligner_; + } dummy_ ; + + public: + +#if defined(BOOST_OPTIONAL_DETAIL_USE_ATTRIBUTE_MAY_ALIAS) + void const* address() const { return &dummy_; } + void * address() { return &dummy_; } +#else + void const* address() const { return dummy_.data; } + void * address() { return dummy_.data; } +#endif + +#if defined(BOOST_OPTIONAL_DETAIL_USE_ATTRIBUTE_MAY_ALIAS) + // This workaround is supposed to silence GCC warnings about broken strict aliasing rules + T const* ptr_ref() const + { + union { void const* ap_pvoid; T const* as_ptype; } caster = { address() }; + return caster.as_ptype; + } + T * ptr_ref() + { + union { void* ap_pvoid; T* as_ptype; } caster = { address() }; + return caster.as_ptype; + } +#else + T const* ptr_ref() const { return static_cast(address()); } + T * ptr_ref() { return static_cast (address()); } +#endif + + T const& ref() const { return *ptr_ref(); } + T & ref() { return *ptr_ref(); } + +} ; + +} // namespace optional_detail +} // namespace boost + +#endif // header guard diff --git a/3rdparty/boost/boost/optional/detail/optional_config.hpp b/3rdparty/boost/boost/optional/detail/optional_config.hpp new file mode 100644 index 0000000000..648744edbe --- /dev/null +++ b/3rdparty/boost/boost/optional/detail/optional_config.hpp @@ -0,0 +1,99 @@ +// Copyright (C) 2003, 2008 Fernando Luis Cacciola Carballal. +// Copyright (C) 2015 Andrzej Krzemienski. +// +// Use, modification, and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// See http://www.boost.org/libs/optional for documentation. +// +// You are welcome to contact the author at: +// akrzemi1@gmail.com + +#ifndef BOOST_OPTIONAL_DETAIL_OPTIONAL_CONFIG_AJK_28JAN2015_HPP +#define BOOST_OPTIONAL_DETAIL_OPTIONAL_CONFIG_AJK_28JAN2015_HPP + +#include +#include + +#if (defined BOOST_NO_CXX11_RVALUE_REFERENCES) || (defined BOOST_OPTIONAL_CONFIG_NO_RVALUE_REFERENCES) +# define BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES +#endif + +#if BOOST_WORKAROUND(BOOST_INTEL_CXX_VERSION,<=700) +// AFAICT only Intel 7 correctly resolves the overload set +// that includes the in-place factory taking functions, +// so for the other icc versions, in-place factory support +// is disabled +# define BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT +#endif + +#if BOOST_WORKAROUND(__BORLANDC__, <= 0x551) +// BCB (5.5.1) cannot parse the nested template struct in an inplace factory. +# define BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT +#endif + +#if !defined(BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT) \ + && defined BOOST_BCB_PARTIAL_SPECIALIZATION_BUG +// BCB (up to 5.64) has the following bug: +// If there is a member function/operator template of the form +// template mfunc( Expr expr ) ; +// some calls are resolved to this even if there are other better matches. +// The effect of this bug is that calls to converting ctors and assignments +// are incorrectly sink to this general catch-all member function template as shown above. +# define BOOST_OPTIONAL_WEAK_OVERLOAD_RESOLUTION +#endif + +#if defined(__GNUC__) && !defined(__INTEL_COMPILER) +// GCC since 3.3 has may_alias attribute that helps to alleviate optimizer issues with +// regard to violation of the strict aliasing rules. The optional< T > storage type is marked +// with this attribute in order to let the compiler know that it will alias objects of type T +// and silence compilation warnings. +# define BOOST_OPTIONAL_DETAIL_USE_ATTRIBUTE_MAY_ALIAS +#endif + +#if (defined(_MSC_VER) && _MSC_VER <= 1800) +// on MSCV 2013 and earlier an unwanted temporary is created when you assign from +// a const lvalue of integral type. Thus we bind not to the original address but +// to a temporary. +# define BOOST_OPTIONAL_CONFIG_NO_PROPER_ASSIGN_FROM_CONST_INT +#endif + +#if (defined __GNUC__) && (!defined BOOST_INTEL_CXX_VERSION) && (!defined __clang__) +// On some GCC versions an unwanted temporary is created when you copy-initialize +// from a const lvalue of integral type. Thus we bind not to the original address but +// to a temporary. + +# if (__GNUC__ < 4) +# define BOOST_OPTIONAL_CONFIG_NO_PROPER_CONVERT_FROM_CONST_INT +# endif + +# if (__GNUC__ == 4 && __GNUC_MINOR__ <= 5) +# define BOOST_OPTIONAL_CONFIG_NO_PROPER_CONVERT_FROM_CONST_INT +# endif + +# if (__GNUC__ == 5 && __GNUC_MINOR__ < 2) +# define BOOST_OPTIONAL_CONFIG_NO_PROPER_CONVERT_FROM_CONST_INT +# endif + +# if (__GNUC__ == 5 && __GNUC_MINOR__ == 2 && __GNUC_PATCHLEVEL__ == 0) +# define BOOST_OPTIONAL_CONFIG_NO_PROPER_CONVERT_FROM_CONST_INT +# endif + +#endif // defined(__GNUC__) + +#if (defined __GNUC__) && (!defined BOOST_NO_CXX11_RVALUE_REFERENCES) +// On some initial rvalue reference implementations GCC does it in a strange way, +// preferring perfect-forwarding constructor to implicit copy constructor. + +# if (__GNUC__ == 4 && __GNUC_MINOR__ == 4) +# define BOOST_OPTIONAL_CONFIG_NO_LEGAL_CONVERT_FROM_REF +# endif + +# if (__GNUC__ == 4 && __GNUC_MINOR__ == 5) +# define BOOST_OPTIONAL_CONFIG_NO_LEGAL_CONVERT_FROM_REF +# endif + +#endif // defined(__GNUC__) + +#endif // header guard diff --git a/3rdparty/boost/boost/optional/detail/optional_factory_support.hpp b/3rdparty/boost/boost/optional/detail/optional_factory_support.hpp new file mode 100644 index 0000000000..efff92a503 --- /dev/null +++ b/3rdparty/boost/boost/optional/detail/optional_factory_support.hpp @@ -0,0 +1,36 @@ +// Copyright (C) 2003, 2008 Fernando Luis Cacciola Carballal. +// Copyright (C) 2016 Andrzej Krzemienski. +// +// Use, modification, and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// See http://www.boost.org/libs/optional for documentation. +// +// You are welcome to contact the author at: +// fernando_cacciola@hotmail.com +// akrzemi1@gmail.com + +#ifndef BOOST_OPTIONAL_OPTIONAL_DETAIL_OPTIONAL_FACTORY_SUPPORT_AJK_12FEB2016_HPP +#define BOOST_OPTIONAL_OPTIONAL_DETAIL_OPTIONAL_FACTORY_SUPPORT_AJK_12FEB2016_HPP + +// Daniel Wallin discovered that bind/apply.hpp badly interacts with the apply<> +// member template of a factory as used in the optional<> implementation. +// He proposed this simple fix which is to move the call to apply<> outside +// namespace boost. +namespace boost_optional_detail +{ + template + inline void construct(Factory const& factory, void* address) + { + factory.BOOST_NESTED_TEMPLATE apply(address); + } +} + +namespace boost +{ + class in_place_factory_base ; + class typed_in_place_factory_base ; +} + +#endif // header guard diff --git a/3rdparty/boost/boost/optional/detail/optional_reference_spec.hpp b/3rdparty/boost/boost/optional/detail/optional_reference_spec.hpp new file mode 100644 index 0000000000..ba3951af7b --- /dev/null +++ b/3rdparty/boost/boost/optional/detail/optional_reference_spec.hpp @@ -0,0 +1,203 @@ +// Copyright (C) 2015-2016 Andrzej Krzemienski. +// +// Use, modification, and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// See http://www.boost.org/libs/optional for documentation. +// +// You are welcome to contact the author at: +// akrzemi1@gmail.com + +#ifndef BOOST_OPTIONAL_DETAIL_OPTIONAL_REFERENCE_SPEC_AJK_03OCT2015_HPP +#define BOOST_OPTIONAL_DETAIL_OPTIONAL_REFERENCE_SPEC_AJK_03OCT2015_HPP + +#ifdef BOOST_OPTIONAL_CONFIG_NO_PROPER_ASSIGN_FROM_CONST_INT +#include +#include +#endif + +# if 1 + +namespace boost { + +namespace detail { + +#ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES + +template +void prevent_binding_rvalue() +{ +#ifndef BOOST_OPTIONAL_CONFIG_ALLOW_BINDING_TO_RVALUES + BOOST_STATIC_ASSERT_MSG(boost::is_lvalue_reference::value, + "binding rvalue references to optional lvalue references is disallowed"); +#endif +} + +template +BOOST_DEDUCED_TYPENAME boost::remove_reference::type& forward_reference(T&& r) +{ + BOOST_STATIC_ASSERT_MSG(boost::is_lvalue_reference::value, + "binding rvalue references to optional lvalue references is disallowed"); + return boost::forward(r); +} + +#endif // BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES + +template +void prevent_assignment_from_false_const_integral() +{ +#ifndef BOOST_OPTIONAL_CONFIG_ALLOW_BINDING_TO_RVALUES +#ifdef BOOST_OPTIONAL_CONFIG_NO_PROPER_ASSIGN_FROM_CONST_INT + // MSVC compiler without rvalue refernces: we need to disable the asignment from + // const integral lvalue reference, as it may be an invalid temporary + BOOST_STATIC_ASSERT_MSG(!(boost::is_const::value && boost::is_integral::value), + "binding const lvalue references to integral types is disabled in this compiler"); +#endif +#endif +} + +template +struct is_optional_ +{ + static const bool value = false; +}; + +template +struct is_optional_< ::boost::optional > +{ + static const bool value = true; +}; + +template +struct is_no_optional +{ + static const bool value = !is_optional_::type>::value; +}; + +} // namespace detail + +template +class optional : public optional_detail::optional_tag +{ + T* ptr_; + +public: + typedef T& value_type; + typedef T& reference_type; + typedef T& reference_const_type; + typedef T& rval_reference_type; + typedef T* pointer_type; + typedef T* pointer_const_type; + + optional() BOOST_NOEXCEPT : ptr_() {} + optional(none_t) BOOST_NOEXCEPT : ptr_() {} + + template + explicit optional(const optional& rhs) BOOST_NOEXCEPT : ptr_(rhs.ptr_) {} + optional(const optional& rhs) BOOST_NOEXCEPT : ptr_(rhs.ptr_) {} + + + optional& operator=(const optional& rhs) BOOST_NOEXCEPT { ptr_ = rhs.ptr_; return *this; } + template + optional& operator=(const optional& rhs) BOOST_NOEXCEPT { ptr_ = rhs.ptr_; return *this; } + optional& operator=(none_t) BOOST_NOEXCEPT { ptr_ = 0; return *this; } + + + void swap(optional& rhs) BOOST_NOEXCEPT { std::swap(ptr_, rhs.ptr_); } + T& get() const { BOOST_ASSERT(ptr_); return *ptr_; } + + T* get_ptr() const BOOST_NOEXCEPT { return ptr_; } + T* operator->() const { BOOST_ASSERT(ptr_); return ptr_; } + T& operator*() const { BOOST_ASSERT(ptr_); return *ptr_; } + T& value() const { return ptr_ ? *ptr_ : (throw_exception(bad_optional_access()), *ptr_); } + + bool operator!() const BOOST_NOEXCEPT { return ptr_ == 0; } + BOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT() + + void reset() BOOST_NOEXCEPT { ptr_ = 0; } + + bool is_initialized() const BOOST_NOEXCEPT { return ptr_ != 0; } + +#ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES + + template + optional(R&& r, BOOST_DEDUCED_TYPENAME boost::enable_if >::type* = 0) BOOST_NOEXCEPT + : ptr_(boost::addressof(r)) { detail::prevent_binding_rvalue(); } + + template + optional(bool cond, R&& r, BOOST_DEDUCED_TYPENAME boost::enable_if >::type* = 0) BOOST_NOEXCEPT + : ptr_(cond ? boost::addressof(r) : 0) { detail::prevent_binding_rvalue(); } + + template + BOOST_DEDUCED_TYPENAME boost::enable_if, optional&>::type + operator=(R&& r) BOOST_NOEXCEPT { detail::prevent_binding_rvalue(); ptr_ = boost::addressof(r); return *this; } + + template + void emplace(R&& r, BOOST_DEDUCED_TYPENAME boost::enable_if >::type* = 0) BOOST_NOEXCEPT + { detail::prevent_binding_rvalue(); ptr_ = boost::addressof(r); } + + template + T& get_value_or(R&& r, BOOST_DEDUCED_TYPENAME boost::enable_if >::type* = 0) const BOOST_NOEXCEPT + { detail::prevent_binding_rvalue(); return ptr_ ? *ptr_ : r; } + + template + T& value_or(R&& r, BOOST_DEDUCED_TYPENAME boost::enable_if >::type* = 0) const BOOST_NOEXCEPT + { detail::prevent_binding_rvalue(); return ptr_ ? *ptr_ : r; } + + template + void reset(R&& r, BOOST_DEDUCED_TYPENAME boost::enable_if >::type* = 0) BOOST_NOEXCEPT + { detail::prevent_binding_rvalue(); ptr_ = boost::addressof(r); } + + template + T& value_or_eval(F f) const { return ptr_ ? *ptr_ : detail::forward_reference(f()); } + +#else // BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES + + template + optional(U& v, BOOST_DEDUCED_TYPENAME boost::enable_if >::type* = 0) BOOST_NOEXCEPT : ptr_(boost::addressof(v)) { } + + template + optional(bool cond, U& v, BOOST_DEDUCED_TYPENAME boost::enable_if >::type* = 0) BOOST_NOEXCEPT : ptr_(cond ? boost::addressof(v) : 0) {} + + template + BOOST_DEDUCED_TYPENAME boost::enable_if, optional&>::type + operator=(U& v) BOOST_NOEXCEPT + { + detail::prevent_assignment_from_false_const_integral(); + ptr_ = boost::addressof(v); return *this; + } + + template + void emplace(U& v, BOOST_DEDUCED_TYPENAME boost::enable_if >::type* = 0) BOOST_NOEXCEPT + { ptr_ = boost::addressof(v); } + + template + T& get_value_or(U& v, BOOST_DEDUCED_TYPENAME boost::enable_if >::type* = 0) const BOOST_NOEXCEPT + { return ptr_ ? *ptr_ : v; } + + template + T& value_or(U& v, BOOST_DEDUCED_TYPENAME boost::enable_if >::type* = 0) const BOOST_NOEXCEPT + { return ptr_ ? *ptr_ : v; } + + template + void reset(U& v, BOOST_DEDUCED_TYPENAME boost::enable_if >::type* = 0) BOOST_NOEXCEPT + { ptr_ = boost::addressof(v); } + + template + T& value_or_eval(F f) const { return ptr_ ? *ptr_ : f(); } + +#endif // BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES +}; + +template + void swap ( optional& x, optional& y) BOOST_NOEXCEPT +{ + x.swap(y); +} + +} // namespace boost + +#endif // 1/0 + +#endif // header guard diff --git a/3rdparty/boost/boost/optional/detail/optional_relops.hpp b/3rdparty/boost/boost/optional/detail/optional_relops.hpp new file mode 100644 index 0000000000..3f961179d7 --- /dev/null +++ b/3rdparty/boost/boost/optional/detail/optional_relops.hpp @@ -0,0 +1,196 @@ +// Copyright (C) 2003, 2008 Fernando Luis Cacciola Carballal. +// Copyright (C) 2015 Andrzej Krzemienski. +// +// Use, modification, and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// See http://www.boost.org/libs/optional for documentation. +// +// You are welcome to contact the author at: +// akrzemi1@gmail.com + +#ifndef BOOST_OPTIONAL_DETAIL_OPTIONAL_RELOPS_AJK_03OCT2015_HPP +#define BOOST_OPTIONAL_DETAIL_OPTIONAL_RELOPS_AJK_03OCT2015_HPP + +namespace boost { + +// optional's relational operators ( ==, !=, <, >, <=, >= ) have deep-semantics (compare values). +// WARNING: This is UNLIKE pointers. Use equal_pointees()/less_pointess() in generic code instead. + + +// +// optional vs optional cases +// + +template +inline +bool operator == ( optional const& x, optional const& y ) +{ return equal_pointees(x,y); } + +template +inline +bool operator < ( optional const& x, optional const& y ) +{ return less_pointees(x,y); } + +template +inline +bool operator != ( optional const& x, optional const& y ) +{ return !( x == y ) ; } + +template +inline +bool operator > ( optional const& x, optional const& y ) +{ return y < x ; } + +template +inline +bool operator <= ( optional const& x, optional const& y ) +{ return !( y < x ) ; } + +template +inline +bool operator >= ( optional const& x, optional const& y ) +{ return !( x < y ) ; } + + +// +// optional vs T cases +// +template +inline +bool operator == ( optional const& x, T const& y ) +{ return equal_pointees(x, optional(y)); } + +template +inline +bool operator < ( optional const& x, T const& y ) +{ return less_pointees(x, optional(y)); } + +template +inline +bool operator != ( optional const& x, T const& y ) +{ return !( x == y ) ; } + +template +inline +bool operator > ( optional const& x, T const& y ) +{ return y < x ; } + +template +inline +bool operator <= ( optional const& x, T const& y ) +{ return !( y < x ) ; } + +template +inline +bool operator >= ( optional const& x, T const& y ) +{ return !( x < y ) ; } + +// +// T vs optional cases +// + +template +inline +bool operator == ( T const& x, optional const& y ) +{ return equal_pointees( optional(x), y ); } + +template +inline +bool operator < ( T const& x, optional const& y ) +{ return less_pointees( optional(x), y ); } + +template +inline +bool operator != ( T const& x, optional const& y ) +{ return !( x == y ) ; } + +template +inline +bool operator > ( T const& x, optional const& y ) +{ return y < x ; } + +template +inline +bool operator <= ( T const& x, optional const& y ) +{ return !( y < x ) ; } + +template +inline +bool operator >= ( T const& x, optional const& y ) +{ return !( x < y ) ; } + + +// +// optional vs none cases +// + +template +inline +bool operator == ( optional const& x, none_t ) BOOST_NOEXCEPT +{ return !x; } + +template +inline +bool operator < ( optional const& x, none_t ) +{ return less_pointees(x,optional() ); } + +template +inline +bool operator != ( optional const& x, none_t ) BOOST_NOEXCEPT +{ return bool(x); } + +template +inline +bool operator > ( optional const& x, none_t y ) +{ return y < x ; } + +template +inline +bool operator <= ( optional const& x, none_t y ) +{ return !( y < x ) ; } + +template +inline +bool operator >= ( optional const& x, none_t y ) +{ return !( x < y ) ; } + +// +// none vs optional cases +// + +template +inline +bool operator == ( none_t , optional const& y ) BOOST_NOEXCEPT +{ return !y; } + +template +inline +bool operator < ( none_t , optional const& y ) +{ return less_pointees(optional() ,y); } + +template +inline +bool operator != ( none_t, optional const& y ) BOOST_NOEXCEPT +{ return bool(y); } + +template +inline +bool operator > ( none_t x, optional const& y ) +{ return y < x ; } + +template +inline +bool operator <= ( none_t x, optional const& y ) +{ return !( y < x ) ; } + +template +inline +bool operator >= ( none_t x, optional const& y ) +{ return !( x < y ) ; } + +} // namespace boost + +#endif // header guard + diff --git a/3rdparty/boost/boost/optional/detail/optional_swap.hpp b/3rdparty/boost/boost/optional/detail/optional_swap.hpp new file mode 100644 index 0000000000..2a7059e701 --- /dev/null +++ b/3rdparty/boost/boost/optional/detail/optional_swap.hpp @@ -0,0 +1,117 @@ +// Copyright (C) 2003, 2008 Fernando Luis Cacciola Carballal. +// Copyright (C) 2015 Andrzej Krzemienski. +// +// Use, modification, and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// See http://www.boost.org/libs/optional for documentation. +// +// You are welcome to contact the author at: +// akrzemi1@gmail.com + +#ifndef BOOST_OPTIONAL_DETAIL_OPTIONAL_SWAP_AJK_28JAN2015_HPP +#define BOOST_OPTIONAL_DETAIL_OPTIONAL_SWAP_AJK_28JAN2015_HPP + +#include +#include + +namespace boost { + +namespace optional_detail { + +template struct swap_selector; + +template <> +struct swap_selector +{ + template + static void optional_swap ( optional& x, optional& y ) + { + const bool hasX = !!x; + const bool hasY = !!y; + + if ( !hasX && !hasY ) + return; + + if( !hasX ) + x.emplace(); + else if ( !hasY ) + y.emplace(); + + // Boost.Utility.Swap will take care of ADL and workarounds for broken compilers + boost::swap(x.get(), y.get()); + + if( !hasX ) + y = boost::none ; + else if( !hasY ) + x = boost::none ; + } +}; + +#ifdef BOOST_OPTIONAL_DETAIL_MOVE +# undef BOOST_OPTIONAL_DETAIL_MOVE +#endif + +#ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES +# define BOOST_OPTIONAL_DETAIL_MOVE(EXPR_) boost::move(EXPR_) +#else +# define BOOST_OPTIONAL_DETAIL_MOVE(EXPR_) EXPR_ +#endif + +template <> +struct swap_selector +{ + template + static void optional_swap ( optional& x, optional& y ) + //BOOST_NOEXCEPT_IF(::boost::is_nothrow_move_constructible::value && BOOST_NOEXCEPT_EXPR(boost::swap(*x, *y))) + { + if (x) + { + if (y) + { + boost::swap(*x, *y); + } + else + { + y = BOOST_OPTIONAL_DETAIL_MOVE(*x); + x = boost::none; + } + } + else + { + if (y) + { + x = BOOST_OPTIONAL_DETAIL_MOVE(*y); + y = boost::none; + } + } + } +}; + +} // namespace optional_detail + +#if (!defined BOOST_NO_CXX11_RVALUE_REFERENCES) && (!defined BOOST_CONFIG_RESTORE_OBSOLETE_SWAP_IMPLEMENTATION) + +template +struct optional_swap_should_use_default_constructor : boost::false_type {} ; + +#else + +template +struct optional_swap_should_use_default_constructor : has_nothrow_default_constructor {} ; + +#endif + +template +inline void swap ( optional& x, optional& y ) +//BOOST_NOEXCEPT_IF(::boost::is_nothrow_move_constructible::value && BOOST_NOEXCEPT_EXPR(boost::swap(*x, *y))) +{ + optional_detail::swap_selector::value>::optional_swap(x, y); +} + +} // namespace boost + +#undef BOOST_OPTIONAL_DETAIL_MOVE + +#endif // header guard diff --git a/3rdparty/boost/boost/optional/optional.hpp b/3rdparty/boost/boost/optional/optional.hpp index 9def94ede8..ff1a16ca48 100644 --- a/3rdparty/boost/boost/optional/optional.hpp +++ b/3rdparty/boost/boost/optional/optional.hpp @@ -20,7 +20,6 @@ #include #include -#include #include #include #include @@ -31,208 +30,60 @@ #include #include #include +#include #include #include #include #include #include #include +#include #include #include #include -#include #include #include -#include -#include -#include -#include #include #include #include #include +#include +#include +#include -#if (defined BOOST_NO_CXX11_RVALUE_REFERENCES) || (defined BOOST_OPTIONAL_CONFIG_NO_RVALUE_REFERENCES) -#define BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES -#endif - -#if BOOST_WORKAROUND(BOOST_INTEL_CXX_VERSION,<=700) -// AFAICT only Intel 7 correctly resolves the overload set -// that includes the in-place factory taking functions, -// so for the other icc versions, in-place factory support -// is disabled -#define BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT -#endif - -#if BOOST_WORKAROUND(__BORLANDC__, <= 0x551) -// BCB (5.5.1) cannot parse the nested template struct in an inplace factory. -#define BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT -#endif - -#if !defined(BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT) \ - && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x581) ) -// BCB (up to 5.64) has the following bug: -// If there is a member function/operator template of the form -// template mfunc( Expr expr ) ; -// some calls are resolved to this even if there are other better matches. -// The effect of this bug is that calls to converting ctors and assignments -// are incrorrectly sink to this general catch-all member function template as shown above. -#define BOOST_OPTIONAL_WEAK_OVERLOAD_RESOLUTION -#endif - -#if defined(__GNUC__) && !defined(__INTEL_COMPILER) -// GCC since 3.3 has may_alias attribute that helps to alleviate optimizer issues with -// regard to violation of the strict aliasing rules. The optional< T > storage type is marked -// with this attribute in order to let the compiler know that it will alias objects of type T -// and silence compilation warnings. -#define BOOST_OPTIONAL_DETAIL_USE_ATTRIBUTE_MAY_ALIAS -#endif - -// Daniel Wallin discovered that bind/apply.hpp badly interacts with the apply<> -// member template of a factory as used in the optional<> implementation. -// He proposed this simple fix which is to move the call to apply<> outside -// namespace boost. -namespace boost_optional_detail -{ - template - inline void construct(Factory const& factory, void* address) - { - factory.BOOST_NESTED_TEMPLATE apply(address); - } -} - - +#ifdef BOOST_OPTIONAL_CONFIG_USE_OLD_IMPLEMENTATION_OF_OPTIONAL +#include +#else namespace boost { -class in_place_factory_base ; -class typed_in_place_factory_base ; - -// This forward is needed to refer to namespace scope swap from the member swap -template void swap ( optional& x, optional& y ); - namespace optional_detail { -// This local class is used instead of that in "aligned_storage.hpp" -// because I've found the 'official' class to ICE BCB5.5 -// when some types are used with optional<> -// (due to sizeof() passed down as a non-type template parameter) -template -class aligned_storage -{ - // Borland ICEs if unnamed unions are used for this! - union - // This works around GCC warnings about breaking strict aliasing rules when casting storage address to T* -#if defined(BOOST_OPTIONAL_DETAIL_USE_ATTRIBUTE_MAY_ALIAS) - __attribute__((__may_alias__)) -#endif - dummy_u - { - char data[ sizeof(T) ]; - BOOST_DEDUCED_TYPENAME type_with_alignment< - ::boost::alignment_of::value >::type aligner_; - } dummy_ ; - - public: - -#if defined(BOOST_OPTIONAL_DETAIL_USE_ATTRIBUTE_MAY_ALIAS) - void const* address() const { return &dummy_; } - void * address() { return &dummy_; } -#else - void const* address() const { return dummy_.data; } - void * address() { return dummy_.data; } -#endif -} ; - -template -struct types_when_isnt_ref -{ - typedef T const& reference_const_type ; - typedef T & reference_type ; -#ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES - typedef T && rval_reference_type ; - typedef T && reference_type_of_temporary_wrapper; -#ifdef BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES - // GCC 4.4 has support for an early draft of rvalue references. The conforming version below - // causes warnings about returning references to a temporary. - static T&& move(T&& r) { return r; } -#else - static rval_reference_type move(reference_type r) { return boost::move(r); } -#endif -#endif - typedef T const* pointer_const_type ; - typedef T * pointer_type ; - typedef T const& argument_type ; -} ; - -template -struct types_when_is_ref -{ - typedef BOOST_DEDUCED_TYPENAME remove_reference::type raw_type ; - - typedef raw_type& reference_const_type ; - typedef raw_type& reference_type ; -#ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES - typedef BOOST_DEDUCED_TYPENAME remove_const::type&& rval_reference_type ; - typedef raw_type& reference_type_of_temporary_wrapper; - static reference_type move(reference_type r) { return r; } -#endif - typedef raw_type* pointer_const_type ; - typedef raw_type* pointer_type ; - typedef raw_type& argument_type ; -} ; - -template -void prevent_binding_rvalue_ref_to_optional_lvalue_ref() -{ -#ifndef BOOST_OPTIONAL_CONFIG_ALLOW_BINDING_TO_RVALUES - BOOST_STATIC_ASSERT_MSG( - !boost::is_lvalue_reference::value || !boost::is_rvalue_reference::value, - "binding rvalue references to optional lvalue references is disallowed"); -#endif -} struct optional_tag {} ; + template class optional_base : public optional_tag { private : - typedef -#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) - BOOST_DEDUCED_TYPENAME -#endif - ::boost::detail::make_reference_content::type internal_type ; - - typedef aligned_storage storage_type ; - - typedef types_when_isnt_ref types_when_not_ref ; - typedef types_when_is_ref types_when_ref ; - + typedef aligned_storage storage_type ; typedef optional_base this_type ; protected : typedef T value_type ; - typedef mpl::true_ is_reference_tag ; - typedef mpl::false_ is_not_reference_tag ; - - typedef BOOST_DEDUCED_TYPENAME is_reference::type is_reference_predicate ; - - public: - typedef BOOST_DEDUCED_TYPENAME mpl::if_::type types ; - protected: - typedef BOOST_DEDUCED_TYPENAME types::reference_type reference_type ; - typedef BOOST_DEDUCED_TYPENAME types::reference_const_type reference_const_type ; + typedef T & reference_type ; + typedef T const& reference_const_type ; #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES - typedef BOOST_DEDUCED_TYPENAME types::rval_reference_type rval_reference_type ; - typedef BOOST_DEDUCED_TYPENAME types::reference_type_of_temporary_wrapper reference_type_of_temporary_wrapper ; + typedef T && rval_reference_type ; + typedef T && reference_type_of_temporary_wrapper ; #endif - typedef BOOST_DEDUCED_TYPENAME types::pointer_type pointer_type ; - typedef BOOST_DEDUCED_TYPENAME types::pointer_const_type pointer_const_type ; - typedef BOOST_DEDUCED_TYPENAME types::argument_type argument_type ; + typedef T * pointer_type ; + typedef T const* pointer_const_type ; + typedef T const& argument_type ; // Creates an optional uninitialized. // No-throw @@ -252,7 +103,7 @@ class optional_base : public optional_tag : m_initialized(false) { - construct(val); + construct(val); } #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES @@ -332,7 +183,7 @@ class optional_base : public optional_tag if (is_initialized()) { if ( rhs.is_initialized() ) - assign_value(rhs.get_impl(), is_reference_predicate() ); + assign_value(rhs.get_impl()); else destroy(); } else @@ -349,7 +200,7 @@ class optional_base : public optional_tag if (is_initialized()) { if ( rhs.is_initialized() ) - assign_value(boost::move(rhs.get_impl()), is_reference_predicate() ); + assign_value( boost::move(rhs.get_impl()) ); else destroy(); } else @@ -368,9 +219,9 @@ class optional_base : public optional_tag { if ( rhs.is_initialized() ) #ifndef BOOST_OPTIONAL_CONFIG_RESTORE_ASSIGNMENT_OF_NONCONVERTIBLE_TYPES - assign_value(rhs.get(), is_reference_predicate() ); + assign_value( rhs.get() ); #else - assign_value(static_cast(rhs.get()), is_reference_predicate() ); + assign_value( static_cast(rhs.get()) ); #endif else destroy(); @@ -395,7 +246,7 @@ class optional_base : public optional_tag if (is_initialized()) { if ( rhs.is_initialized() ) - assign_value(static_cast(rhs.get()), is_reference_predicate() ); + assign_value( static_cast(rhs.get()) ); else destroy(); } else @@ -410,7 +261,7 @@ class optional_base : public optional_tag void assign ( argument_type val ) { if (is_initialized()) - assign_value(val, is_reference_predicate() ); + assign_value(val); else construct(val); } @@ -419,7 +270,7 @@ class optional_base : public optional_tag void assign ( rval_reference_type val ) { if (is_initialized()) - assign_value( boost::move(val), is_reference_predicate() ); + assign_value( boost::move(val) ); else construct( boost::move(val) ); } #endif @@ -471,14 +322,14 @@ class optional_base : public optional_tag void construct ( argument_type val ) { - ::new (m_storage.address()) internal_type(val) ; + ::new (m_storage.address()) value_type(val) ; m_initialized = true ; } #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES void construct ( rval_reference_type val ) { - ::new (m_storage.address()) internal_type( types::move(val) ) ; + ::new (m_storage.address()) value_type( boost::move(val) ) ; m_initialized = true ; } #endif @@ -491,7 +342,7 @@ class optional_base : public optional_tag void emplace_assign ( Args&&... args ) { destroy(); - ::new (m_storage.address()) internal_type( boost::forward(args)... ); + ::new (m_storage.address()) value_type( boost::forward(args)... ); m_initialized = true ; } #elif (!defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES) @@ -499,14 +350,14 @@ class optional_base : public optional_tag void emplace_assign ( Arg&& arg ) { destroy(); - ::new (m_storage.address()) internal_type( boost::forward(arg) ); + ::new (m_storage.address()) value_type( boost::forward(arg) ); m_initialized = true ; } void emplace_assign () { destroy(); - ::new (m_storage.address()) internal_type(); + ::new (m_storage.address()) value_type(); m_initialized = true ; } #else @@ -514,7 +365,7 @@ class optional_base : public optional_tag void emplace_assign ( const Arg& arg ) { destroy(); - ::new (m_storage.address()) internal_type( arg ); + ::new (m_storage.address()) value_type( arg ); m_initialized = true ; } @@ -522,14 +373,14 @@ class optional_base : public optional_tag void emplace_assign ( Arg& arg ) { destroy(); - ::new (m_storage.address()) internal_type( arg ); + ::new (m_storage.address()) value_type( arg ); m_initialized = true ; } void emplace_assign () { destroy(); - ::new (m_storage.address()) internal_type(); + ::new (m_storage.address()) value_type(); m_initialized = true ; } #endif @@ -541,7 +392,6 @@ class optional_base : public optional_tag template void construct ( Expr&& factory, in_place_factory_base const* ) { - BOOST_STATIC_ASSERT ( ::boost::mpl::not_::value ) ; boost_optional_detail::construct(factory, m_storage.address()); m_initialized = true ; } @@ -550,7 +400,6 @@ class optional_base : public optional_tag template void construct ( Expr&& factory, typed_in_place_factory_base const* ) { - BOOST_STATIC_ASSERT ( ::boost::mpl::not_::value ) ; factory.apply(m_storage.address()) ; m_initialized = true ; } @@ -575,7 +424,6 @@ class optional_base : public optional_tag template void construct ( Expr const& factory, in_place_factory_base const* ) { - BOOST_STATIC_ASSERT ( ::boost::mpl::not_::value ) ; boost_optional_detail::construct(factory, m_storage.address()); m_initialized = true ; } @@ -584,7 +432,6 @@ class optional_base : public optional_tag template void construct ( Expr const& factory, typed_in_place_factory_base const* ) { - BOOST_STATIC_ASSERT ( ::boost::mpl::not_::value ) ; factory.apply(m_storage.address()) ; m_initialized = true ; } @@ -615,7 +462,7 @@ class optional_base : public optional_tag template void construct ( Expr&& expr, void const* ) { - new (m_storage.address()) internal_type(boost::forward(expr)) ; + new (m_storage.address()) value_type(boost::forward(expr)) ; m_initialized = true ; } @@ -626,7 +473,7 @@ class optional_base : public optional_tag template void assign_expr_to_initialized ( Expr&& expr, void const* ) { - assign_value(boost::forward(expr), is_reference_predicate()); + assign_value( boost::forward(expr) ); } #else // Constructs using any expression implicitly convertible to the single argument @@ -636,7 +483,7 @@ class optional_base : public optional_tag template void construct ( Expr const& expr, void const* ) { - new (m_storage.address()) internal_type(expr) ; + new (m_storage.address()) value_type(expr) ; m_initialized = true ; } @@ -647,7 +494,7 @@ class optional_base : public optional_tag template void assign_expr_to_initialized ( Expr const& expr, void const* ) { - assign_value(expr, is_reference_predicate()); + assign_value(expr); } #endif @@ -674,7 +521,7 @@ class optional_base : public optional_tag { // An exception can be thrown here. // It it happens, THIS will be left uninitialized. - new (m_storage.address()) internal_type(types::move(expr.get())) ; + new (m_storage.address()) value_type(boost::move(expr.get())) ; m_initialized = true ; } } @@ -687,78 +534,78 @@ class optional_base : public optional_tag { // An exception can be thrown here. // It it happens, THIS will be left uninitialized. - new (m_storage.address()) internal_type(expr.get()) ; + new (m_storage.address()) value_type(expr.get()) ; m_initialized = true ; } } #endif #endif // defined BOOST_OPTIONAL_WEAK_OVERLOAD_RESOLUTION - void assign_value ( argument_type val, is_not_reference_tag ) { get_impl() = val; } - void assign_value ( argument_type val, is_reference_tag ) { construct(val); } + void assign_value ( argument_type val ) { get_impl() = val; } #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES - void assign_value ( rval_reference_type val, is_not_reference_tag ) { get_impl() = static_cast(val); } - void assign_value ( rval_reference_type val, is_reference_tag ) { construct( static_cast(val) ); } + void assign_value ( rval_reference_type val ) { get_impl() = static_cast(val); } #endif void destroy() { if ( m_initialized ) - destroy_impl(is_reference_predicate()) ; + destroy_impl() ; } - reference_const_type get_impl() const { return dereference(get_object(), is_reference_predicate() ) ; } - reference_type get_impl() { return dereference(get_object(), is_reference_predicate() ) ; } + reference_const_type get_impl() const { return m_storage.ref() ; } + reference_type get_impl() { return m_storage.ref() ; } - pointer_const_type get_ptr_impl() const { return cast_ptr(get_object(), is_reference_predicate() ) ; } - pointer_type get_ptr_impl() { return cast_ptr(get_object(), is_reference_predicate() ) ; } + pointer_const_type get_ptr_impl() const { return m_storage.ptr_ref(); } + pointer_type get_ptr_impl() { return m_storage.ptr_ref(); } private : - // internal_type can be either T or reference_content -#if defined(BOOST_OPTIONAL_DETAIL_USE_ATTRIBUTE_MAY_ALIAS) - // This workaround is supposed to silence GCC warnings about broken strict aliasing rules - internal_type const* get_object() const - { - union { void const* ap_pvoid; internal_type const* as_ptype; } caster = { m_storage.address() }; - return caster.as_ptype; - } - internal_type * get_object() - { - union { void* ap_pvoid; internal_type* as_ptype; } caster = { m_storage.address() }; - return caster.as_ptype; - } +#if BOOST_WORKAROUND(BOOST_MSVC, <= 1600) + void destroy_impl ( ) { m_storage.ptr_ref()->~T() ; m_initialized = false ; } #else - internal_type const* get_object() const { return static_cast(m_storage.address()); } - internal_type * get_object() { return static_cast (m_storage.address()); } + void destroy_impl ( ) { m_storage.ref().T::~T() ; m_initialized = false ; } #endif - // reference_content lacks an implicit conversion to T&, so the following is needed to obtain a proper reference. - reference_const_type dereference( internal_type const* p, is_not_reference_tag ) const { return *p ; } - reference_type dereference( internal_type* p, is_not_reference_tag ) { return *p ; } - reference_const_type dereference( internal_type const* p, is_reference_tag ) const { return p->get() ; } - reference_type dereference( internal_type* p, is_reference_tag ) { return p->get() ; } + bool m_initialized ; + storage_type m_storage ; +} ; + +// definition of metafunciton is_optional_val_init_candidate +template +struct is_optional_related + : boost::conditional< boost::is_base_of::type>::value + || boost::is_same::type, none_t>::value, + boost::true_type, boost::false_type>::type +{}; + +#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1800) && !BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40500) && !defined(__SUNPRO_CC) + // this condition is a copy paste from is_constructible.hpp + // I also disable SUNPRO, as it seems not to support type_traits correctly + +template +struct is_convertible_to_T_or_factory + : boost::conditional< boost::is_base_of::type>::value + || boost::is_base_of::type>::value + || boost::is_constructible::value + , boost::true_type, boost::false_type>::type +{}; -#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x581)) - void destroy_impl ( is_not_reference_tag ) { get_ptr_impl()->internal_type::~internal_type() ; m_initialized = false ; } #else - void destroy_impl ( is_not_reference_tag ) { get_ptr_impl()->~T() ; m_initialized = false ; } -#endif - void destroy_impl ( is_reference_tag ) { m_initialized = false ; } +#define BOOST_OPTIONAL_DETAIL_NO_IS_CONSTRUCTIBLE_TRAIT - // If T is of reference type, trying to get a pointer to the held value must result in a compile-time error. - // Decent compilers should disallow conversions from reference_content* to T*, but just in case, - // the following olverloads are used to filter out the case and guarantee an error in case of T being a reference. - pointer_const_type cast_ptr( internal_type const* p, is_not_reference_tag ) const { return p ; } - pointer_type cast_ptr( internal_type * p, is_not_reference_tag ) { return p ; } - pointer_const_type cast_ptr( internal_type const* p, is_reference_tag ) const { return &p->get() ; } - pointer_type cast_ptr( internal_type * p, is_reference_tag ) { return &p->get() ; } +template +struct is_convertible_to_T_or_factory : boost::true_type +{}; - bool m_initialized ; - storage_type m_storage ; -} ; +#endif // is_convertible condition +template +struct is_optional_val_init_candidate + : boost::conditional< !is_optional_related::value && is_convertible_to_T_or_factory::value + , boost::true_type, boost::false_type>::type +{}; + } // namespace optional_detail template @@ -797,7 +644,7 @@ class optional : public optional_detail::optional_base // Creates an optional initialized with 'move(val)'. // Can throw if T::T(T &&) does optional ( rval_reference_type val ) : base( boost::forward(val) ) - {optional_detail::prevent_binding_rvalue_ref_to_optional_lvalue_ref();} + {} #endif // Creates an optional initialized with 'val' IFF cond is true, otherwise creates an uninitialized optional. @@ -847,12 +694,10 @@ class optional : public optional_detail::optional_base template explicit optional ( Expr&& expr, - BOOST_DEDUCED_TYPENAME boost::disable_if_c< - (boost::is_base_of::type>::value) || - boost::is_same::type, none_t>::value >::type* = 0 + BOOST_DEDUCED_TYPENAME boost::enable_if< optional_detail::is_optional_val_init_candidate >::type* = 0 ) : base(boost::forward(expr),boost::addressof(expr)) - {optional_detail::prevent_binding_rvalue_ref_to_optional_lvalue_ref();} + {} #else template @@ -873,23 +718,22 @@ class optional : public optional_detail::optional_base {} #endif - // No-throw (assuming T::~T() doesn't) + +#if BOOST_WORKAROUND(_MSC_VER, <= 1600) + // On old MSVC compilers the implicitly declared dtor is not called ~optional() {} +#endif + #if !defined(BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT) && !defined(BOOST_OPTIONAL_WEAK_OVERLOAD_RESOLUTION) // Assigns from an expression. See corresponding constructor. // Basic Guarantee: If the resolved T ctor throws, this is left UNINITIALIZED #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES template - BOOST_DEDUCED_TYPENAME boost::disable_if_c< - boost::is_base_of::type>::value || - boost::is_same::type, none_t>::value, - optional& - >::type + BOOST_DEDUCED_TYPENAME boost::enable_if, optional&>::type operator= ( Expr&& expr ) { - optional_detail::prevent_binding_rvalue_ref_to_optional_lvalue_ref(); this->assign_expr(boost::forward(expr),boost::addressof(expr)); return *this ; } @@ -957,7 +801,6 @@ class optional : public optional_detail::optional_base // Assigns from a T (deep-moves the rhs value) optional& operator= ( rval_reference_type val ) { - optional_detail::prevent_binding_rvalue_ref_to_optional_lvalue_ref(); this->assign( boost::move(val) ) ; return *this ; } @@ -1040,7 +883,7 @@ class optional : public optional_detail::optional_base #if (!defined BOOST_NO_CXX11_REF_QUALIFIERS) && (!defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES) reference_const_type operator *() const& { return this->get() ; } reference_type operator *() & { return this->get() ; } - reference_type_of_temporary_wrapper operator *() && { return base::types::move(this->get()) ; } + reference_type_of_temporary_wrapper operator *() && { return boost::move(this->get()) ; } #else reference_const_type operator *() const { return this->get() ; } reference_type operator *() { return this->get() ; } @@ -1066,7 +909,7 @@ class optional : public optional_detail::optional_base reference_type_of_temporary_wrapper value() && { if (this->is_initialized()) - return base::types::move(this->get()) ; + return boost::move(this->get()) ; else throw_exception(bad_optional_access()); } @@ -1104,7 +947,7 @@ class optional : public optional_detail::optional_base value_type value_or ( U&& v ) && { if (this->is_initialized()) - return base::types::move(get()); + return boost::move(get()); else return boost::forward(v); } @@ -1152,7 +995,7 @@ class optional : public optional_detail::optional_base value_type value_or_eval ( F f ) && { if (this->is_initialized()) - return base::types::move(get()); + return boost::move(get()); else return f(); } @@ -1172,6 +1015,12 @@ class optional : public optional_detail::optional_base BOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT() } ; +} // namespace boost + +#endif // BOOST_OPTIONAL_CONFIG_USE_OLD_IMPLEMENTATION_OF_OPTIONAL + +namespace boost { + #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES template class optional @@ -1180,6 +1029,14 @@ class optional } ; #endif +} // namespace boost + +#ifndef BOOST_OPTIONAL_CONFIG_DONT_SPECIALIZE_OPTIONAL_REFS +# include +#endif + +namespace boost { + // Returns optional(v) template inline @@ -1268,6 +1125,10 @@ get_pointer ( optional& opt ) return opt.get_ptr() ; } +} // namespace boost + +namespace boost { + // The following declaration prevents a bug where operator safe-bool is used upon streaming optional object if you forget the IO header. template std::basic_ostream& @@ -1277,291 +1138,9 @@ operator<<(std::basic_ostream& os, optional_detail::optiona return os; } -// optional's relational operators ( ==, !=, <, >, <=, >= ) have deep-semantics (compare values). -// WARNING: This is UNLIKE pointers. Use equal_pointees()/less_pointess() in generic code instead. - - -// -// optional vs optional cases -// - -template -inline -bool operator == ( optional const& x, optional const& y ) -{ return equal_pointees(x,y); } - -template -inline -bool operator < ( optional const& x, optional const& y ) -{ return less_pointees(x,y); } - -template -inline -bool operator != ( optional const& x, optional const& y ) -{ return !( x == y ) ; } - -template -inline -bool operator > ( optional const& x, optional const& y ) -{ return y < x ; } - -template -inline -bool operator <= ( optional const& x, optional const& y ) -{ return !( y < x ) ; } - -template -inline -bool operator >= ( optional const& x, optional const& y ) -{ return !( x < y ) ; } - - -// -// optional vs T cases -// -template -inline -bool operator == ( optional const& x, T const& y ) -{ return equal_pointees(x, optional(y)); } - -template -inline -bool operator < ( optional const& x, T const& y ) -{ return less_pointees(x, optional(y)); } - -template -inline -bool operator != ( optional const& x, T const& y ) -{ return !( x == y ) ; } - -template -inline -bool operator > ( optional const& x, T const& y ) -{ return y < x ; } - -template -inline -bool operator <= ( optional const& x, T const& y ) -{ return !( y < x ) ; } - -template -inline -bool operator >= ( optional const& x, T const& y ) -{ return !( x < y ) ; } - -// -// T vs optional cases -// - -template -inline -bool operator == ( T const& x, optional const& y ) -{ return equal_pointees( optional(x), y ); } - -template -inline -bool operator < ( T const& x, optional const& y ) -{ return less_pointees( optional(x), y ); } - -template -inline -bool operator != ( T const& x, optional const& y ) -{ return !( x == y ) ; } - -template -inline -bool operator > ( T const& x, optional const& y ) -{ return y < x ; } - -template -inline -bool operator <= ( T const& x, optional const& y ) -{ return !( y < x ) ; } - -template -inline -bool operator >= ( T const& x, optional const& y ) -{ return !( x < y ) ; } - - -// -// optional vs none cases -// - -template -inline -bool operator == ( optional const& x, none_t ) BOOST_NOEXCEPT -{ return !x; } - -template -inline -bool operator < ( optional const& x, none_t ) -{ return less_pointees(x,optional() ); } - -template -inline -bool operator != ( optional const& x, none_t ) BOOST_NOEXCEPT -{ return bool(x); } - -template -inline -bool operator > ( optional const& x, none_t y ) -{ return y < x ; } - -template -inline -bool operator <= ( optional const& x, none_t y ) -{ return !( y < x ) ; } - -template -inline -bool operator >= ( optional const& x, none_t y ) -{ return !( x < y ) ; } - -// -// none vs optional cases -// - -template -inline -bool operator == ( none_t , optional const& y ) BOOST_NOEXCEPT -{ return !y; } - -template -inline -bool operator < ( none_t , optional const& y ) -{ return less_pointees(optional() ,y); } - -template -inline -bool operator != ( none_t, optional const& y ) BOOST_NOEXCEPT -{ return bool(y); } - -template -inline -bool operator > ( none_t x, optional const& y ) -{ return y < x ; } - -template -inline -bool operator <= ( none_t x, optional const& y ) -{ return !( y < x ) ; } - -template -inline -bool operator >= ( none_t x, optional const& y ) -{ return !( x < y ) ; } - -namespace optional_detail { - -template struct swap_selector; - -template<> -struct swap_selector -{ - template - static void optional_swap ( optional& x, optional& y ) - { - const bool hasX = !!x; - const bool hasY = !!y; - - if ( !hasX && !hasY ) - return; - - if( !hasX ) - x.emplace(); - else if ( !hasY ) - y.emplace(); - - // Boost.Utility.Swap will take care of ADL and workarounds for broken compilers - boost::swap(x.get(),y.get()); - - if( !hasX ) - y = boost::none ; - else if( !hasY ) - x = boost::none ; - } -}; - -#ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES -template<> -struct swap_selector -{ - template - static void optional_swap ( optional& x, optional& y ) - //BOOST_NOEXCEPT_IF(::boost::is_nothrow_move_constructible::value && BOOST_NOEXCEPT_EXPR(boost::swap(*x, *y))) - { - if(x) - { - if (y) - { - boost::swap(*x, *y); - } - else - { - y = boost::move(*x); - x = boost::none; - } - } - else - { - if (y) - { - x = boost::move(*y); - y = boost::none; - } - } - } -}; -#else -template<> -struct swap_selector -{ - template - static void optional_swap ( optional& x, optional& y ) - { - const bool hasX = !!x; - const bool hasY = !!y; - - if ( !hasX && hasY ) - { - x = y.get(); - y = boost::none ; - } - else if ( hasX && !hasY ) - { - y = x.get(); - x = boost::none ; - } - else if ( hasX && hasY ) - { - // Boost.Utility.Swap will take care of ADL and workarounds for broken compilers - boost::swap(x.get(),y.get()); - } - } -}; -#endif // !defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES - -} // namespace optional_detail - -#if (!defined BOOST_NO_CXX11_RVALUE_REFERENCES) && (!defined BOOST_CONFIG_RESTORE_OBSOLETE_SWAP_IMPLEMENTATION) - -template -struct optional_swap_should_use_default_constructor : boost::false_type {} ; - -#else - -template -struct optional_swap_should_use_default_constructor : has_nothrow_default_constructor {} ; - -#endif //BOOST_NO_CXX11_RVALUE_REFERENCES - -template inline void swap ( optional& x, optional& y ) - //BOOST_NOEXCEPT_IF(::boost::is_nothrow_move_constructible::value && BOOST_NOEXCEPT_EXPR(boost::swap(*x, *y))) -{ - optional_detail::swap_selector::value>::optional_swap(x, y); -} - } // namespace boost -#endif +#include +#include + +#endif // header guard diff --git a/3rdparty/boost/boost/optional/optional_fwd.hpp b/3rdparty/boost/boost/optional/optional_fwd.hpp index fb59682df6..faee253e55 100644 --- a/3rdparty/boost/boost/optional/optional_fwd.hpp +++ b/3rdparty/boost/boost/optional/optional_fwd.hpp @@ -1,4 +1,5 @@ // Copyright (C) 2003, 2008 Fernando Luis Cacciola Carballal. +// Copyright (C) 2016 Andrzej Krzemienski // // Use, modification, and distribution is subject to the Boost Software // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -15,15 +16,25 @@ #ifndef BOOST_OPTIONAL_OPTIONAL_FWD_FLC_19NOV2002_HPP #define BOOST_OPTIONAL_OPTIONAL_FWD_FLC_19NOV2002_HPP +#include namespace boost { template class optional ; -template void swap ( optional& , optional& ); +// This forward is needed to refer to namespace scope swap from the member swap +template void swap ( optional& , optional& ) ; template struct optional_swap_should_use_default_constructor ; +#ifndef BOOST_OPTIONAL_CONFIG_DONT_SPECIALIZE_OPTIONAL_REFS + +template class optional ; + +template void swap ( optional& , optional& ) BOOST_NOEXCEPT; + +#endif + } // namespace boost #endif diff --git a/3rdparty/boost/boost/predef/hardware/simd.h b/3rdparty/boost/boost/predef/hardware/simd.h index 4de1e70cd3..ac5c9da2ca 100644 --- a/3rdparty/boost/boost/predef/hardware/simd.h +++ b/3rdparty/boost/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/3rdparty/boost/boost/predef/hardware/simd/x86.h b/3rdparty/boost/boost/predef/hardware/simd/x86.h index 0874bc4ea7..88bd81e362 100644 --- a/3rdparty/boost/boost/predef/hardware/simd/x86.h +++ b/3rdparty/boost/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/3rdparty/boost/boost/predef/hardware/simd/x86_amd.h b/3rdparty/boost/boost/predef/hardware/simd/x86_amd.h index 60fd4485ec..c80d1ce2b7 100644 --- a/3rdparty/boost/boost/predef/hardware/simd/x86_amd.h +++ b/3rdparty/boost/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/3rdparty/boost/boost/predef/hardware/simd/x86_amd/versions.h b/3rdparty/boost/boost/predef/hardware/simd/x86_amd/versions.h index a0a9e918bb..1f9e96c500 100644 --- a/3rdparty/boost/boost/predef/hardware/simd/x86_amd/versions.h +++ b/3rdparty/boost/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/3rdparty/boost/boost/predef/os/cygwin.h b/3rdparty/boost/boost/predef/os/cygwin.h index 1985c97edc..9d36f0f317 100644 --- a/3rdparty/boost/boost/predef/os/cygwin.h +++ b/3rdparty/boost/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/3rdparty/boost/boost/predef/version.h b/3rdparty/boost/boost/predef/version.h index 2fcdefa694..8745c94976 100644 --- a/3rdparty/boost/boost/predef/version.h +++ b/3rdparty/boost/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/3rdparty/boost/boost/preprocessor/config/config.hpp b/3rdparty/boost/boost/preprocessor/config/config.hpp index 835b283b7e..8be0e47545 100644 --- a/3rdparty/boost/boost/preprocessor/config/config.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/range/const_iterator.hpp b/3rdparty/boost/boost/range/const_iterator.hpp index 3413e59195..727fdad058 100644 --- a/3rdparty/boost/boost/range/const_iterator.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/regex/config.hpp b/3rdparty/boost/boost/regex/config.hpp index 4fd1fd94a8..9dc48dc8ab 100644 --- a/3rdparty/boost/boost/regex/config.hpp +++ b/3rdparty/boost/boost/regex/config.hpp @@ -149,7 +149,7 @@ /* disable our own file-iterators and mapfiles if we can't * support them: */ #if defined(_WIN32) -# if defined(BOOST_REGEX_NO_W32) || BOOST_PLAT_WINDOWS_STORE +# if defined(BOOST_REGEX_NO_W32) || BOOST_PLAT_WINDOWS_RUNTIME # define BOOST_REGEX_NO_FILEITER # endif #else // defined(_WIN32) diff --git a/3rdparty/boost/boost/regex/icu.hpp b/3rdparty/boost/boost/regex/icu.hpp index a70aa0da81..a57fe57791 100644 --- a/3rdparty/boost/boost/regex/icu.hpp +++ b/3rdparty/boost/boost/regex/icu.hpp @@ -152,7 +152,7 @@ public: char_class_type lookup_classname(const char_type* p1, const char_type* p2) const; string_type lookup_collatename(const char_type* p1, const char_type* p2) const; bool isctype(char_type c, char_class_type f) const; - int toi(const char_type*& p1, const char_type* p2, int radix)const + boost::intmax_t toi(const char_type*& p1, const char_type* p2, int radix)const { return BOOST_REGEX_DETAIL_NS::global_toi(p1, p2, radix, *this); } @@ -403,6 +403,22 @@ void copy_results(MR1& out, MR2 const& in) out.set_second(in[i].second.base(), i, in[i].matched); } } +#ifdef BOOST_REGEX_MATCH_EXTRA + // Copy full capture info as well: + for(int i = 0; i < (int)in.size(); ++i) + { + if(in[i].captures().size()) + { + out[i].get_captures().assign(in[i].captures().size(), typename MR1::value_type()); + for(int j = 0; j < out[i].captures().size(); ++j) + { + out[i].get_captures()[j].first = in[i].captures()[j].first.base(); + out[i].get_captures()[j].second = in[i].captures()[j].second.base(); + out[i].get_captures()[j].matched = in[i].captures()[j].matched; + } + } + } +#endif } template diff --git a/3rdparty/boost/boost/regex/v4/basic_regex_parser.hpp b/3rdparty/boost/boost/regex/v4/basic_regex_parser.hpp index 4a80ab9c32..0071a8ce8e 100644 --- a/3rdparty/boost/boost/regex/v4/basic_regex_parser.hpp +++ b/3rdparty/boost/boost/regex/v4/basic_regex_parser.hpp @@ -38,6 +38,21 @@ namespace BOOST_REGEX_DETAIL_NS{ #pragma warning(disable:4244 4800) #endif +inline boost::intmax_t umax(mpl::false_ const&) +{ + // Get out clause here, just in case numeric_limits is unspecialized: + return std::numeric_limits::is_specialized ? (std::numeric_limits::max)() : INT_MAX; +} +inline boost::intmax_t umax(mpl::true_ const&) +{ + return (std::numeric_limits::max)(); +} + +inline boost::intmax_t umax() +{ + return umax(mpl::bool_::digits >= std::numeric_limits::digits>()); +} + template class basic_regex_parser : public basic_regex_creator { @@ -528,7 +543,11 @@ bool basic_regex_parser::parse_open_paren() template bool basic_regex_parser::parse_basic_escape() { - ++m_position; + if(++m_position == m_end) + { + fail(regex_constants::error_paren, m_position - m_base); + return false; + } bool result = true; switch(this->m_traits.escape_syntax_type(*m_position)) { @@ -868,7 +887,7 @@ escape_type_class_jump: return false; } const charT* pc = m_position; - int i = this->m_traits.toi(pc, m_end, 10); + boost::intmax_t i = this->m_traits.toi(pc, m_end, 10); if((i < 0) && syn_end) { // Check for a named capture, get the leftmost one if there is more than one: @@ -1075,7 +1094,7 @@ bool basic_regex_parser::parse_repeat_range(bool isbasic) // parse a repeat-range: // std::size_t min, max; - int v; + boost::intmax_t v; // skip whitespace: while((m_position != m_end) && this->m_traits.isctype(*m_position, this->m_mask_space)) ++m_position; @@ -1094,7 +1113,7 @@ bool basic_regex_parser::parse_repeat_range(bool isbasic) // get min: v = this->m_traits.toi(m_position, m_end, 10); // skip whitespace: - if(v < 0) + if((v < 0) || (v > umax())) { if(this->flags() & (regbase::main_option_type | regbase::no_perl_ex)) { @@ -1120,7 +1139,7 @@ bool basic_regex_parser::parse_repeat_range(bool isbasic) while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_brace) --m_position; return parse_literal(); } - min = v; + min = static_cast(v); // see if we have a comma: if(this->m_traits.syntax_type(*m_position) == regex_constants::syntax_comma) { @@ -1143,7 +1162,7 @@ bool basic_regex_parser::parse_repeat_range(bool isbasic) } // get the value if any: v = this->m_traits.toi(m_position, m_end, 10); - max = (v >= 0) ? (std::size_t)v : (std::numeric_limits::max)(); + max = ((v >= 0) && (v < umax())) ? (std::size_t)v : (std::numeric_limits::max)(); } else { @@ -1665,19 +1684,19 @@ digraph basic_regex_parser::get_next_set_literal(basic_cha // does a value fit in the specified charT type? // template -bool valid_value(charT, int v, const mpl::true_&) +bool valid_value(charT, boost::intmax_t v, const mpl::true_&) { return (v >> (sizeof(charT) * CHAR_BIT)) == 0; } template -bool valid_value(charT, int, const mpl::false_&) +bool valid_value(charT, boost::intmax_t, const mpl::false_&) { return true; // v will alsways fit in a charT } template -bool valid_value(charT c, int v) +bool valid_value(charT c, boost::intmax_t v) { - return valid_value(c, v, mpl::bool_<(sizeof(charT) < sizeof(int))>()); + return valid_value(c, v, mpl::bool_<(sizeof(charT) < sizeof(boost::intmax_t))>()); } template @@ -1753,10 +1772,10 @@ charT basic_regex_parser::unescape_character() fail(regex_constants::error_escape, m_position - m_base, "Missing } in hexadecimal escape sequence."); return result; } - int i = this->m_traits.toi(m_position, m_end, 16); + boost::intmax_t i = this->m_traits.toi(m_position, m_end, 16); if((m_position == m_end) || (i < 0) - || ((std::numeric_limits::is_specialized) && (i > (int)(std::numeric_limits::max)())) + || ((std::numeric_limits::is_specialized) && (i > (boost::intmax_t)(std::numeric_limits::max)())) || (this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_brace)) { // Rewind to start of escape: @@ -1771,7 +1790,7 @@ charT basic_regex_parser::unescape_character() else { std::ptrdiff_t len = (std::min)(static_cast(2), static_cast(m_end - m_position)); - int i = this->m_traits.toi(m_position, m_position + len, 16); + boost::intmax_t i = this->m_traits.toi(m_position, m_position + len, 16); if((i < 0) || !valid_value(charT(0), i)) { @@ -1790,7 +1809,7 @@ charT basic_regex_parser::unescape_character() // followed by up to 3 octal digits: std::ptrdiff_t len = (std::min)(::boost::BOOST_REGEX_DETAIL_NS::distance(m_position, m_end), static_cast(4)); const charT* bp = m_position; - int val = this->m_traits.toi(bp, bp + 1, 8); + boost::intmax_t val = this->m_traits.toi(bp, bp + 1, 8); if(val != 0) { // Rewind to start of escape: @@ -1801,7 +1820,7 @@ charT basic_regex_parser::unescape_character() return result; } val = this->m_traits.toi(m_position, m_position + len, 8); - if(val < 0) + if((val < 0) || (val > (boost::intmax_t)(std::numeric_limits::max)())) { // Rewind to start of escape: --m_position; @@ -1874,7 +1893,7 @@ bool basic_regex_parser::parse_backref() { BOOST_ASSERT(m_position != m_end); const charT* pc = m_position; - int i = this->m_traits.toi(pc, pc + 1, 10); + boost::intmax_t i = this->m_traits.toi(pc, pc + 1, 10); if((i == 0) || (((this->flags() & regbase::main_option_type) == regbase::perl_syntax_group) && (this->flags() & regbase::no_bk_refs))) { // not a backref at all but an octal escape sequence: @@ -1996,7 +2015,7 @@ bool basic_regex_parser::parse_perl_extension() int max_mark = m_max_mark; m_mark_reset = -1; m_max_mark = m_mark_count; - int v; + boost::intmax_t v; // // select the actual extension used: // @@ -2650,7 +2669,7 @@ option_group_jump: // // allow backrefs to this mark: // - if((markid > 0) && (markid < (int)(sizeof(unsigned) * CHAR_BIT))) + if(markid < (int)(sizeof(unsigned) * CHAR_BIT)) this->m_backrefs |= 1u << (markid - 1); } return true; diff --git a/3rdparty/boost/boost/regex/v4/cpp_regex_traits.hpp b/3rdparty/boost/boost/regex/v4/cpp_regex_traits.hpp index 709663a385..b7b32d8a5c 100644 --- a/3rdparty/boost/boost/regex/v4/cpp_regex_traits.hpp +++ b/3rdparty/boost/boost/regex/v4/cpp_regex_traits.hpp @@ -1027,11 +1027,11 @@ public: return m_pimpl->isctype(c, f); #endif } - int toi(const charT*& p1, const charT* p2, int radix)const; + boost::intmax_t toi(const charT*& p1, const charT* p2, int radix)const; int value(charT c, int radix)const { const charT* pc = &c; - return toi(pc, pc + 1, radix); + return (int)toi(pc, pc + 1, radix); } locale_type imbue(locale_type l) { @@ -1069,7 +1069,7 @@ private: template -int cpp_regex_traits::toi(const charT*& first, const charT* last, int radix)const +boost::intmax_t cpp_regex_traits::toi(const charT*& first, const charT* last, int radix)const { BOOST_REGEX_DETAIL_NS::parser_buf sbuf; // buffer for parsing numbers. std::basic_istream is(&sbuf); // stream for parsing numbers. @@ -1082,7 +1082,7 @@ int cpp_regex_traits::toi(const charT*& first, const charT* last, int rad if(std::abs(radix) == 16) is >> std::hex; else if(std::abs(radix) == 8) is >> std::oct; else is >> std::dec; - int val; + boost::intmax_t val; if(is >> val) { first = first + ((last - first) - sbuf.in_avail()); diff --git a/3rdparty/boost/boost/regex/v4/fileiter.hpp b/3rdparty/boost/boost/regex/v4/fileiter.hpp index 4873a0a85e..256a7e4606 100644 --- a/3rdparty/boost/boost/regex/v4/fileiter.hpp +++ b/3rdparty/boost/boost/regex/v4/fileiter.hpp @@ -225,11 +225,11 @@ public: mapfile_iterator() { node = 0; file = 0; offset = 0; } mapfile_iterator(const mapfile* f, long arg_position) { + BOOST_ASSERT(f); file = f; node = f->_first + arg_position / mapfile::buf_size; offset = arg_position % mapfile::buf_size; - if(file) - file->lock(node); + file->lock(node); } mapfile_iterator(const mapfile_iterator& i) { diff --git a/3rdparty/boost/boost/regex/v4/instances.hpp b/3rdparty/boost/boost/regex/v4/instances.hpp index f66b237cb9..05ac71a686 100644 --- a/3rdparty/boost/boost/regex/v4/instances.hpp +++ b/3rdparty/boost/boost/regex/v4/instances.hpp @@ -157,7 +157,7 @@ bool cpp_regex_traits_implementation::isctype(const BOOST_RE #endif } // namespace template BOOST_REGEX_DECL -int cpp_regex_traits::toi(const BOOST_REGEX_CHAR_T*& first, const BOOST_REGEX_CHAR_T* last, int radix)const; +boost::intmax_t cpp_regex_traits::toi(const BOOST_REGEX_CHAR_T*& first, const BOOST_REGEX_CHAR_T* last, int radix)const; template BOOST_REGEX_DECL std::string cpp_regex_traits::catalog_name(const std::string& name); template BOOST_REGEX_DECL diff --git a/3rdparty/boost/boost/regex/v4/match_flags.hpp b/3rdparty/boost/boost/regex/v4/match_flags.hpp index e21de6cf6a..1c0046b75f 100644 --- a/3rdparty/boost/boost/regex/v4/match_flags.hpp +++ b/3rdparty/boost/boost/regex/v4/match_flags.hpp @@ -22,6 +22,7 @@ #ifdef __cplusplus # include #endif +#include #ifdef __cplusplus namespace boost{ @@ -71,7 +72,7 @@ typedef enum _match_flags } match_flags; -#if defined(__BORLANDC__) +#if defined(__BORLANDC__) || BOOST_WORKAROUND(BOOST_MSVC, <= 1310) typedef unsigned long match_flag_type; #else typedef match_flags match_flag_type; diff --git a/3rdparty/boost/boost/regex/v4/mem_block_cache.hpp b/3rdparty/boost/boost/regex/v4/mem_block_cache.hpp index dc54915062..50af421ea2 100644 --- a/3rdparty/boost/boost/regex/v4/mem_block_cache.hpp +++ b/3rdparty/boost/boost/regex/v4/mem_block_cache.hpp @@ -27,9 +27,54 @@ # include BOOST_ABI_PREFIX #endif +#ifndef BOOST_NO_CXX11_HDR_ATOMIC + #include + #if ATOMIC_POINTER_LOCK_FREE == 2 + #define BOOST_REGEX_MEM_BLOCK_CACHE_LOCK_FREE + #define BOOST_REGEX_ATOMIC_POINTER std::atomic + #endif +#endif + namespace boost{ namespace BOOST_REGEX_DETAIL_NS{ +#ifdef BOOST_REGEX_MEM_BLOCK_CACHE_LOCK_FREE /* lock free implementation */ +struct mem_block_cache +{ + std::atomic cache[BOOST_REGEX_MAX_CACHE_BLOCKS]; + + ~mem_block_cache() + { + for (size_t i = 0;i < BOOST_REGEX_MAX_CACHE_BLOCKS; ++i) { + if (cache[i].load()) ::operator delete(cache[i].load()); + } + } + void* get() + { + for (size_t i = 0;i < BOOST_REGEX_MAX_CACHE_BLOCKS; ++i) { + void* p = cache[i].load(); + if (p != NULL) { + if (cache[i].compare_exchange_strong(p, NULL)) return p; + } + } + return ::operator new(BOOST_REGEX_BLOCKSIZE); + } + void put(void* ptr) + { + for (size_t i = 0;i < BOOST_REGEX_MAX_CACHE_BLOCKS; ++i) { + void* p = cache[i].load(); + if (p == NULL) { + if (cache[i].compare_exchange_strong(p, ptr)) return; + } + } + ::operator delete(ptr); + } +}; + + +#else /* lock-based implementation */ + + struct mem_block_node { mem_block_node* next; @@ -85,6 +130,7 @@ struct mem_block_cache } } }; +#endif extern mem_block_cache block_cache; diff --git a/3rdparty/boost/boost/regex/v4/perl_matcher.hpp b/3rdparty/boost/boost/regex/v4/perl_matcher.hpp index a7298fbd7a..96a086b81a 100644 --- a/3rdparty/boost/boost/regex/v4/perl_matcher.hpp +++ b/3rdparty/boost/boost/regex/v4/perl_matcher.hpp @@ -537,6 +537,7 @@ private: bool unwind_recursion_pop(bool); bool unwind_commit(bool); bool unwind_then(bool); + bool unwind_case(bool); void destroy_single_repeat(); void push_matched_paren(int index, const sub_match& sub); void push_recursion_stopper(); @@ -547,6 +548,7 @@ private: void push_non_greedy_repeat(const re_syntax_base* ps); void push_recursion(int idx, const re_syntax_base* p, results_type* presults); void push_recursion_pop(); + void push_case_change(bool); // pointer to base of stack: saved_state* m_stack_base; diff --git a/3rdparty/boost/boost/regex/v4/perl_matcher_common.hpp b/3rdparty/boost/boost/regex/v4/perl_matcher_common.hpp index f3949ccf93..6febff4cc5 100644 --- a/3rdparty/boost/boost/regex/v4/perl_matcher_common.hpp +++ b/3rdparty/boost/boost/regex/v4/perl_matcher_common.hpp @@ -206,7 +206,7 @@ bool perl_matcher::match_imp() search_base = base; state_count = 0; m_match_flags |= regex_constants::match_all; - m_presult->set_size((m_match_flags & match_nosubs) ? 1 : 1 + re.mark_count(), search_base, last); + m_presult->set_size((m_match_flags & match_nosubs) ? 1u : static_cast(1u + re.mark_count()), search_base, last); m_presult->set_base(base); m_presult->set_named_subs(this->re.get_named_subs()); if(m_match_flags & match_posix) @@ -268,7 +268,7 @@ bool perl_matcher::find_imp() // reset our state machine: search_base = position = base; pstate = re.get_first_state(); - m_presult->set_size((m_match_flags & match_nosubs) ? 1 : 1 + re.mark_count(), base, last); + m_presult->set_size((m_match_flags & match_nosubs) ? 1u : static_cast(1u + re.mark_count()), base, last); m_presult->set_base(base); m_presult->set_named_subs(this->re.get_named_subs()); m_match_flags |= regex_constants::match_init; @@ -287,13 +287,13 @@ bool perl_matcher::find_imp() ++position; } // reset $` start: - m_presult->set_size((m_match_flags & match_nosubs) ? 1 : 1 + re.mark_count(), search_base, last); + m_presult->set_size((m_match_flags & match_nosubs) ? 1u : static_cast(1u + re.mark_count()), search_base, last); //if((base != search_base) && (base == backstop)) // m_match_flags |= match_prev_avail; } if(m_match_flags & match_posix) { - m_result.set_size(1 + re.mark_count(), base, last); + m_result.set_size(static_cast(1u + re.mark_count()), base, last); m_result.set_base(base); } @@ -793,15 +793,6 @@ inline bool perl_matcher::match_assert_backref( return result; } -template -bool perl_matcher::match_toggle_case() -{ - // change our case sensitivity: - this->icase = static_cast(pstate)->icase; - pstate = pstate->next.p; - return true; -} - template bool perl_matcher::match_fail() { diff --git a/3rdparty/boost/boost/regex/v4/perl_matcher_non_recursive.hpp b/3rdparty/boost/boost/regex/v4/perl_matcher_non_recursive.hpp index bf77eaa57b..aa7af3b42f 100644 --- a/3rdparty/boost/boost/regex/v4/perl_matcher_non_recursive.hpp +++ b/3rdparty/boost/boost/regex/v4/perl_matcher_non_recursive.hpp @@ -138,6 +138,12 @@ struct saved_recursion : public saved_state Results results; }; +struct saved_change_case : public saved_state +{ + bool icase; + saved_change_case(bool c) : saved_state(18), icase(c) {} +}; + template bool perl_matcher::match_all_states() { @@ -242,6 +248,22 @@ inline void perl_matcher::push_matched_paren(in m_backup_state = pmp; } +template +inline void perl_matcher::push_case_change(bool c) +{ + //BOOST_ASSERT(index); + saved_change_case* pmp = static_cast(m_backup_state); + --pmp; + if(pmp < m_stack_base) + { + extend_stack(); + pmp = static_cast(m_backup_state); + --pmp; + } + (void) new (pmp)saved_change_case(c); + m_backup_state = pmp; +} + template inline void perl_matcher::push_recursion_stopper() { @@ -347,6 +369,16 @@ inline void perl_matcher::push_recursion(int id m_backup_state = pmp; } +template +bool perl_matcher::match_toggle_case() +{ + // change our case sensitivity: + push_case_change(this->icase); + this->icase = static_cast(pstate)->icase; + pstate = pstate->next.p; + return true; +} + template bool perl_matcher::match_startmark() { @@ -1142,6 +1174,7 @@ bool perl_matcher::unwind(bool have_match) &perl_matcher::unwind_recursion_pop, &perl_matcher::unwind_commit, &perl_matcher::unwind_then, + &perl_matcher::unwind_case, }; m_recursive_result = have_match; @@ -1170,6 +1203,16 @@ bool perl_matcher::unwind_end(bool) return false; // end of stack nothing more to search } +template +bool perl_matcher::unwind_case(bool) +{ + saved_change_case* pmp = static_cast(m_backup_state); + icase = pmp->icase; + boost::BOOST_REGEX_DETAIL_NS::inplace_destroy(pmp++); + m_backup_state = pmp; + return true; +} + template bool perl_matcher::unwind_paren(bool have_match) { diff --git a/3rdparty/boost/boost/regex/v4/perl_matcher_recursive.hpp b/3rdparty/boost/boost/regex/v4/perl_matcher_recursive.hpp index 3893837df3..33b9158193 100644 --- a/3rdparty/boost/boost/regex/v4/perl_matcher_recursive.hpp +++ b/3rdparty/boost/boost/regex/v4/perl_matcher_recursive.hpp @@ -289,11 +289,13 @@ bool perl_matcher::match_alt() BidiIterator oldposition(position); const re_syntax_base* old_pstate = jmp->alt.p; pstate = pstate->next.p; + bool oldcase = icase; m_have_then = false; if(!match_all_states()) { pstate = old_pstate; position = oldposition; + icase = oldcase; if(m_have_then) { m_can_backtrack = true; @@ -1036,6 +1038,20 @@ bool perl_matcher::match_then() return false; } +template +bool perl_matcher::match_toggle_case() +{ + // change our case sensitivity: + bool oldcase = this->icase; + this->icase = static_cast(pstate)->icase; + pstate = pstate->next.p; + bool result = match_all_states(); + this->icase = oldcase; + return result; +} + + + template bool perl_matcher::skip_until_paren(int index, bool have_match) { diff --git a/3rdparty/boost/boost/regex/v4/regex_format.hpp b/3rdparty/boost/boost/regex/v4/regex_format.hpp index e9006a7bd2..f0a0a11e40 100644 --- a/3rdparty/boost/boost/regex/v4/regex_format.hpp +++ b/3rdparty/boost/boost/regex/v4/regex_format.hpp @@ -86,7 +86,7 @@ struct trivial_format_traits } int toi(const charT*& p1, const charT* p2, int radix)const { - return global_toi(p1, p2, radix, *this); + return (int)global_toi(p1, p2, radix, *this); } }; @@ -165,7 +165,7 @@ private: std::vector v(i, j); const char_type* start = &v[0]; const char_type* pos = start; - int r = m_traits.toi(pos, &v[0] + v.size(), base); + int r = (int)m_traits.toi(pos, &v[0] + v.size(), base); std::advance(i, pos - start); return r; } diff --git a/3rdparty/boost/boost/regex/v4/regex_traits.hpp b/3rdparty/boost/boost/regex/v4/regex_traits.hpp index 45a4bdf626..5d42770654 100644 --- a/3rdparty/boost/boost/regex/v4/regex_traits.hpp +++ b/3rdparty/boost/boost/regex/v4/regex_traits.hpp @@ -109,7 +109,7 @@ struct default_wrapper : public BaseT { return ((c & 0x7f) == c) ? get_default_escape_syntax_type(static_cast(c)) : ::boost::regex_constants::escape_type_identity; } - int toi(const char_type*& p1, const char_type* p2, int radix)const + boost::intmax_t toi(const char_type*& p1, const char_type* p2, int radix)const { return ::boost::BOOST_REGEX_DETAIL_NS::global_toi(p1, p2, radix, *this); } diff --git a/3rdparty/boost/boost/regex/v4/regex_traits_defaults.hpp b/3rdparty/boost/boost/regex/v4/regex_traits_defaults.hpp index 1821883717..2a2cf21d37 100644 --- a/3rdparty/boost/boost/regex/v4/regex_traits_defaults.hpp +++ b/3rdparty/boost/boost/regex/v4/regex_traits_defaults.hpp @@ -304,13 +304,13 @@ int global_value(charT c) return -1; } template -int global_toi(const charT*& p1, const charT* p2, int radix, const traits& t) +boost::intmax_t global_toi(const charT*& p1, const charT* p2, int radix, const traits& t) { (void)t; // warning suppression - int next_value = t.value(*p1, radix); + boost::intmax_t next_value = t.value(*p1, radix); if((p1 == p2) || (next_value < 0) || (next_value >= radix)) return -1; - int result = 0; + boost::intmax_t result = 0; while(p1 != p2) { next_value = t.value(*p1, radix); diff --git a/3rdparty/boost/boost/regex/v4/w32_regex_traits.hpp b/3rdparty/boost/boost/regex/v4/w32_regex_traits.hpp index 560cc217bb..bf996d6119 100644 --- a/3rdparty/boost/boost/regex/v4/w32_regex_traits.hpp +++ b/3rdparty/boost/boost/regex/v4/w32_regex_traits.hpp @@ -640,13 +640,13 @@ public: return true; return false; } - int toi(const charT*& p1, const charT* p2, int radix)const + boost::intmax_t toi(const charT*& p1, const charT* p2, int radix)const { return ::boost::BOOST_REGEX_DETAIL_NS::global_toi(p1, p2, radix, *this); } int value(charT c, int radix)const { - int result = ::boost::BOOST_REGEX_DETAIL_NS::global_value(c); + int result = (int)::boost::BOOST_REGEX_DETAIL_NS::global_value(c); return result < radix ? result : -1; } locale_type imbue(locale_type l) diff --git a/3rdparty/boost/boost/smart_ptr/intrusive_ptr.hpp b/3rdparty/boost/boost/smart_ptr/intrusive_ptr.hpp index e5db609976..1e9339732b 100644 --- a/3rdparty/boost/boost/smart_ptr/intrusive_ptr.hpp +++ b/3rdparty/boost/boost/smart_ptr/intrusive_ptr.hpp @@ -59,7 +59,7 @@ public: typedef T element_type; - intrusive_ptr() BOOST_NOEXCEPT : px( 0 ) + BOOST_CONSTEXPR intrusive_ptr() BOOST_NOEXCEPT : px( 0 ) { } @@ -122,6 +122,30 @@ public: return *this; } + template friend class intrusive_ptr; + + template +#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) + + intrusive_ptr(intrusive_ptr && rhs, typename boost::detail::sp_enable_if_convertible::type = boost::detail::sp_empty()) + +#else + + intrusive_ptr(intrusive_ptr && rhs) + +#endif + : px( rhs.px ) + { + rhs.px = 0; + } + + template + intrusive_ptr & operator=(intrusive_ptr && rhs) BOOST_NOEXCEPT + { + this_type( static_cast< intrusive_ptr && >( rhs ) ).swap(*this); + return *this; + } + #endif intrusive_ptr & operator=(intrusive_ptr const & rhs) diff --git a/3rdparty/boost/boost/smart_ptr/shared_ptr.hpp b/3rdparty/boost/boost/smart_ptr/shared_ptr.hpp index 47bc33d517..77f68bebd0 100644 --- a/3rdparty/boost/boost/smart_ptr/shared_ptr.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/type_index.hpp b/3rdparty/boost/boost/type_index.hpp index dce89d81d6..0310e2027b 100644 --- a/3rdparty/boost/boost/type_index.hpp +++ b/3rdparty/boost/boost/type_index.hpp @@ -234,7 +234,7 @@ inline type_index type_id_with_cvr() BOOST_NOEXCEPT { /// Function that works exactly like C++ typeid(rtti_val) call, but returns boost::type_index. /// -/// Retunrs runtime information about specified type. +/// Returns runtime information about specified type. /// /// \b Requirements: RTTI available or Base and Derived classes must be marked with BOOST_TYPE_INDEX_REGISTER_CLASS. /// @@ -249,7 +249,7 @@ inline type_index type_id_with_cvr() BOOST_NOEXCEPT { /// std::cout << ti.pretty_name(); // Outputs 'Derived' /// \endcode /// -/// \param runtime_val Varaible which runtime type must be returned. +/// \param runtime_val Variable which runtime type must be returned. /// \throw Nothing. /// \return boost::typeindex::type_index with information about the specified variable. template diff --git a/3rdparty/boost/boost/type_index/ctti_type_index.hpp b/3rdparty/boost/boost/type_index/ctti_type_index.hpp index ac1e5d290d..611ad92e11 100644 --- a/3rdparty/boost/boost/type_index/ctti_type_index.hpp +++ b/3rdparty/boost/boost/type_index/ctti_type_index.hpp @@ -1,5 +1,5 @@ // -// Copyright (c) Antony Polukhin, 2013-2014. +// Copyright (c) Antony Polukhin, 2013-2016. // // // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -10,9 +10,9 @@ #define BOOST_TYPE_INDEX_CTTI_TYPE_INDEX_HPP /// \file ctti_type_index.hpp -/// \brief Contains boost::typeindex::ctti_type_index class. +/// \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 +/// 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 @@ -89,37 +89,52 @@ inline const detail::ctti_data& ctti_construct() BOOST_NOEXCEPT { } /// \class ctti_type_index -/// This class is a wrapper that pretends to work exactly like stl_type_index, but does +/// 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 produces slightly longer type names, so consider using stl_type_index +/// 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 detail::ctti_data* data_; + 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; - inline ctti_type_index() BOOST_NOEXCEPT - : data_(&ctti_construct()) + 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_(&data) + : data_(reinterpret_cast(&data)) {} - inline const type_info_t& type_info() const BOOST_NOEXCEPT; - inline const char* raw_name() const BOOST_NOEXCEPT; + 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 - inline static ctti_type_index type_id() BOOST_NOEXCEPT; + BOOST_CXX14_CONSTEXPR inline static ctti_type_index type_id() BOOST_NOEXCEPT; template - inline static ctti_type_index type_id_with_cvr() BOOST_NOEXCEPT; + 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; @@ -127,22 +142,35 @@ public: inline const ctti_type_index::type_info_t& ctti_type_index::type_info() const BOOST_NOEXCEPT { - return *data_; + 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 -inline ctti_type_index ctti_type_index::type_id() BOOST_NOEXCEPT { +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_construct(); + return ctti_type_index(boost::detail::ctti::n()); } template -inline ctti_type_index ctti_type_index::type_id_with_cvr() BOOST_NOEXCEPT { - return ctti_construct(); +BOOST_CXX14_CONSTEXPR inline ctti_type_index ctti_type_index::type_id_with_cvr() BOOST_NOEXCEPT { + return ctti_type_index(boost::detail::ctti::n()); } @@ -152,8 +180,13 @@ inline ctti_type_index ctti_type_index::type_id_runtime(const T& variable) BOOST } -inline const char* ctti_type_index::raw_name() const BOOST_NOEXCEPT { - return reinterpret_cast(data_); +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 { diff --git a/3rdparty/boost/boost/type_index/detail/compile_time_type_info.hpp b/3rdparty/boost/boost/type_index/detail/compile_time_type_info.hpp index 635b45d67c..122a2ac013 100644 --- a/3rdparty/boost/boost/type_index/detail/compile_time_type_info.hpp +++ b/3rdparty/boost/boost/type_index/detail/compile_time_type_info.hpp @@ -1,5 +1,5 @@ // -// Copyright (c) Antony Polukhin, 2012-2014. +// Copyright (c) Antony Polukhin, 2012-2016. // // // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -16,7 +16,6 @@ #include #include #include -#include #ifdef BOOST_HAS_PRAGMA_ONCE # pragma once @@ -30,19 +29,21 @@ 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) +#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. @@ -54,11 +55,14 @@ // 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__ == 3 && __clang_minor__ > 0 +#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__) +#elif defined(__GNUC__) && !defined(BOOST_NO_CXX14_CONSTEXPR) + // sizeof("static contexpr char boost::detail::ctti::s() [with long unsigned int I = 0ul; T = ") - 1, sizeof("]") - 1 + BOOST_TYPE_INDEX_REGISTER_CTTI_PARSING_PARAMS(87, 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 @@ -70,7 +74,7 @@ namespace boost { namespace typeindex { namespace detail { template - inline void assert_compile_time_legths() BOOST_NOEXCEPT { + BOOST_CXX14_CONSTEXPR inline void assert_compile_time_legths() BOOST_NOEXCEPT { BOOST_STATIC_ASSERT_MSG( Condition, "TypeIndex library is misconfigured for your compiler. " @@ -78,15 +82,63 @@ namespace boost { namespace typeindex { namespace detail { "'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 - inline const char* skip_begining_runtime(const char* begin, boost::mpl::false_) BOOST_NOEXCEPT { + 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 - inline const char* skip_begining_runtime(const char* begin, boost::mpl::true_) BOOST_NOEXCEPT { - const char* const it = std::search( + 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 ); @@ -94,13 +146,54 @@ namespace boost { namespace typeindex { namespace detail { } template - inline const char* skip_begining(const char* begin) BOOST_NOEXCEPT { + 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 std::size_t size_ = sizeof...(C); + static constexpr char data_[size_] = { C... }; + }; + + template + constexpr char cstring::data_[]; +#endif + }}} // namespace boost::typeindex::detail namespace boost { namespace detail { @@ -110,11 +203,68 @@ namespace boost { namespace detail { /// 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 std::size_t 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 std::size_t size = sizeof(BOOST_TYPE_INDEX_FUNCTION_SIGNATURE); + #elif defined(__FUNCSIG__) + constexpr std::size_t 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 std::size_t 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 - static const char* n() BOOST_NOEXCEPT { + 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); + 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__) \ @@ -124,18 +274,13 @@ struct ctti { || (defined(__ICC) && (__ICC >= 600)) \ || defined(__ghs__) \ || defined(__DMC__) - return boost::typeindex::detail::skip_begining< sizeof(__PRETTY_FUNCTION__) >(__PRETTY_FUNCTION__); #else - 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." - ); + boost::typeindex::detail::failed_to_get_function_name(); + return ""; #endif } +#endif }; }} // namespace boost::detail diff --git a/3rdparty/boost/boost/type_index/stl_type_index.hpp b/3rdparty/boost/boost/type_index/stl_type_index.hpp index c801e70f62..a5add88716 100644 --- a/3rdparty/boost/boost/type_index/stl_type_index.hpp +++ b/3rdparty/boost/boost/type_index/stl_type_index.hpp @@ -1,5 +1,5 @@ // -// Copyright (c) Antony Polukhin, 2013-2014. +// Copyright (c) Antony Polukhin, 2013-2015. // // // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -200,7 +200,7 @@ inline bool stl_type_index::equal(const stl_type_index& rhs) const BOOST_NOEXCEP #ifdef BOOST_CLASSINFO_COMPARE_BY_NAMES return raw_name() == rhs.raw_name() || !std::strcmp(raw_name(), rhs.raw_name()); #else - return *data_ == *rhs.data_; + return !!(*data_ == *rhs.data_); #endif } diff --git a/3rdparty/boost/boost/type_index/type_index_facade.hpp b/3rdparty/boost/boost/type_index/type_index_facade.hpp index 931dedca25..dd35df2caa 100644 --- a/3rdparty/boost/boost/type_index/type_index_facade.hpp +++ b/3rdparty/boost/boost/type_index/type_index_facade.hpp @@ -66,7 +66,7 @@ template class type_index_facade { private: /// @cond - const Derived & derived() const BOOST_NOEXCEPT { + BOOST_CXX14_CONSTEXPR const Derived & derived() const BOOST_NOEXCEPT { return *static_cast(this); } /// @endcond @@ -154,34 +154,34 @@ protected: /// @cond template -inline bool operator == (const type_index_facade& lhs, const type_index_facade& rhs) BOOST_NOEXCEPT { +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 -inline bool operator < (const type_index_facade& lhs, const type_index_facade& rhs) BOOST_NOEXCEPT { - return static_cast(lhs).before(static_cast(rhs));; +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 -inline bool operator > (const type_index_facade& lhs, const type_index_facade& rhs) BOOST_NOEXCEPT { +BOOST_CXX14_CONSTEXPR inline bool operator > (const type_index_facade& lhs, const type_index_facade& rhs) BOOST_NOEXCEPT { return rhs < lhs; } template -inline bool operator <= (const type_index_facade& lhs, const type_index_facade& rhs) BOOST_NOEXCEPT { +BOOST_CXX14_CONSTEXPR inline bool operator <= (const type_index_facade& lhs, const type_index_facade& rhs) BOOST_NOEXCEPT { return !(lhs > rhs); } template -inline bool operator >= (const type_index_facade& lhs, const type_index_facade& rhs) BOOST_NOEXCEPT { +BOOST_CXX14_CONSTEXPR inline bool operator >= (const type_index_facade& lhs, const type_index_facade& rhs) BOOST_NOEXCEPT { return !(lhs < rhs); } template -inline bool operator != (const type_index_facade& lhs, const type_index_facade& rhs) BOOST_NOEXCEPT { +BOOST_CXX14_CONSTEXPR inline bool operator != (const type_index_facade& lhs, const type_index_facade& rhs) BOOST_NOEXCEPT { return !(lhs == rhs); } diff --git a/3rdparty/boost/boost/type_traits.hpp b/3rdparty/boost/boost/type_traits.hpp index 57680f89f6..7d651ce28d 100644 --- a/3rdparty/boost/boost/type_traits.hpp +++ b/3rdparty/boost/boost/type_traits.hpp @@ -10,141 +10,141 @@ #ifndef BOOST_TYPE_TRAITS_HPP #define BOOST_TYPE_TRAITS_HPP -#include "boost/type_traits/add_const.hpp" -#include "boost/type_traits/add_cv.hpp" -#include "boost/type_traits/add_lvalue_reference.hpp" -#include "boost/type_traits/add_pointer.hpp" -#include "boost/type_traits/add_reference.hpp" -#include "boost/type_traits/add_rvalue_reference.hpp" -#include "boost/type_traits/add_volatile.hpp" -#include "boost/type_traits/aligned_storage.hpp" -#include "boost/type_traits/alignment_of.hpp" -#include "boost/type_traits/common_type.hpp" -#include "boost/type_traits/conditional.hpp" -#include "boost/type_traits/copy_cv.hpp" -#include "boost/type_traits/decay.hpp" -#include "boost/type_traits/declval.hpp" -#include "boost/type_traits/extent.hpp" -#include "boost/type_traits/floating_point_promotion.hpp" -#include "boost/type_traits/function_traits.hpp" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include "boost/type_traits/has_bit_and.hpp" -#include "boost/type_traits/has_bit_and_assign.hpp" -#include "boost/type_traits/has_bit_or.hpp" -#include "boost/type_traits/has_bit_or_assign.hpp" -#include "boost/type_traits/has_bit_xor.hpp" -#include "boost/type_traits/has_bit_xor_assign.hpp" -#include "boost/type_traits/has_complement.hpp" -#include "boost/type_traits/has_dereference.hpp" -#include "boost/type_traits/has_divides.hpp" -#include "boost/type_traits/has_divides_assign.hpp" -#include "boost/type_traits/has_equal_to.hpp" -#include "boost/type_traits/has_greater.hpp" -#include "boost/type_traits/has_greater_equal.hpp" -#include "boost/type_traits/has_left_shift.hpp" -#include "boost/type_traits/has_left_shift_assign.hpp" -#include "boost/type_traits/has_less.hpp" -#include "boost/type_traits/has_less_equal.hpp" -#include "boost/type_traits/has_logical_and.hpp" -#include "boost/type_traits/has_logical_not.hpp" -#include "boost/type_traits/has_logical_or.hpp" -#include "boost/type_traits/has_minus.hpp" -#include "boost/type_traits/has_minus_assign.hpp" -#include "boost/type_traits/has_modulus.hpp" -#include "boost/type_traits/has_modulus_assign.hpp" -#include "boost/type_traits/has_multiplies.hpp" -#include "boost/type_traits/has_multiplies_assign.hpp" -#include "boost/type_traits/has_negate.hpp" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #if !defined(__BORLANDC__) && !defined(__CUDACC__) -#include "boost/type_traits/has_new_operator.hpp" +#include #endif -#include "boost/type_traits/has_not_equal_to.hpp" -#include "boost/type_traits/has_nothrow_assign.hpp" -#include "boost/type_traits/has_nothrow_constructor.hpp" -#include "boost/type_traits/has_nothrow_copy.hpp" -#include "boost/type_traits/has_nothrow_destructor.hpp" -#include "boost/type_traits/has_plus.hpp" -#include "boost/type_traits/has_plus_assign.hpp" -#include "boost/type_traits/has_post_decrement.hpp" -#include "boost/type_traits/has_post_increment.hpp" -#include "boost/type_traits/has_pre_decrement.hpp" -#include "boost/type_traits/has_pre_increment.hpp" -#include "boost/type_traits/has_right_shift.hpp" -#include "boost/type_traits/has_right_shift_assign.hpp" -#include "boost/type_traits/has_trivial_assign.hpp" -#include "boost/type_traits/has_trivial_constructor.hpp" -#include "boost/type_traits/has_trivial_copy.hpp" -#include "boost/type_traits/has_trivial_destructor.hpp" -#include "boost/type_traits/has_trivial_move_assign.hpp" -#include "boost/type_traits/has_trivial_move_constructor.hpp" -#include "boost/type_traits/has_unary_minus.hpp" -#include "boost/type_traits/has_unary_plus.hpp" -#include "boost/type_traits/has_virtual_destructor.hpp" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include "boost/type_traits/integral_constant.hpp" +#include -#include "boost/type_traits/is_abstract.hpp" -#include "boost/type_traits/is_arithmetic.hpp" -#include "boost/type_traits/is_array.hpp" -#include "boost/type_traits/is_assignable.hpp" -#include "boost/type_traits/is_base_and_derived.hpp" -#include "boost/type_traits/is_base_of.hpp" -#include "boost/type_traits/is_class.hpp" -#include "boost/type_traits/is_complex.hpp" -#include "boost/type_traits/is_compound.hpp" -#include "boost/type_traits/is_const.hpp" -#include "boost/type_traits/is_constructible.hpp" -#include "boost/type_traits/is_convertible.hpp" -#include "boost/type_traits/is_copy_assignable.hpp" -#include "boost/type_traits/is_copy_constructible.hpp" -#include "boost/type_traits/is_default_constructible.hpp" -#include "boost/type_traits/is_destructible.hpp" -#include "boost/type_traits/is_empty.hpp" -#include "boost/type_traits/is_enum.hpp" -#include "boost/type_traits/is_final.hpp" -#include "boost/type_traits/is_float.hpp" -#include "boost/type_traits/is_floating_point.hpp" -#include "boost/type_traits/is_function.hpp" -#include "boost/type_traits/is_fundamental.hpp" -#include "boost/type_traits/is_integral.hpp" -#include "boost/type_traits/is_lvalue_reference.hpp" -#include "boost/type_traits/is_member_function_pointer.hpp" -#include "boost/type_traits/is_member_object_pointer.hpp" -#include "boost/type_traits/is_member_pointer.hpp" -#include "boost/type_traits/is_nothrow_move_assignable.hpp" -#include "boost/type_traits/is_nothrow_move_constructible.hpp" -#include "boost/type_traits/is_object.hpp" -#include "boost/type_traits/is_pod.hpp" -#include "boost/type_traits/is_pointer.hpp" -#include "boost/type_traits/is_polymorphic.hpp" -#include "boost/type_traits/is_reference.hpp" -#include "boost/type_traits/is_rvalue_reference.hpp" -#include "boost/type_traits/is_same.hpp" -#include "boost/type_traits/is_scalar.hpp" -#include "boost/type_traits/is_signed.hpp" -#include "boost/type_traits/is_stateless.hpp" -#include "boost/type_traits/is_union.hpp" -#include "boost/type_traits/is_unsigned.hpp" -#include "boost/type_traits/is_virtual_base_of.hpp" -#include "boost/type_traits/is_void.hpp" -#include "boost/type_traits/is_volatile.hpp" -#include "boost/type_traits/make_signed.hpp" -#include "boost/type_traits/make_unsigned.hpp" -#include "boost/type_traits/rank.hpp" -#include "boost/type_traits/remove_all_extents.hpp" -#include "boost/type_traits/remove_bounds.hpp" -#include "boost/type_traits/remove_const.hpp" -#include "boost/type_traits/remove_cv.hpp" -#include "boost/type_traits/remove_extent.hpp" -#include "boost/type_traits/remove_pointer.hpp" -#include "boost/type_traits/remove_reference.hpp" -#include "boost/type_traits/remove_volatile.hpp" -#include "boost/type_traits/type_identity.hpp" -#include "boost/type_traits/type_with_alignment.hpp" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #if !(defined(__sgi) && defined(__EDG_VERSION__) && (__EDG_VERSION__ == 238)) -#include "boost/type_traits/integral_promotion.hpp" -#include "boost/type_traits/promote.hpp" +#include +#include #endif #endif // BOOST_TYPE_TRAITS_HPP diff --git a/3rdparty/boost/boost/type_traits/add_reference.hpp b/3rdparty/boost/boost/type_traits/add_reference.hpp index 526f259c87..3c914154ee 100644 --- a/3rdparty/boost/boost/type_traits/add_reference.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/type_traits/aligned_storage.hpp b/3rdparty/boost/boost/type_traits/aligned_storage.hpp index 09f0c6b885..171f5d450b 100644 --- a/3rdparty/boost/boost/type_traits/aligned_storage.hpp +++ b/3rdparty/boost/boost/type_traits/aligned_storage.hpp @@ -15,12 +15,12 @@ #include // for std::size_t -#include "boost/config.hpp" -#include "boost/detail/workaround.hpp" -#include "boost/type_traits/alignment_of.hpp" -#include "boost/type_traits/type_with_alignment.hpp" -#include "boost/type_traits/is_pod.hpp" -#include "boost/type_traits/conditional.hpp" +#include +#include +#include +#include +#include +#include namespace boost { diff --git a/3rdparty/boost/boost/type_traits/common_type.hpp b/3rdparty/boost/boost/type_traits/common_type.hpp index 5c4303b9ec..c887a897f8 100644 --- a/3rdparty/boost/boost/type_traits/common_type.hpp +++ b/3rdparty/boost/boost/type_traits/common_type.hpp @@ -12,6 +12,7 @@ #include #include #include +#include #if defined(BOOST_NO_CXX11_DECLTYPE) #include diff --git a/3rdparty/boost/boost/type_traits/detail/common_arithmetic_type.hpp b/3rdparty/boost/boost/type_traits/detail/common_arithmetic_type.hpp index 7211002218..8c091583c5 100644 --- a/3rdparty/boost/boost/type_traits/detail/common_arithmetic_type.hpp +++ b/3rdparty/boost/boost/type_traits/detail/common_arithmetic_type.hpp @@ -35,12 +35,16 @@ template<> struct arithmetic_type<2> typedef char (&result_type) [2]; }; +#ifndef BOOST_NO_INTRINSIC_WCHAR_T + template<> struct arithmetic_type<3> { typedef wchar_t type; typedef char (&result_type) [3]; }; +#endif + // There are five standard signed integer types: // “signed char”, “short int”, “int”, “long int”, and “long long int”. @@ -170,7 +174,9 @@ private: static arithmetic_type<1>::result_type select( arithmetic_type<1>::type ); static arithmetic_type<2>::result_type select( arithmetic_type<2>::type ); +#ifndef BOOST_NO_INTRINSIC_WCHAR_T static arithmetic_type<3>::result_type select( arithmetic_type<3>::type ); +#endif static arithmetic_type<4>::result_type select( arithmetic_type<4>::type ); static arithmetic_type<5>::result_type select( arithmetic_type<5>::type ); static arithmetic_type<6>::result_type select( arithmetic_type<6>::type ); diff --git a/3rdparty/boost/boost/type_traits/detail/mp_defer.hpp b/3rdparty/boost/boost/type_traits/detail/mp_defer.hpp index 7910e545e1..f3beeb21bb 100644 --- a/3rdparty/boost/boost/type_traits/detail/mp_defer.hpp +++ b/3rdparty/boost/boost/type_traits/detail/mp_defer.hpp @@ -25,12 +25,12 @@ template class F, class... T> struct mp_valid_impl { template class G, class = G> - static boost::true_type check(int); + static boost::true_type check_s(int); template class> - static boost::false_type check(...); + static boost::false_type check_s(...); - using type = decltype(check(0)); + using type = decltype(check_s(0)); }; template class F, class... T> diff --git a/3rdparty/boost/boost/type_traits/extent.hpp b/3rdparty/boost/boost/type_traits/extent.hpp index dfb3c54ee8..124257878b 100644 --- a/3rdparty/boost/boost/type_traits/extent.hpp +++ b/3rdparty/boost/boost/type_traits/extent.hpp @@ -10,6 +10,7 @@ #ifndef BOOST_TT_EXTENT_HPP_INCLUDED #define BOOST_TT_EXTENT_HPP_INCLUDED +#include // size_t #include #include diff --git a/3rdparty/boost/boost/type_traits/has_nothrow_assign.hpp b/3rdparty/boost/boost/type_traits/has_nothrow_assign.hpp index a7312a19e9..7517fa804b 100644 --- a/3rdparty/boost/boost/type_traits/has_nothrow_assign.hpp +++ b/3rdparty/boost/boost/type_traits/has_nothrow_assign.hpp @@ -9,6 +9,7 @@ #ifndef BOOST_TT_HAS_NOTHROW_ASSIGN_HPP_INCLUDED #define BOOST_TT_HAS_NOTHROW_ASSIGN_HPP_INCLUDED +#include // size_t #include #include @@ -24,7 +25,7 @@ #include #endif #endif -#if defined(__GNUC__) || defined(__SUNPRO_CC) +#if defined(__GNUC__) || defined(__SUNPRO_CC) || defined(__clang__) #include #include #include diff --git a/3rdparty/boost/boost/type_traits/has_nothrow_constructor.hpp b/3rdparty/boost/boost/type_traits/has_nothrow_constructor.hpp index e5af89fe59..fa47b1db3c 100644 --- a/3rdparty/boost/boost/type_traits/has_nothrow_constructor.hpp +++ b/3rdparty/boost/boost/type_traits/has_nothrow_constructor.hpp @@ -9,6 +9,7 @@ #ifndef BOOST_TT_HAS_NOTHROW_CONSTRUCTOR_HPP_INCLUDED #define BOOST_TT_HAS_NOTHROW_CONSTRUCTOR_HPP_INCLUDED +#include // size_t #include #include @@ -17,7 +18,7 @@ #if defined(BOOST_MSVC) || defined(BOOST_INTEL) #include #endif -#if defined(__GNUC__ ) || defined(__SUNPRO_CC) +#if defined(__GNUC__ ) || defined(__SUNPRO_CC) || defined(__clang__) #include #endif diff --git a/3rdparty/boost/boost/type_traits/has_nothrow_destructor.hpp b/3rdparty/boost/boost/type_traits/has_nothrow_destructor.hpp index 273eb9f198..ba70e8910e 100644 --- a/3rdparty/boost/boost/type_traits/has_nothrow_destructor.hpp +++ b/3rdparty/boost/boost/type_traits/has_nothrow_destructor.hpp @@ -11,7 +11,7 @@ #include -#if !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(__SUNPRO_CC) && !defined(BOOST_MSVC) +#if !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(__SUNPRO_CC) && !(defined(BOOST_MSVC) && (_MSC_FULL_VER < 190023506)) #include #include diff --git a/3rdparty/boost/boost/type_traits/has_trivial_assign.hpp b/3rdparty/boost/boost/type_traits/has_trivial_assign.hpp index a5e625d1ae..15b917e716 100644 --- a/3rdparty/boost/boost/type_traits/has_trivial_assign.hpp +++ b/3rdparty/boost/boost/type_traits/has_trivial_assign.hpp @@ -9,11 +9,12 @@ #ifndef BOOST_TT_HAS_TRIVIAL_ASSIGN_HPP_INCLUDED #define BOOST_TT_HAS_TRIVIAL_ASSIGN_HPP_INCLUDED +#include // size_t #include #include #include -#if !defined(BOOST_HAS_TRIVIAL_ASSIGN) || defined(BOOST_MSVC) || defined(__GNUC__) || defined(BOOST_INTEL) || defined(__SUNPRO_CC) || defined(__clang) +#if !defined(BOOST_HAS_TRIVIAL_ASSIGN) || defined(BOOST_MSVC) || defined(__GNUC__) || defined(BOOST_INTEL) || defined(__SUNPRO_CC) || defined(__clang__) #include #include #include diff --git a/3rdparty/boost/boost/type_traits/has_trivial_copy.hpp b/3rdparty/boost/boost/type_traits/has_trivial_copy.hpp index 9d3265d1dc..fd6ad2d03b 100644 --- a/3rdparty/boost/boost/type_traits/has_trivial_copy.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/type_traits/has_trivial_destructor.hpp b/3rdparty/boost/boost/type_traits/has_trivial_destructor.hpp index 763283d78c..9a3a61ff97 100644 --- a/3rdparty/boost/boost/type_traits/has_trivial_destructor.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/type_traits/has_trivial_move_assign.hpp b/3rdparty/boost/boost/type_traits/has_trivial_move_assign.hpp index f7bb1987cb..6d954ab669 100644 --- a/3rdparty/boost/boost/type_traits/has_trivial_move_assign.hpp +++ b/3rdparty/boost/boost/type_traits/has_trivial_move_assign.hpp @@ -11,6 +11,7 @@ #ifndef BOOST_TT_HAS_TRIVIAL_MOVE_ASSIGN_HPP_INCLUDED #define BOOST_TT_HAS_TRIVIAL_MOVE_ASSIGN_HPP_INCLUDED +#include // size_t #include #include diff --git a/3rdparty/boost/boost/type_traits/has_trivial_move_constructor.hpp b/3rdparty/boost/boost/type_traits/has_trivial_move_constructor.hpp index 9e601f38ae..5784f4bbff 100644 --- a/3rdparty/boost/boost/type_traits/has_trivial_move_constructor.hpp +++ b/3rdparty/boost/boost/type_traits/has_trivial_move_constructor.hpp @@ -11,6 +11,7 @@ #ifndef BOOST_TT_HAS_TRIVIAL_MOVE_CONSTRUCTOR_HPP_INCLUDED #define BOOST_TT_HAS_TRIVIAL_MOVE_CONSTRUCTOR_HPP_INCLUDED +#include // size_t #include #include diff --git a/3rdparty/boost/boost/type_traits/is_abstract.hpp b/3rdparty/boost/boost/type_traits/is_abstract.hpp index 7715c5ca37..781d94a479 100644 --- a/3rdparty/boost/boost/type_traits/is_abstract.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/type_traits/is_array.hpp b/3rdparty/boost/boost/type_traits/is_array.hpp index 497dc49327..53e1613ab6 100644 --- a/3rdparty/boost/boost/type_traits/is_array.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/type_traits/is_assignable.hpp b/3rdparty/boost/boost/type_traits/is_assignable.hpp index 9cf681dd31..49d171616a 100644 --- a/3rdparty/boost/boost/type_traits/is_assignable.hpp +++ b/3rdparty/boost/boost/type_traits/is_assignable.hpp @@ -9,6 +9,7 @@ #ifndef BOOST_TT_IS_ASSIGNABLE_HPP_INCLUDED #define BOOST_TT_IS_ASSIGNABLE_HPP_INCLUDED +#include // size_t #include #include diff --git a/3rdparty/boost/boost/type_traits/is_const.hpp b/3rdparty/boost/boost/type_traits/is_const.hpp index d9dd2aa326..e0ed88a34b 100644 --- a/3rdparty/boost/boost/type_traits/is_const.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/type_traits/is_default_constructible.hpp b/3rdparty/boost/boost/type_traits/is_default_constructible.hpp index 7fd63f8969..fa5d76a22d 100644 --- a/3rdparty/boost/boost/type_traits/is_default_constructible.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/type_traits/is_destructible.hpp b/3rdparty/boost/boost/type_traits/is_destructible.hpp index 9f1e5d9817..742d990730 100644 --- a/3rdparty/boost/boost/type_traits/is_destructible.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/type_traits/is_nothrow_move_assignable.hpp b/3rdparty/boost/boost/type_traits/is_nothrow_move_assignable.hpp index 9755430ecf..4fb5bd8a6d 100644 --- a/3rdparty/boost/boost/type_traits/is_nothrow_move_assignable.hpp +++ b/3rdparty/boost/boost/type_traits/is_nothrow_move_assignable.hpp @@ -33,7 +33,7 @@ template struct is_nothrow_move_assignable : public false_type{}; template struct is_nothrow_move_assignable : public false_type{}; #endif -#elif !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_SFINAE_EXPR) +#elif !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_SFINAE_EXPR) && !BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40700) namespace detail{ diff --git a/3rdparty/boost/boost/type_traits/is_nothrow_move_constructible.hpp b/3rdparty/boost/boost/type_traits/is_nothrow_move_constructible.hpp index 8f4cee2cf9..0d5d57a0f8 100644 --- a/3rdparty/boost/boost/type_traits/is_nothrow_move_constructible.hpp +++ b/3rdparty/boost/boost/type_traits/is_nothrow_move_constructible.hpp @@ -11,6 +11,7 @@ #ifndef BOOST_TT_IS_NOTHROW_MOVE_CONSTRUCTIBLE_HPP_INCLUDED #define BOOST_TT_IS_NOTHROW_MOVE_CONSTRUCTIBLE_HPP_INCLUDED +#include // size_t #include #include #include @@ -26,7 +27,7 @@ struct is_nothrow_move_constructible : public integral_constant struct is_nothrow_move_constructible : public ::boost::false_type {}; template struct is_nothrow_move_constructible : public ::boost::false_type{}; -#elif !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_SFINAE_EXPR) && !BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40700) +#elif !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_SFINAE_EXPR) && !BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40800) #include #include diff --git a/3rdparty/boost/boost/type_traits/is_pod.hpp b/3rdparty/boost/boost/type_traits/is_pod.hpp index 9204c93e25..9bd196257a 100644 --- a/3rdparty/boost/boost/type_traits/is_pod.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/type_traits/is_virtual_base_of.hpp b/3rdparty/boost/boost/type_traits/is_virtual_base_of.hpp index f0052563e3..84cb355cd0 100644 --- a/3rdparty/boost/boost/type_traits/is_virtual_base_of.hpp +++ b/3rdparty/boost/boost/type_traits/is_virtual_base_of.hpp @@ -17,7 +17,7 @@ namespace detail { #ifdef BOOST_MSVC #pragma warning( push ) -#pragma warning( disable : 4584 4250) +#pragma warning( disable : 4584 4250 4594) #elif defined(__GNUC__) && (__GNUC__ >= 4) #pragma GCC system_header #endif diff --git a/3rdparty/boost/boost/type_traits/is_volatile.hpp b/3rdparty/boost/boost/type_traits/is_volatile.hpp index cefe987308..5b8e716b47 100644 --- a/3rdparty/boost/boost/type_traits/is_volatile.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/type_traits/rank.hpp b/3rdparty/boost/boost/type_traits/rank.hpp index 3dfc693687..1f820f1a55 100644 --- a/3rdparty/boost/boost/type_traits/rank.hpp +++ b/3rdparty/boost/boost/type_traits/rank.hpp @@ -10,6 +10,7 @@ #ifndef BOOST_TT_RANK_HPP_INCLUDED #define BOOST_TT_RANK_HPP_INCLUDED +#include // size_t #include namespace boost { diff --git a/3rdparty/boost/boost/type_traits/remove_all_extents.hpp b/3rdparty/boost/boost/type_traits/remove_all_extents.hpp index 3ccdc98281..90c90d3523 100644 --- a/3rdparty/boost/boost/type_traits/remove_all_extents.hpp +++ b/3rdparty/boost/boost/type_traits/remove_all_extents.hpp @@ -10,7 +10,7 @@ #define BOOST_TT_REMOVE_ALL_EXTENTS_HPP_INCLUDED #include -#include +#include // size_t #include namespace boost { diff --git a/3rdparty/boost/boost/type_traits/remove_const.hpp b/3rdparty/boost/boost/type_traits/remove_const.hpp index b47f851460..e238962c6d 100644 --- a/3rdparty/boost/boost/type_traits/remove_const.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/type_traits/remove_cv.hpp b/3rdparty/boost/boost/type_traits/remove_cv.hpp index b50607f2ce..08393cfb81 100644 --- a/3rdparty/boost/boost/type_traits/remove_cv.hpp +++ b/3rdparty/boost/boost/type_traits/remove_cv.hpp @@ -13,7 +13,7 @@ #include #include -#include +#include // size_t namespace boost { diff --git a/3rdparty/boost/boost/type_traits/remove_extent.hpp b/3rdparty/boost/boost/type_traits/remove_extent.hpp index 0b50a07034..b6528e525b 100644 --- a/3rdparty/boost/boost/type_traits/remove_extent.hpp +++ b/3rdparty/boost/boost/type_traits/remove_extent.hpp @@ -11,7 +11,7 @@ #include #include -#include +#include // size_t namespace boost { diff --git a/3rdparty/boost/boost/type_traits/remove_pointer.hpp b/3rdparty/boost/boost/type_traits/remove_pointer.hpp index fb79e59d22..921665266f 100644 --- a/3rdparty/boost/boost/type_traits/remove_pointer.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/type_traits/remove_volatile.hpp b/3rdparty/boost/boost/type_traits/remove_volatile.hpp index 475e39d22c..f5870f317f 100644 --- a/3rdparty/boost/boost/type_traits/remove_volatile.hpp +++ b/3rdparty/boost/boost/type_traits/remove_volatile.hpp @@ -13,7 +13,7 @@ #include #include -#include +#include // size_t namespace boost { diff --git a/3rdparty/boost/boost/type_traits/type_with_alignment.hpp b/3rdparty/boost/boost/type_traits/type_with_alignment.hpp index ffa054a2f1..ddf1d98294 100644 --- a/3rdparty/boost/boost/type_traits/type_with_alignment.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/utility/base_from_member.hpp b/3rdparty/boost/boost/utility/base_from_member.hpp index fc0e13c0d7..604541d19a 100644 --- a/3rdparty/boost/boost/utility/base_from_member.hpp +++ b/3rdparty/boost/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/3rdparty/boost/boost/version.hpp b/3rdparty/boost/boost/version.hpp index fce02ec7ba..a382352cd5 100644 --- a/3rdparty/boost/boost/version.hpp +++ b/3rdparty/boost/boost/version.hpp @@ -19,7 +19,7 @@ // BOOST_VERSION / 100 % 1000 is the minor version // BOOST_VERSION / 100000 is the major version -#define BOOST_VERSION 106000 +#define BOOST_VERSION 106200 // // BOOST_LIB_VERSION must be defined to be the same as BOOST_VERSION @@ -27,6 +27,6 @@ // number, y is the minor version number, and z is the patch level if not 0. // This is used by to select which library version to link to. -#define BOOST_LIB_VERSION "1_60" +#define BOOST_LIB_VERSION "1_62" #endif diff --git a/3rdparty/boost/libs/regex/src/posix_api.cpp b/3rdparty/boost/libs/regex/src/posix_api.cpp index 3711a9a09c..1531d948a0 100644 --- a/3rdparty/boost/libs/regex/src/posix_api.cpp +++ b/3rdparty/boost/libs/regex/src/posix_api.cpp @@ -182,10 +182,12 @@ BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorA(int code, const regex_tA* } } #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(_WIN32_WCE) && !defined(UNDER_CE) - (::sprintf_s)(localbuf, 5, "%d", 0); + int r = (::sprintf_s)(localbuf, 5, "%d", 0); #else - (std::sprintf)(localbuf, "%d", 0); + int r = (std::sprintf)(localbuf, "%d", 0); #endif + if(r < 0) + return 0; // sprintf failed if(std::strlen(localbuf) < buf_size) BOOST_REGEX_DETAIL_NS::strcpy_s(buf, buf_size, localbuf); return std::strlen(localbuf) + 1; diff --git a/3rdparty/boost/libs/regex/src/regex.cpp b/3rdparty/boost/libs/regex/src/regex.cpp index 03057aac9c..e9e9762748 100644 --- a/3rdparty/boost/libs/regex/src/regex.cpp +++ b/3rdparty/boost/libs/regex/src/regex.cpp @@ -191,7 +191,9 @@ BOOST_REGEX_DECL void BOOST_REGEX_CALL put_mem_block(void* p) #else -#ifdef BOOST_HAS_THREADS +#if defined(BOOST_REGEX_MEM_BLOCK_CACHE_LOCK_FREE) +mem_block_cache block_cache = { { {nullptr} } } ; +#elif defined(BOOST_HAS_THREADS) mem_block_cache block_cache = { 0, 0, BOOST_STATIC_MUTEX_INIT, }; #else mem_block_cache block_cache = { 0, 0, }; diff --git a/status.22x b/status.22x index 87b7522399..6bd8f763ec 100644 --- a/status.22x +++ b/status.22x @@ -77,3 +77,6 @@ What's new * BUILD/INSTALLATION + +- Update boost source to 1.62. +