diff --git a/cpp/BoostParts/boost/align/align.hpp b/cpp/BoostParts/boost/align/align.hpp index 648a65e295..3582dcc051 100644 --- a/cpp/BoostParts/boost/align/align.hpp +++ b/cpp/BoostParts/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/cpp/BoostParts/boost/align/align_up.hpp b/cpp/BoostParts/boost/align/align_up.hpp new file mode 100644 index 0000000000..b1cec1911e --- /dev/null +++ b/cpp/BoostParts/boost/align/align_up.hpp @@ -0,0 +1,27 @@ +/* +(c) 2015 Glen Joseph Fernandes + + +Distributed under the Boost Software +License, Version 1.0. +http://boost.org/LICENSE_1_0.txt +*/ +#ifndef BOOST_ALIGN_ALIGN_UP_HPP +#define BOOST_ALIGN_ALIGN_UP_HPP + +#include +#include + +namespace boost { +namespace alignment { + +BOOST_CONSTEXPR inline std::size_t align_up(std::size_t value, + std::size_t alignment) BOOST_NOEXCEPT +{ + return (value + alignment - 1) & ~(alignment - 1); +} + +} /* .alignment */ +} /* .boost */ + +#endif diff --git a/cpp/BoostParts/boost/align/align_up_forward.hpp b/cpp/BoostParts/boost/align/align_up_forward.hpp new file mode 100644 index 0000000000..47fdfcd0ba --- /dev/null +++ b/cpp/BoostParts/boost/align/align_up_forward.hpp @@ -0,0 +1,24 @@ +/* +(c) 2015 Glen Joseph Fernandes + + +Distributed under the Boost Software +License, Version 1.0. +http://boost.org/LICENSE_1_0.txt +*/ +#ifndef BOOST_ALIGN_ALIGN_UP_FORWARD_HPP +#define BOOST_ALIGN_ALIGN_UP_FORWARD_HPP + +#include +#include + +namespace boost { +namespace alignment { + +BOOST_CONSTEXPR std::size_t align_up(std::size_t value, + std::size_t alignment) BOOST_NOEXCEPT; + +} /* .alignment */ +} /* .boost */ + +#endif diff --git a/cpp/BoostParts/boost/align/aligned_allocator_adaptor.hpp b/cpp/BoostParts/boost/align/aligned_allocator_adaptor.hpp new file mode 100644 index 0000000000..29d13874ad --- /dev/null +++ b/cpp/BoostParts/boost/align/aligned_allocator_adaptor.hpp @@ -0,0 +1,185 @@ +/* +(c) 2014-2015 Glen Joseph Fernandes + + +Distributed under the Boost Software +License, Version 1.0. +http://boost.org/LICENSE_1_0.txt +*/ +#ifndef BOOST_ALIGN_ALIGNED_ALLOCATOR_ADAPTOR_HPP +#define BOOST_ALIGN_ALIGNED_ALLOCATOR_ADAPTOR_HPP + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if !defined(BOOST_NO_CXX11_ALLOCATOR) +#include +#endif + +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) +#include +#endif + +namespace boost { +namespace alignment { + +template +class aligned_allocator_adaptor + : public Allocator { + BOOST_STATIC_ASSERT(detail:: + is_alignment_constant::value); + +#if !defined(BOOST_NO_CXX11_ALLOCATOR) + typedef std::allocator_traits traits; + + typedef typename traits:: + template rebind_alloc char_alloc; + + typedef typename traits:: + template rebind_traits char_traits; + + typedef typename char_traits::pointer char_ptr; +#else + typedef typename Allocator:: + template rebind::other char_alloc; + + typedef typename char_alloc::pointer char_ptr; +#endif + +public: +#if !defined(BOOST_NO_CXX11_ALLOCATOR) + typedef typename traits::value_type value_type; + typedef typename traits::size_type size_type; +#else + typedef typename Allocator::value_type value_type; + typedef typename Allocator::size_type size_type; +#endif + + typedef value_type* pointer; + typedef const value_type* const_pointer; + typedef void* void_pointer; + typedef const void* const_void_pointer; + typedef std::ptrdiff_t difference_type; + +private: + enum { + min_align = detail::max_size::value>::value + }; + +public: + template + struct rebind { +#if !defined(BOOST_NO_CXX11_ALLOCATOR) + typedef aligned_allocator_adaptor, Alignment> other; +#else + typedef aligned_allocator_adaptor::other, Alignment> other; +#endif + }; + +#if !defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) + aligned_allocator_adaptor() = default; +#else + aligned_allocator_adaptor() + : Allocator() { + } +#endif + +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) + template + explicit aligned_allocator_adaptor(A&& alloc) BOOST_NOEXCEPT + : Allocator(std::forward(alloc)) { + } +#else + template + explicit aligned_allocator_adaptor(const A& alloc) + BOOST_NOEXCEPT + : Allocator(alloc) { + } +#endif + + template + aligned_allocator_adaptor(const aligned_allocator_adaptor& other) BOOST_NOEXCEPT + : Allocator(other.base()) { + } + + Allocator& base() BOOST_NOEXCEPT { + return static_cast(*this); + } + + const Allocator& base() const BOOST_NOEXCEPT { + return static_cast(*this); + } + + pointer allocate(size_type size) { + std::size_t s = size * sizeof(value_type); + std::size_t n = s + min_align - 1; + char_alloc a(base()); + char_ptr p = a.allocate(sizeof p + n); + void* r = detail::addressof(*p) + sizeof p; + (void)align(min_align, s, r, n); + ::new(static_cast(static_cast(r) - + 1)) char_ptr(p); + return static_cast(r); + } + + pointer allocate(size_type size, const_void_pointer hint) { + std::size_t s = size * sizeof(value_type); + std::size_t n = s + min_align - 1; + char_ptr h = char_ptr(); + if (hint) { + h = *(static_cast(hint) - 1); + } + char_alloc a(base()); +#if !defined(BOOST_NO_CXX11_ALLOCATOR) + char_ptr p = char_traits::allocate(a, sizeof p + n, h); +#else + char_ptr p = a.allocate(sizeof p + n, h); +#endif + void* r = detail::addressof(*p) + sizeof p; + (void)align(min_align, s, r, n); + ::new(static_cast(static_cast(r) - + 1)) char_ptr(p); + return static_cast(r); + } + + void deallocate(pointer ptr, size_type size) { + char_ptr* p = reinterpret_cast(ptr) - 1; + char_ptr r = *p; + p->~char_ptr(); + char_alloc a(base()); + a.deallocate(r, sizeof r + size * sizeof(value_type) + + min_align - 1); + } +}; + +template +inline bool operator==(const aligned_allocator_adaptor& a, const aligned_allocator_adaptor& b) BOOST_NOEXCEPT +{ + return a.base() == b.base(); +} + +template +inline bool operator!=(const aligned_allocator_adaptor& a, const aligned_allocator_adaptor& b) BOOST_NOEXCEPT +{ + return !(a == b); +} + +} /* .alignment */ +} /* .boost */ + +#endif diff --git a/cpp/BoostParts/boost/align/aligned_allocator_adaptor_forward.hpp b/cpp/BoostParts/boost/align/aligned_allocator_adaptor_forward.hpp new file mode 100644 index 0000000000..d606f09920 --- /dev/null +++ b/cpp/BoostParts/boost/align/aligned_allocator_adaptor_forward.hpp @@ -0,0 +1,23 @@ +/* +(c) 2014 Glen Joseph Fernandes + + +Distributed under the Boost Software +License, Version 1.0. +http://boost.org/LICENSE_1_0.txt +*/ +#ifndef BOOST_ALIGN_ALIGNED_ALLOCATOR_ADAPTOR_FORWARD_HPP +#define BOOST_ALIGN_ALIGNED_ALLOCATOR_ADAPTOR_FORWARD_HPP + +#include + +namespace boost { +namespace alignment { + +template +class aligned_allocator_adaptor; + +} /* .alignment */ +} /* .boost */ + +#endif diff --git a/cpp/BoostParts/boost/align/alignment_of.hpp b/cpp/BoostParts/boost/align/alignment_of.hpp new file mode 100644 index 0000000000..fee91838af --- /dev/null +++ b/cpp/BoostParts/boost/align/alignment_of.hpp @@ -0,0 +1,54 @@ +/* +(c) 2014-2015 Glen Joseph Fernandes + + +Distributed under the Boost Software +License, Version 1.0. +http://boost.org/LICENSE_1_0.txt +*/ +#ifndef BOOST_ALIGN_ALIGNMENT_OF_HPP +#define BOOST_ALIGN_ALIGNMENT_OF_HPP + +#include +#include + +#if defined(BOOST_MSVC) +#include +#elif defined(__GNUC__) && defined(__unix__) && !defined(__LP64__) +#include +#elif defined(BOOST_CLANG) && !defined(__x86_64__) +#include +#elif !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS) +#include +#elif defined(__ghs__) && (__GHS_VERSION_NUMBER >= 600) +#include +#elif defined(__CODEGEARC__) +#include +#elif defined(BOOST_CLANG) +#include +#elif __GNUC__ > 4 +#include +#elif (__GNUC__ == 4) && (__GNUC_MINOR__ >= 3) +#include +#else +#include +#endif + +namespace boost { +namespace alignment { + +template +struct alignment_of + : detail::alignment_of::type>::type { +}; + +#if !defined(BOOST_NO_CXX14_VARIABLE_TEMPLATES) +template +constexpr std::size_t alignment_of_v = alignment_of::value; +#endif + +} /* .alignment */ +} /* .boost */ + +#endif diff --git a/cpp/BoostParts/boost/align/alignment_of_forward.hpp b/cpp/BoostParts/boost/align/alignment_of_forward.hpp new file mode 100644 index 0000000000..7ab227528b --- /dev/null +++ b/cpp/BoostParts/boost/align/alignment_of_forward.hpp @@ -0,0 +1,21 @@ +/* +(c) 2014 Glen Joseph Fernandes + + +Distributed under the Boost Software +License, Version 1.0. +http://boost.org/LICENSE_1_0.txt +*/ +#ifndef BOOST_ALIGN_ALIGNMENT_OF_FORWARD_HPP +#define BOOST_ALIGN_ALIGNMENT_OF_FORWARD_HPP + +namespace boost { +namespace alignment { + +template +struct alignment_of; + +} /* .alignment */ +} /* .boost */ + +#endif diff --git a/cpp/BoostParts/boost/align/detail/addressof.hpp b/cpp/BoostParts/boost/align/detail/addressof.hpp new file mode 100644 index 0000000000..50731a70d0 --- /dev/null +++ b/cpp/BoostParts/boost/align/detail/addressof.hpp @@ -0,0 +1,34 @@ +/* +(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_ADDRESSOF_HPP +#define BOOST_ALIGN_DETAIL_ADDRESSOF_HPP + +#include + +#if !defined(BOOST_NO_CXX11_ADDRESSOF) +#include +#else +#include +#endif + +namespace boost { +namespace alignment { +namespace detail { + +#if !defined(BOOST_NO_CXX11_ADDRESSOF) +using std::addressof; +#else +using boost::addressof; +#endif + +} /* .detail */ +} /* .alignment */ +} /* .boost */ + +#endif diff --git a/cpp/BoostParts/boost/align/detail/align.hpp b/cpp/BoostParts/boost/align/detail/align.hpp index d2404b3e6d..0828c58365 100644 --- a/cpp/BoostParts/boost/align/detail/align.hpp +++ b/cpp/BoostParts/boost/align/detail/align.hpp @@ -9,10 +9,8 @@ License, Version 1.0. #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 = reinterpret_cast((reinterpret_cast(ptr) + alignment - 1) & ~(alignment - 1)); + std::ptrdiff_t n = p - static_cast(ptr); + if (size <= space - n) { + ptr = p; + space -= n; + return p; + } } - return p; + return 0; } } /* .alignment */ diff --git a/cpp/BoostParts/boost/align/detail/align_up.hpp b/cpp/BoostParts/boost/align/detail/align_up.hpp new file mode 100644 index 0000000000..d52e0993ce --- /dev/null +++ b/cpp/BoostParts/boost/align/detail/align_up.hpp @@ -0,0 +1,29 @@ +/* +(c) 2015 Glen Joseph Fernandes + + +Distributed under the Boost Software +License, Version 1.0. +http://boost.org/LICENSE_1_0.txt +*/ +#ifndef BOOST_ALIGN_DETAIL_ALIGN_UP_HPP +#define BOOST_ALIGN_DETAIL_ALIGN_UP_HPP + +#include +#include +#include + +namespace boost { +namespace alignment { + +inline void* align_up(void* ptr, std::size_t alignment) BOOST_NOEXCEPT +{ + BOOST_ASSERT(detail::is_alignment(alignment)); + return reinterpret_cast(align_up(reinterpret_cast(ptr), alignment)); +} + +} /* .alignment */ +} /* .boost */ + +#endif diff --git a/cpp/BoostParts/boost/align/detail/alignment_of.hpp b/cpp/BoostParts/boost/align/detail/alignment_of.hpp new file mode 100644 index 0000000000..2a630e9784 --- /dev/null +++ b/cpp/BoostParts/boost/align/detail/alignment_of.hpp @@ -0,0 +1,34 @@ +/* +(c) 2014-2015 Glen Joseph Fernandes + + +Distributed under the Boost Software +License, Version 1.0. +http://boost.org/LICENSE_1_0.txt +*/ +#ifndef BOOST_ALIGN_DETAIL_ALIGNMENT_OF_HPP +#define BOOST_ALIGN_DETAIL_ALIGNMENT_OF_HPP + +#include + +namespace boost { +namespace alignment { +namespace detail { + +template +struct alignof_helper { + char value; + T object; +}; + +template +struct alignment_of + : min_size) - sizeof(T)>::type { +}; + +} /* .detail */ +} /* .alignment */ +} /* .boost */ + +#endif diff --git a/cpp/BoostParts/boost/align/detail/alignment_of_clang.hpp b/cpp/BoostParts/boost/align/detail/alignment_of_clang.hpp new file mode 100644 index 0000000000..a8e2a349d6 --- /dev/null +++ b/cpp/BoostParts/boost/align/detail/alignment_of_clang.hpp @@ -0,0 +1,28 @@ +/* +(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_ALIGNMENT_OF_CLANG_HPP +#define BOOST_ALIGN_DETAIL_ALIGNMENT_OF_CLANG_HPP + +#include +#include + +namespace boost { +namespace alignment { +namespace detail { + +template +struct alignment_of + : integral_constant { +}; + +} /* .detail */ +} /* .alignment */ +} /* .boost */ + +#endif diff --git a/cpp/BoostParts/boost/align/detail/alignment_of_codegear.hpp b/cpp/BoostParts/boost/align/detail/alignment_of_codegear.hpp new file mode 100644 index 0000000000..8875e6c424 --- /dev/null +++ b/cpp/BoostParts/boost/align/detail/alignment_of_codegear.hpp @@ -0,0 +1,28 @@ +/* +(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_ALIGNMENT_OF_CODEGEAR_HPP +#define BOOST_ALIGN_DETAIL_ALIGNMENT_OF_CODEGEAR_HPP + +#include +#include + +namespace boost { +namespace alignment { +namespace detail { + +template +struct alignment_of + : integral_constant { +}; + +} /* .detail */ +} /* .alignment */ +} /* .boost */ + +#endif diff --git a/cpp/BoostParts/boost/align/detail/alignment_of_cxx11.hpp b/cpp/BoostParts/boost/align/detail/alignment_of_cxx11.hpp new file mode 100644 index 0000000000..cbe2d9e7a8 --- /dev/null +++ b/cpp/BoostParts/boost/align/detail/alignment_of_cxx11.hpp @@ -0,0 +1,24 @@ +/* +(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_ALIGNMENT_OF_CXX11_HPP +#define BOOST_ALIGN_DETAIL_ALIGNMENT_OF_CXX11_HPP + +#include + +namespace boost { +namespace alignment { +namespace detail { + +using std::alignment_of; + +} /* .detail */ +} /* .alignment */ +} /* .boost */ + +#endif diff --git a/cpp/BoostParts/boost/align/detail/address.hpp b/cpp/BoostParts/boost/align/detail/alignment_of_gcc.hpp similarity index 54% rename from cpp/BoostParts/boost/align/detail/address.hpp rename to cpp/BoostParts/boost/align/detail/alignment_of_gcc.hpp index b38e571534..0812fde8e4 100644 --- a/cpp/BoostParts/boost/align/detail/address.hpp +++ b/cpp/BoostParts/boost/align/detail/alignment_of_gcc.hpp @@ -6,21 +6,20 @@ 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 +#ifndef BOOST_ALIGN_DETAIL_ALIGNMENT_OF_GCC_HPP +#define BOOST_ALIGN_DETAIL_ALIGNMENT_OF_GCC_HPP -#include +#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 +template +struct alignment_of + : integral_constant { +}; } /* .detail */ } /* .alignment */ diff --git a/cpp/BoostParts/boost/align/detail/alignment_of_msvc.hpp b/cpp/BoostParts/boost/align/detail/alignment_of_msvc.hpp new file mode 100644 index 0000000000..df6912f411 --- /dev/null +++ b/cpp/BoostParts/boost/align/detail/alignment_of_msvc.hpp @@ -0,0 +1,35 @@ +/* +(c) 2014-2015 Glen Joseph Fernandes + + +Distributed under the Boost Software +License, Version 1.0. +http://boost.org/LICENSE_1_0.txt +*/ +#ifndef BOOST_ALIGN_DETAIL_ALIGNMENT_OF_MSVC_HPP +#define BOOST_ALIGN_DETAIL_ALIGNMENT_OF_MSVC_HPP + +#include + +namespace boost { +namespace alignment { +namespace detail { + +template +struct alignof_helper { + T first; + char value; + T second; +}; + +template +struct alignment_of + : min_size) - (sizeof(T) << 1)>::type { +}; + +} /* .detail */ +} /* .alignment */ +} /* .boost */ + +#endif diff --git a/cpp/BoostParts/boost/align/detail/element_type.hpp b/cpp/BoostParts/boost/align/detail/element_type.hpp new file mode 100644 index 0000000000..793e25ed39 --- /dev/null +++ b/cpp/BoostParts/boost/align/detail/element_type.hpp @@ -0,0 +1,106 @@ +/* +(c) 2015 Glen Joseph Fernandes + + +Distributed under the Boost Software +License, Version 1.0. +http://boost.org/LICENSE_1_0.txt +*/ +#ifndef BOOST_ALIGN_DETAIL_ELEMENT_TYPE_HPP +#define BOOST_ALIGN_DETAIL_ELEMENT_TYPE_HPP + +#include + +#if !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS) +#include +#else +#include +#endif + +namespace boost { +namespace alignment { +namespace detail { + +#if !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS) +template +struct element_type { + typedef typename + std::remove_cv:: + type>::type>::type type; +}; +#else +template +struct remove_reference { + typedef T type; +}; + +template +struct remove_reference { + typedef T type; +}; + +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) +template +struct remove_reference { + typedef T type; +}; +#endif + +template +struct remove_all_extents { + typedef T type; +}; + +template +struct remove_all_extents { + typedef typename remove_all_extents::type type; +}; + +template +struct remove_all_extents { + typedef typename remove_all_extents::type type; +}; + +template +struct remove_const { + typedef T type; +}; + +template +struct remove_const { + typedef T type; +}; + +template +struct remove_volatile { + typedef T type; +}; + +template +struct remove_volatile { + typedef T type; +}; + +template +struct remove_cv { + typedef typename remove_volatile::type>::type type; +}; + +template +struct element_type { + typedef typename + remove_cv:: + type>::type>::type type; +}; +#endif + +} /* .detail */ +} /* .alignment */ +} /* .boost */ + +#endif diff --git a/cpp/BoostParts/boost/align/detail/integral_constant.hpp b/cpp/BoostParts/boost/align/detail/integral_constant.hpp new file mode 100644 index 0000000000..3f8bf0a8d9 --- /dev/null +++ b/cpp/BoostParts/boost/align/detail/integral_constant.hpp @@ -0,0 +1,42 @@ +/* +(c) 2014-2015 Glen Joseph Fernandes + + +Distributed under the Boost Software +License, Version 1.0. +http://boost.org/LICENSE_1_0.txt +*/ +#ifndef BOOST_ALIGN_DETAIL_INTEGRAL_CONSTANT_HPP +#define BOOST_ALIGN_DETAIL_INTEGRAL_CONSTANT_HPP + +#include + +#if !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS) +#include +#endif + +namespace boost { +namespace alignment { +namespace detail { + +#if !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS) +using std::integral_constant; +#else +template +struct integral_constant { + typedef T value_type; + typedef integral_constant type; + + BOOST_CONSTEXPR operator value_type() const { + return Value; + } + + static BOOST_CONSTEXPR_OR_CONST T value = Value; +}; +#endif + +} /* .detail */ +} /* .alignment */ +} /* .boost */ + +#endif diff --git a/cpp/BoostParts/boost/align/detail/is_alignment_constant.hpp b/cpp/BoostParts/boost/align/detail/is_alignment_constant.hpp new file mode 100644 index 0000000000..2c29343b2d --- /dev/null +++ b/cpp/BoostParts/boost/align/detail/is_alignment_constant.hpp @@ -0,0 +1,28 @@ +/* +(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_IS_ALIGNMENT_CONSTANT_HPP +#define BOOST_ALIGN_DETAIL_IS_ALIGNMENT_CONSTANT_HPP + +#include +#include + +namespace boost { +namespace alignment { +namespace detail { + +template +struct is_alignment_constant + : integral_constant 0) && ((N & (N - 1)) == 0)> { +}; + +} /* .detail */ +} /* .alignment */ +} /* .boost */ + +#endif diff --git a/cpp/BoostParts/boost/align/detail/max_align.hpp b/cpp/BoostParts/boost/align/detail/max_align.hpp new file mode 100644 index 0000000000..8ae6901c19 --- /dev/null +++ b/cpp/BoostParts/boost/align/detail/max_align.hpp @@ -0,0 +1,28 @@ +/* +(c) 2014-2015 Glen Joseph Fernandes + + +Distributed under the Boost Software +License, Version 1.0. +http://boost.org/LICENSE_1_0.txt +*/ +#ifndef BOOST_ALIGN_DETAIL_MAX_ALIGN_HPP +#define BOOST_ALIGN_DETAIL_MAX_ALIGN_HPP + +#include +#include + +namespace boost { +namespace alignment { +namespace detail { + +template +struct max_align + : max_size::value, alignment_of::value>::type { +}; + +} /* .detail */ +} /* .alignment */ +} /* .boost */ + +#endif diff --git a/cpp/BoostParts/boost/align/detail/max_size.hpp b/cpp/BoostParts/boost/align/detail/max_size.hpp new file mode 100644 index 0000000000..48fc45e2ee --- /dev/null +++ b/cpp/BoostParts/boost/align/detail/max_size.hpp @@ -0,0 +1,28 @@ +/* +(c) 2014-2015 Glen Joseph Fernandes + + +Distributed under the Boost Software +License, Version 1.0. +http://boost.org/LICENSE_1_0.txt +*/ +#ifndef BOOST_ALIGN_DETAIL_MAX_SIZE_HPP +#define BOOST_ALIGN_DETAIL_MAX_SIZE_HPP + +#include +#include + +namespace boost { +namespace alignment { +namespace detail { + +template +struct max_size + : integral_constant B) ? A : B> { +}; + +} /* .detail */ +} /* .alignment */ +} /* .boost */ + +#endif diff --git a/cpp/BoostParts/boost/align/detail/min_size.hpp b/cpp/BoostParts/boost/align/detail/min_size.hpp new file mode 100644 index 0000000000..8ed3e87ab6 --- /dev/null +++ b/cpp/BoostParts/boost/align/detail/min_size.hpp @@ -0,0 +1,28 @@ +/* +(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_MIN_SIZE_HPP +#define BOOST_ALIGN_DETAIL_MIN_SIZE_HPP + +#include +#include + +namespace boost { +namespace alignment { +namespace detail { + +template +struct min_size + : integral_constant { +}; + +} /* .detail */ +} /* .alignment */ +} /* .boost */ + +#endif diff --git a/cpp/BoostParts/boost/archive/add_facet.hpp b/cpp/BoostParts/boost/archive/add_facet.hpp deleted file mode 100644 index 242bdd9001..0000000000 --- a/cpp/BoostParts/boost/archive/add_facet.hpp +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef BOOST_ARCHIVE_ADD_FACET_HPP -#define BOOST_ARCHIVE_ADD_FACET_HPP - -// MS compatible compilers support #pragma once -#if defined(_MSC_VER) -# pragma once -#endif - -/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 -// add_facet.hpp - -// (C) Copyright 2003 Robert Ramey - http://www.rrsd.com . -// 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 for updates, documentation, and revision history. - -#include -#include -#include - -// does STLport uses native STL for locales? -#if (defined(__SGI_STL_PORT)&& defined(_STLP_NO_OWN_IOSTREAMS)) -// and this native STL lib is old Dinkumware (has not defined _CPPLIB_VER) -# if (defined(_YVALS) && !defined(__IBMCPP__)) || !defined(_CPPLIB_VER) -# define BOOST_ARCHIVE_OLD_DINKUMWARE_BENEATH_STLPORT -# endif -#endif - -namespace boost { -namespace archive { - -template -inline std::locale * -add_facet(const std::locale &l, Facet * f){ - return - #if defined BOOST_ARCHIVE_OLD_DINKUMWARE_BENEATH_STLPORT - // std namespace used for native locale - new std::locale(std::_Addfac(l, f)); - #elif BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) // old Dinkumwar - // std namespace used for native locale - new std::locale(std::_Addfac(l, f)); - #else - // standard compatible - new std::locale(l, f); - #endif -} - -} // namespace archive -} // namespace boost - -#undef BOOST_ARCHIVE_OLD_DINKUMWARE_BENEATH_STLPORT - -#endif // BOOST_ARCHIVE_ADD_FACET_HPP diff --git a/cpp/BoostParts/boost/archive/basic_binary_iprimitive.hpp b/cpp/BoostParts/boost/archive/basic_binary_iprimitive.hpp index 5e826310d7..40f45d9c2f 100644 --- a/cpp/BoostParts/boost/archive/basic_binary_iprimitive.hpp +++ b/cpp/BoostParts/boost/archive/basic_binary_iprimitive.hpp @@ -44,16 +44,16 @@ namespace std{ #endif #include -#include #include #include #include -#include +//#include #include #include #include +#include #include #include #include // must be the last header @@ -61,9 +61,6 @@ namespace std{ namespace boost { namespace archive { -template -class codecvt_null; - ///////////////////////////////////////////////////////////////////////////// // class binary_iarchive - read serialized objects from a input binary stream template @@ -81,9 +78,16 @@ class BOOST_SYMBOL_VISIBLE basic_binary_iprimitive { } #ifndef BOOST_NO_STD_LOCALE - boost::scoped_ptr > codecvt_facet; - boost::scoped_ptr archive_locale; + // note order! - if you change this, libstd++ will fail! + // a) create new locale with new codecvt facet + // b) save current locale + // c) change locale to new one + // d) use stream buffer + // e) change locale back to original + // f) destroy new codecvt facet + boost::archive::codecvt_null codecvt_null_facet; basic_streambuf_locale_saver locale_saver; + std::locale archive_locale; #endif // main template for serilization of primitive types @@ -139,7 +143,7 @@ class BOOST_SYMBOL_VISIBLE basic_binary_iprimitive { // the optimized load_array dispatches to load_binary template - void load_array(serialization::array& a, unsigned int) + void load_array(serialization::array_wrapper& a, unsigned int) { load_binary(a.address(),a.count()*sizeof(ValueType)); } diff --git a/cpp/BoostParts/boost/archive/basic_binary_oprimitive.hpp b/cpp/BoostParts/boost/archive/basic_binary_oprimitive.hpp index f2ea6aa3ea..4b7f454b25 100644 --- a/cpp/BoostParts/boost/archive/basic_binary_oprimitive.hpp +++ b/cpp/BoostParts/boost/archive/basic_binary_oprimitive.hpp @@ -43,20 +43,19 @@ namespace std{ #include #include -#include -#include +//#include #include -#include #include + +#include +#include +#include #include #include // must be the last header namespace boost { namespace archive { -template -class codecvt_null; - ///////////////////////////////////////////////////////////////////////// // class basic_binary_oprimitive - binary output of prmitives @@ -74,9 +73,16 @@ class BOOST_SYMBOL_VISIBLE basic_binary_oprimitive { return static_cast(this); } #ifndef BOOST_NO_STD_LOCALE - boost::scoped_ptr > codecvt_facet; - boost::scoped_ptr archive_locale; + // note order! - if you change this, libstd++ will fail! + // a) create new locale with new codecvt facet + // b) save current locale + // c) change locale to new one + // d) use stream buffer + // e) change locale back to original + // f) destroy new codecvt facet + boost::archive::codecvt_null codecvt_null_facet; basic_streambuf_locale_saver locale_saver; + std::locale archive_locale; #endif // default saving of primitives. template @@ -131,11 +137,10 @@ class BOOST_SYMBOL_VISIBLE basic_binary_oprimitive { struct apply : public boost::serialization::is_bitwise_serializable< T > {}; #endif }; - // the optimized save_array dispatches to save_binary template - void save_array(boost::serialization::array const& a, unsigned int) + void save_array(boost::serialization::array_wrapper const& a, unsigned int) { save_binary(a.address(),a.count()*sizeof(ValueType)); } diff --git a/cpp/BoostParts/boost/archive/basic_streambuf_locale_saver.hpp b/cpp/BoostParts/boost/archive/basic_streambuf_locale_saver.hpp index 64c8e5d314..5cd4b36f08 100644 --- a/cpp/BoostParts/boost/archive/basic_streambuf_locale_saver.hpp +++ b/cpp/BoostParts/boost/archive/basic_streambuf_locale_saver.hpp @@ -27,6 +27,7 @@ #ifndef BOOST_NO_STD_LOCALE #include // for std::locale +#include #include // for std::basic_streambuf #include @@ -45,25 +46,57 @@ class basic_streambuf_locale_saver : private boost::noncopyable { public: - typedef ::std::basic_streambuf state_type; - typedef ::std::locale aspect_type; - explicit basic_streambuf_locale_saver( state_type &s ) - : s_save_( s ), a_save_( s.getloc() ) - {} - explicit basic_streambuf_locale_saver( state_type &s, aspect_type const &a ) - : s_save_( s ), a_save_( s.pubimbue(a) ) - {} - ~basic_streambuf_locale_saver() - { this->restore(); } - void restore(){ - s_save_.pubsync(); - s_save_.pubimbue( a_save_ ); + explicit basic_streambuf_locale_saver(std::basic_streambuf &s) : + m_streambuf(s), + m_locale(s.getloc()) + {} + ~basic_streambuf_locale_saver(){ + m_streambuf.pubsync(); + m_streambuf.pubimbue(m_locale); } private: - state_type & s_save_; - aspect_type const a_save_; + std::basic_streambuf & m_streambuf; + std::locale const m_locale; }; +template < typename Ch, class Tr > +class basic_istream_locale_saver : + private boost::noncopyable +{ +public: + explicit basic_istream_locale_saver(std::basic_istream &s) : + m_istream(s), + m_locale(s.getloc()) + {} + ~basic_istream_locale_saver(){ + // libstdc++ crashes without this + m_istream.sync(); + m_istream.imbue(m_locale); + } +private: + std::basic_istream & m_istream; + std::locale const m_locale; +}; + +template < typename Ch, class Tr > +class basic_ostream_locale_saver : + private boost::noncopyable +{ +public: + explicit basic_ostream_locale_saver(std::basic_ostream &s) : + m_ostream(s), + m_locale(s.getloc()) + {} + ~basic_ostream_locale_saver(){ + m_ostream.flush(); + m_ostream.imbue(m_locale); + } +private: + std::basic_ostream & m_ostream; + std::locale const m_locale; +}; + + } // archive } // boost diff --git a/cpp/BoostParts/boost/archive/basic_text_iprimitive.hpp b/cpp/BoostParts/boost/archive/basic_text_iprimitive.hpp index 08da95c36e..bf936b5554 100644 --- a/cpp/BoostParts/boost/archive/basic_text_iprimitive.hpp +++ b/cpp/BoostParts/boost/archive/basic_text_iprimitive.hpp @@ -24,7 +24,6 @@ // in such cases. So we can't use basic_ostream but rather // use two template parameters -#include #include #include // size_t @@ -38,17 +37,15 @@ namespace std{ } // namespace std #endif +#include +#include + #include #if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) #include #endif - -#include -#include -#include -#include - #include +#include #include #include #include // must be the last header @@ -71,9 +68,17 @@ class BOOST_SYMBOL_VISIBLE basic_text_iprimitive { io::ios_precision_saver precision_saver; #ifndef BOOST_NO_STD_LOCALE - boost::scoped_ptr archive_locale; - basic_streambuf_locale_saver< - typename IStream::char_type, + // note order! - if you change this, libstd++ will fail! + // a) create new locale with new codecvt facet + // b) save current locale + // c) change locale to new one + // d) use stream buffer + // e) change locale back to original + // f) destroy new codecvt facet + boost::archive::codecvt_null codecvt_null_facet; + std::locale archive_locale; + basic_istream_locale_saver< + typename IStream::char_type, typename IStream::traits_type > locale_saver; #endif diff --git a/cpp/BoostParts/boost/archive/basic_text_oprimitive.hpp b/cpp/BoostParts/boost/archive/basic_text_oprimitive.hpp index 86330921d2..c9f8c59160 100644 --- a/cpp/BoostParts/boost/archive/basic_text_oprimitive.hpp +++ b/cpp/BoostParts/boost/archive/basic_text_oprimitive.hpp @@ -26,14 +26,13 @@ #include #include -#include #include // size_t #include #include -#include #include +#include #if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) #include #endif @@ -52,10 +51,10 @@ namespace std{ #include #include #include -#include #include -#include #include +#include +#include #include // must be the last header namespace boost { @@ -72,9 +71,17 @@ class BOOST_SYMBOL_VISIBLE basic_text_oprimitive io::ios_precision_saver precision_saver; #ifndef BOOST_NO_STD_LOCALE - boost::scoped_ptr archive_locale; - basic_streambuf_locale_saver< - typename OStream::char_type, + // note order! - if you change this, libstd++ will fail! + // a) create new locale with new codecvt facet + // b) save current locale + // c) change locale to new one + // d) use stream buffer + // e) change locale back to original + // f) destroy new codecvt facet + boost::archive::codecvt_null codecvt_null_facet; + std::locale archive_locale; + basic_ostream_locale_saver< + typename OStream::char_type, typename OStream::traits_type > locale_saver; #endif diff --git a/cpp/BoostParts/boost/archive/basic_xml_iarchive.hpp b/cpp/BoostParts/boost/archive/basic_xml_iarchive.hpp index 7834d8a100..a882df5615 100644 --- a/cpp/BoostParts/boost/archive/basic_xml_iarchive.hpp +++ b/cpp/BoostParts/boost/archive/basic_xml_iarchive.hpp @@ -17,15 +17,12 @@ // See http://www.boost.org for updates, documentation, and revision history. #include -#include +#include #include - #include #include -#include - #include // must be the last header #ifdef BOOST_MSVC @@ -41,24 +38,18 @@ namespace detail { } // namespace detail ///////////////////////////////////////////////////////////////////////// -// class xml_iarchive - read serialized objects from a input text stream +// class basic_xml_iarchive - read serialized objects from a input text stream template class BOOST_SYMBOL_VISIBLE basic_xml_iarchive : public detail::common_iarchive { + unsigned int depth; #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS public: #else protected: - #if BOOST_WORKAROUND(BOOST_MSVC, < 1500) - // for some inexplicable reason insertion of "class" generates compile erro - // on msvc 7.1 - friend detail::interface_iarchive; - #else - friend class detail::interface_iarchive; - #endif + friend class detail::interface_iarchive; #endif - unsigned int depth; BOOST_ARCHIVE_OR_WARCHIVE_DECL void load_start(const char *name); BOOST_ARCHIVE_OR_WARCHIVE_DECL void @@ -96,14 +87,15 @@ class BOOST_SYMBOL_VISIBLE basic_xml_iarchive : // an xml archive. So we can skip it here. Note: we MUST override // it otherwise it will be loaded as a normal primitive w/o tag and // leaving the archive in an undetermined state - void load_override(class_id_optional_type & /* t */){} + BOOST_ARCHIVE_OR_WARCHIVE_DECL void + load_override(class_id_type & t); + BOOST_ARCHIVE_OR_WARCHIVE_DECL void + load_override(class_id_optional_type & /* t */){} BOOST_ARCHIVE_OR_WARCHIVE_DECL void load_override(object_id_type & t); BOOST_ARCHIVE_OR_WARCHIVE_DECL void load_override(version_type & t); BOOST_ARCHIVE_OR_WARCHIVE_DECL void - load_override(class_id_type & t); - BOOST_ARCHIVE_OR_WARCHIVE_DECL void load_override(tracking_type & t); // class_name_type can't be handled here as it depends upon the // char type used by the stream. So require the derived implementation diff --git a/cpp/BoostParts/boost/archive/basic_xml_oarchive.hpp b/cpp/BoostParts/boost/archive/basic_xml_oarchive.hpp index 0325eee653..107fca4ec6 100644 --- a/cpp/BoostParts/boost/archive/basic_xml_oarchive.hpp +++ b/cpp/BoostParts/boost/archive/basic_xml_oarchive.hpp @@ -18,15 +18,11 @@ #include #include -#include #include - #include -#include #include - #include // must be the last header #ifdef BOOST_MSVC @@ -47,28 +43,23 @@ template class BOOST_SYMBOL_VISIBLE basic_xml_oarchive : public detail::common_oarchive { + // special stuff for xml output + unsigned int depth; + bool pending_preamble; #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS public: #else protected: -#endif -#if BOOST_WORKAROUND(BOOST_MSVC, < 1500) - // for some inexplicable reason insertion of "class" generates compile erro - // on msvc 7.1 - friend detail::interface_oarchive; -#else friend class detail::interface_oarchive; #endif - friend class save_access; - // special stuff for xml output - unsigned int depth; bool indent_next; - bool pending_preamble; BOOST_ARCHIVE_OR_WARCHIVE_DECL void indent(); BOOST_ARCHIVE_OR_WARCHIVE_DECL void init(); BOOST_ARCHIVE_OR_WARCHIVE_DECL void + windup(); + BOOST_ARCHIVE_OR_WARCHIVE_DECL void write_attribute( const char *attribute_name, int t, @@ -113,18 +104,18 @@ class BOOST_SYMBOL_VISIBLE basic_xml_oarchive : // specific overrides for attributes - not name value pairs so we // want to trap them before the above "fall through" BOOST_ARCHIVE_OR_WARCHIVE_DECL void - save_override(const object_id_type & t); - BOOST_ARCHIVE_OR_WARCHIVE_DECL void - save_override(const object_reference_type & t); - BOOST_ARCHIVE_OR_WARCHIVE_DECL void - save_override(const version_type & t); - BOOST_ARCHIVE_OR_WARCHIVE_DECL void save_override(const class_id_type & t); BOOST_ARCHIVE_OR_WARCHIVE_DECL void save_override(const class_id_optional_type & t); BOOST_ARCHIVE_OR_WARCHIVE_DECL void save_override(const class_id_reference_type & t); BOOST_ARCHIVE_OR_WARCHIVE_DECL void + save_override(const object_id_type & t); + BOOST_ARCHIVE_OR_WARCHIVE_DECL void + save_override(const object_reference_type & t); + BOOST_ARCHIVE_OR_WARCHIVE_DECL void + save_override(const version_type & t); + BOOST_ARCHIVE_OR_WARCHIVE_DECL void save_override(const class_name_type & t); BOOST_ARCHIVE_OR_WARCHIVE_DECL void save_override(const tracking_type & t); diff --git a/cpp/BoostParts/boost/archive/binary_iarchive_impl.hpp b/cpp/BoostParts/boost/archive/binary_iarchive_impl.hpp index 3ff994ad83..b4747c98ec 100644 --- a/cpp/BoostParts/boost/archive/binary_iarchive_impl.hpp +++ b/cpp/BoostParts/boost/archive/binary_iarchive_impl.hpp @@ -33,7 +33,7 @@ namespace detail { } // namespace detail template -class binary_iarchive_impl : +class BOOST_SYMBOL_VISIBLE binary_iarchive_impl : public basic_binary_iprimitive, public basic_binary_iarchive { @@ -58,8 +58,9 @@ class binary_iarchive_impl : this->basic_binary_iarchive::load_override(t); } void init(unsigned int flags){ - if(0 != (flags & no_header)) + if(0 != (flags & no_header)){ return; + } #if ! defined(__MWERKS__) this->basic_binary_iarchive::init(); this->basic_binary_iprimitive::init(); diff --git a/cpp/BoostParts/boost/archive/binary_oarchive_impl.hpp b/cpp/BoostParts/boost/archive/binary_oarchive_impl.hpp index 76e3a6565b..6b4d018a56 100644 --- a/cpp/BoostParts/boost/archive/binary_oarchive_impl.hpp +++ b/cpp/BoostParts/boost/archive/binary_oarchive_impl.hpp @@ -34,7 +34,7 @@ namespace detail { } // namespace detail template -class binary_oarchive_impl : +class BOOST_SYMBOL_VISIBLE binary_oarchive_impl : public basic_binary_oprimitive, public basic_binary_oarchive { @@ -59,8 +59,9 @@ class binary_oarchive_impl : this->basic_binary_oarchive::save_override(t); } void init(unsigned int flags) { - if(0 != (flags & no_header)) + if(0 != (flags & no_header)){ return; + } #if ! defined(__MWERKS__) this->basic_binary_oarchive::init(); this->basic_binary_oprimitive::init(); diff --git a/cpp/BoostParts/boost/archive/codecvt_null.hpp b/cpp/BoostParts/boost/archive/codecvt_null.hpp index 324122b78a..9cc9e5729d 100644 --- a/cpp/BoostParts/boost/archive/codecvt_null.hpp +++ b/cpp/BoostParts/boost/archive/codecvt_null.hpp @@ -56,10 +56,11 @@ class codecvt_null : public std::codecvt explicit codecvt_null(std::size_t no_locale_manage = 0) : std::codecvt(no_locale_manage) {} + virtual ~codecvt_null(){}; }; template<> -class codecvt_null : public std::codecvt +class BOOST_SYMBOL_VISIBLE codecvt_null : public std::codecvt { virtual BOOST_WARCHIVE_DECL std::codecvt_base::result do_out( @@ -91,6 +92,7 @@ class codecvt_null : public std::codecvt explicit codecvt_null(std::size_t no_locale_manage = 0) : std::codecvt(no_locale_manage) {} + virtual ~codecvt_null(){}; }; } // namespace archive diff --git a/cpp/BoostParts/boost/archive/detail/basic_serializer.hpp b/cpp/BoostParts/boost/archive/detail/basic_serializer.hpp index c7d3b4befc..f9c4203f86 100644 --- a/cpp/BoostParts/boost/archive/detail/basic_serializer.hpp +++ b/cpp/BoostParts/boost/archive/detail/basic_serializer.hpp @@ -41,9 +41,7 @@ class basic_serializer : const boost::serialization::extended_type_info & eti ) : m_eti(& eti) - { - BOOST_ASSERT(NULL != & eti); - } + {} public: inline bool operator<(const basic_serializer & rhs) const { diff --git a/cpp/BoostParts/boost/archive/detail/common_iarchive.hpp b/cpp/BoostParts/boost/archive/detail/common_iarchive.hpp index b4c44d2767..82304f1e5a 100644 --- a/cpp/BoostParts/boost/archive/detail/common_iarchive.hpp +++ b/cpp/BoostParts/boost/archive/detail/common_iarchive.hpp @@ -35,7 +35,7 @@ class extended_type_info; // note: referred to as Curiously Recurring Template Patter (CRTP) template -class common_iarchive : +class BOOST_SYMBOL_VISIBLE common_iarchive : public basic_iarchive, public interface_iarchive { diff --git a/cpp/BoostParts/boost/archive/detail/common_oarchive.hpp b/cpp/BoostParts/boost/archive/detail/common_oarchive.hpp index 13c71bc5a8..ee42bbe597 100644 --- a/cpp/BoostParts/boost/archive/detail/common_oarchive.hpp +++ b/cpp/BoostParts/boost/archive/detail/common_oarchive.hpp @@ -32,7 +32,8 @@ namespace detail { // note: referred to as Curiously Recurring Template Patter (CRTP) template -class common_oarchive : + +class BOOST_SYMBOL_VISIBLE common_oarchive : public basic_oarchive, public interface_oarchive { diff --git a/cpp/BoostParts/boost/archive/detail/decl.hpp b/cpp/BoostParts/boost/archive/detail/decl.hpp index bb386d86f8..4f731cded3 100644 --- a/cpp/BoostParts/boost/archive/detail/decl.hpp +++ b/cpp/BoostParts/boost/archive/detail/decl.hpp @@ -29,14 +29,12 @@ #else #define BOOST_ARCHIVE_DECL BOOST_SYMBOL_IMPORT #endif + #if defined(BOOST_WARCHIVE_SOURCE) #define BOOST_WARCHIVE_DECL BOOST_SYMBOL_EXPORT #else #define BOOST_WARCHIVE_DECL BOOST_SYMBOL_IMPORT #endif - #if !defined(BOOST_WARCHIVE_SOURCE) && !defined(BOOST_ARCHIVE_SOURCE) - #define BOOST_ARCHIVE_OR_WARCHIVE_DECL BOOST_SYMBOL_IMPORT - #endif #if defined(BOOST_WARCHIVE_SOURCE) || defined(BOOST_ARCHIVE_SOURCE) #define BOOST_ARCHIVE_OR_WARCHIVE_DECL BOOST_SYMBOL_EXPORT diff --git a/cpp/BoostParts/boost/archive/detail/iserializer.hpp b/cpp/BoostParts/boost/archive/detail/iserializer.hpp index 6419e623c8..6bec499bd2 100644 --- a/cpp/BoostParts/boost/archive/detail/iserializer.hpp +++ b/cpp/BoostParts/boost/archive/detail/iserializer.hpp @@ -39,7 +39,6 @@ namespace std{ #include #include #include -#include #include #ifndef BOOST_SERIALIZATION_DEFAULT_TYPE_INFO @@ -226,15 +225,6 @@ struct heap_allocation { static T * invoke_new() { return static_cast((T::operator new)(sizeof(T))); } - template - static void deleter(void * t, std::size_t s){ - D(t, s); - } - - template - static void deleter(void * t, std::size_t s){ - D(t); - } static void invoke_delete(T * t) { // if compilation fails here, the likely cause that the class // T has a class specific new operator but no class specific @@ -244,7 +234,7 @@ struct heap_allocation { // that the class might have class specific new with NO // class specific delete at all. Patches (compatible with // C++03) welcome! - deleter(t, sizeof(T)); + delete t; } }; struct doesnt_have_new_operator { @@ -253,7 +243,7 @@ struct heap_allocation { } static void invoke_delete(T * t) { // Note: I'm reliance upon automatic conversion from T * to void * here - (operator delete)(t); + delete t; } }; static T * invoke_new() { diff --git a/cpp/BoostParts/boost/archive/detail/oserializer.hpp b/cpp/BoostParts/boost/archive/detail/oserializer.hpp index 7a7e239376..0f2e733c58 100644 --- a/cpp/BoostParts/boost/archive/detail/oserializer.hpp +++ b/cpp/BoostParts/boost/archive/detail/oserializer.hpp @@ -33,6 +33,7 @@ #include #include #include +#include #ifndef BOOST_SERIALIZATION_DEFAULT_TYPE_INFO #include diff --git a/cpp/BoostParts/boost/archive/detail/utf8_codecvt_facet.hpp b/cpp/BoostParts/boost/archive/detail/utf8_codecvt_facet.hpp index b2430d5a43..dfbec6bdfd 100644 --- a/cpp/BoostParts/boost/archive/detail/utf8_codecvt_facet.hpp +++ b/cpp/BoostParts/boost/archive/detail/utf8_codecvt_facet.hpp @@ -7,10 +7,17 @@ #ifndef BOOST_ARCHIVE_DETAIL_UTF8_CODECVT_FACET_HPP #define BOOST_ARCHIVE_DETAIL_UTF8_CODECVT_FACET_HPP -#ifdef BOOST_NO_CXX11_HDR_CODECVT +#include + +// std::codecvt_utf8 doesn't seem to work for msvc +// versions prior to MSVC 14.0 + +#if defined(_MSC_VER) && _MSC_VER < 1900 \ +|| defined( BOOST_NO_CXX11_HDR_CODECVT ) + #include #define BOOST_UTF8_BEGIN_NAMESPACE \ namespace boost { namespace archive { namespace detail { - #define BOOST_UTF8_DECL + #define BOOST_UTF8_DECL BOOST_ARCHIVE_DECL #define BOOST_UTF8_END_NAMESPACE }}} #include @@ -18,6 +25,10 @@ #undef BOOST_UTF8_END_NAMESPACE #undef BOOST_UTF8_DECL #undef BOOST_UTF8_BEGIN_NAMESPACE +#else + #include + namespace boost { namespace archive { namespace detail { + typedef std::codecvt_utf8 utf8_codecvt_facet; + } } } #endif // BOOST_NO_CXX11_HDR_CODECVT #endif // BOOST_ARCHIVE_DETAIL_UTF8_CODECVT_FACET_HPP - diff --git a/cpp/BoostParts/boost/archive/impl/basic_binary_iprimitive.ipp b/cpp/BoostParts/boost/archive/impl/basic_binary_iprimitive.ipp index bee7bafea9..7082b003e7 100644 --- a/cpp/BoostParts/boost/archive/impl/basic_binary_iprimitive.ipp +++ b/cpp/BoostParts/boost/archive/impl/basic_binary_iprimitive.ipp @@ -20,14 +20,9 @@ namespace std{ } // namespace std #endif -#include // fixup for RogueWave - #include - #include #include -#include -#include #include namespace boost { @@ -152,16 +147,13 @@ basic_binary_iprimitive::basic_binary_iprimitive( ) : #ifndef BOOST_NO_STD_LOCALE m_sb(sb), - locale_saver(m_sb) + codecvt_null_facet(1), + locale_saver(m_sb), + archive_locale(sb.getloc(), & codecvt_null_facet) { if(! no_codecvt){ - archive_locale.reset( - add_facet( - std::locale::classic(), - new codecvt_null - ) - ); - //m_sb.pubimbue(* archive_locale); + m_sb.pubsync(); + m_sb.pubimbue(archive_locale); } } #else @@ -169,42 +161,11 @@ basic_binary_iprimitive::basic_binary_iprimitive( {} #endif -// some libraries including stl and libcomo fail if the -// buffer isn't flushed before the code_cvt facet is changed. -// I think this is a bug. We explicity invoke sync to when -// we're done with the streambuf to work around this problem. -// Note that sync is a protected member of stream buff so we -// have to invoke it through a contrived derived class. -namespace detail { -// note: use "using" to get past msvc bug -using namespace std; -template -class input_streambuf_access : public std::basic_streambuf { - public: - virtual int sync(){ -#if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3206)) - return this->basic_streambuf::sync(); -#else - return this->basic_streambuf::sync(); -#endif - } -}; -} // detail - -// scoped_ptr requires that archive_locale be a complete type at time of +// scoped_ptr requires that g be a complete type at time of // destruction so define destructor here rather than in the header template BOOST_ARCHIVE_OR_WARCHIVE_DECL -basic_binary_iprimitive::~basic_binary_iprimitive(){ - // push back unread characters - //destructor can't throw ! - BOOST_TRY{ - static_cast &>(m_sb).sync(); - } - BOOST_CATCH(...){ - } - BOOST_CATCH_END -} +basic_binary_iprimitive::~basic_binary_iprimitive(){} } // namespace archive } // namespace boost diff --git a/cpp/BoostParts/boost/archive/impl/basic_binary_oprimitive.ipp b/cpp/BoostParts/boost/archive/impl/basic_binary_oprimitive.ipp index 88cc12433c..130831e4fb 100644 --- a/cpp/BoostParts/boost/archive/impl/basic_binary_oprimitive.ipp +++ b/cpp/BoostParts/boost/archive/impl/basic_binary_oprimitive.ipp @@ -27,10 +27,6 @@ namespace std{ using ::wcslen; } #endif #endif -#include - -#include -#include #include #include @@ -104,16 +100,13 @@ basic_binary_oprimitive::basic_binary_oprimitive( ) : #ifndef BOOST_NO_STD_LOCALE m_sb(sb), - locale_saver(m_sb) + codecvt_null_facet(1), + locale_saver(m_sb), + archive_locale(sb.getloc(), & codecvt_null_facet) { if(! no_codecvt){ - archive_locale.reset( - add_facet( - std::locale::classic(), - new codecvt_null - ) - ); - //m_sb.pubimbue(* archive_locale); + m_sb.pubsync(); + m_sb.pubimbue(archive_locale); } } #else @@ -121,42 +114,11 @@ basic_binary_oprimitive::basic_binary_oprimitive( {} #endif -// some libraries including stl and libcomo fail if the -// buffer isn't flushed before the code_cvt facet is changed. -// I think this is a bug. We explicity invoke sync to when -// we're done with the streambuf to work around this problem. -// Note that sync is a protected member of stream buff so we -// have to invoke it through a contrived derived class. -namespace detail { -// note: use "using" to get past msvc bug -using namespace std; -template -class output_streambuf_access : public std::basic_streambuf { - public: - virtual int sync(){ -#if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3206)) - return this->basic_streambuf::sync(); -#else - return this->basic_streambuf::sync(); -#endif - } -}; -} // detail - // scoped_ptr requires that g be a complete type at time of // destruction so define destructor here rather than in the header template BOOST_ARCHIVE_OR_WARCHIVE_DECL -basic_binary_oprimitive::~basic_binary_oprimitive(){ - // flush buffer - //destructor can't throw - BOOST_TRY{ - static_cast &>(m_sb).sync(); - } - BOOST_CATCH(...){ - } - BOOST_CATCH_END -} +basic_binary_oprimitive::~basic_binary_oprimitive(){} } // namespace archive } // namespace boost diff --git a/cpp/BoostParts/boost/archive/impl/basic_text_iprimitive.ipp b/cpp/BoostParts/boost/archive/impl/basic_text_iprimitive.ipp index e245dc540f..4e44728068 100644 --- a/cpp/BoostParts/boost/archive/impl/basic_text_iprimitive.ipp +++ b/cpp/BoostParts/boost/archive/impl/basic_text_iprimitive.ipp @@ -8,8 +8,8 @@ // See http://www.boost.org for updates, documentation, and revision history. -#include // size_t -#include // NULL +#include // size_t, NULL +#include // NULL #include #if defined(BOOST_NO_STDC_NAMESPACE) @@ -21,8 +21,6 @@ namespace std{ #include #include -#include -#include #include #include @@ -78,7 +76,7 @@ basic_text_iprimitive::load_binary( iterators::remove_whitespace< iterators::istream_iterator > - ,CharType + ,typename IStream::int_type > ,8 ,6 @@ -112,34 +110,27 @@ basic_text_iprimitive::basic_text_iprimitive( IStream &is_, bool no_codecvt ) : -#ifndef BOOST_NO_STD_LOCALE is(is_), flags_saver(is_), precision_saver(is_), - locale_saver(* is_.rdbuf()) +#ifndef BOOST_NO_STD_LOCALE + codecvt_null_facet(1), + archive_locale(is.getloc(), & codecvt_null_facet), + locale_saver(is) { if(! no_codecvt){ - archive_locale.reset( - add_facet( - std::locale::classic(), - new boost::archive::codecvt_null - ) - ); - //is.imbue(* archive_locale); + is_.sync(); + is_.imbue(archive_locale); } - is >> std::noboolalpha; + is_ >> std::noboolalpha; } #else - is(is_), - flags_saver(is_), - precision_saver(is_) {} #endif template BOOST_ARCHIVE_OR_WARCHIVE_DECL basic_text_iprimitive::~basic_text_iprimitive(){ - is.sync(); } } // namespace archive diff --git a/cpp/BoostParts/boost/archive/impl/basic_text_oprimitive.ipp b/cpp/BoostParts/boost/archive/impl/basic_text_oprimitive.ipp index f2b0a10a60..6030fd44c5 100644 --- a/cpp/BoostParts/boost/archive/impl/basic_text_oprimitive.ipp +++ b/cpp/BoostParts/boost/archive/impl/basic_text_oprimitive.ipp @@ -10,10 +10,15 @@ #include // NULL #include // std::copy +#include // std::uncaught_exception +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::size_t; +} // namespace std +#endif #include -#include -#include #include #include @@ -79,33 +84,30 @@ basic_text_oprimitive::basic_text_oprimitive( OStream & os_, bool no_codecvt ) : -#ifndef BOOST_NO_STD_LOCALE os(os_), flags_saver(os_), precision_saver(os_), - locale_saver(* os_.rdbuf()) +#ifndef BOOST_NO_STD_LOCALE + codecvt_null_facet(1), + archive_locale(os.getloc(), & codecvt_null_facet), + locale_saver(os) { if(! no_codecvt){ - archive_locale.reset( - add_facet( - std::locale::classic(), - new boost::archive::codecvt_null - ) - ); - //os.imbue(* archive_locale); + os_.flush(); + os_.imbue(archive_locale); } - os << std::noboolalpha; + os_ << std::noboolalpha; } #else - os(os_), - flags_saver(os_), - precision_saver(os_) {} #endif + template BOOST_ARCHIVE_OR_WARCHIVE_DECL basic_text_oprimitive::~basic_text_oprimitive(){ + if(std::uncaught_exception()) + return; os << std::endl; } diff --git a/cpp/BoostParts/boost/archive/impl/basic_xml_grammar.hpp b/cpp/BoostParts/boost/archive/impl/basic_xml_grammar.hpp index 70a6013abc..6d4e4683f6 100644 --- a/cpp/BoostParts/boost/archive/impl/basic_xml_grammar.hpp +++ b/cpp/BoostParts/boost/archive/impl/basic_xml_grammar.hpp @@ -163,7 +163,7 @@ class basic_xml_grammar { bool parse_end_tag(IStream & is) const; bool parse_string(IStream & is, StringType & s) /*const*/; void init(IStream & is); - void windup(IStream & is); + bool windup(IStream & is); basic_xml_grammar(); }; diff --git a/cpp/BoostParts/boost/archive/impl/basic_xml_iarchive.ipp b/cpp/BoostParts/boost/archive/impl/basic_xml_iarchive.ipp index 9e670120f0..625458b9eb 100644 --- a/cpp/BoostParts/boost/archive/impl/basic_xml_iarchive.ipp +++ b/cpp/BoostParts/boost/archive/impl/basic_xml_iarchive.ipp @@ -108,7 +108,8 @@ basic_xml_iarchive::basic_xml_iarchive(unsigned int flags) : {} template BOOST_ARCHIVE_OR_WARCHIVE_DECL -basic_xml_iarchive::~basic_xml_iarchive(){} +basic_xml_iarchive::~basic_xml_iarchive(){ +} } // namespace archive } // namespace boost diff --git a/cpp/BoostParts/boost/archive/impl/basic_xml_oarchive.ipp b/cpp/BoostParts/boost/archive/impl/basic_xml_oarchive.ipp index 5db1e13096..3184413f38 100644 --- a/cpp/BoostParts/boost/archive/impl/basic_xml_oarchive.ipp +++ b/cpp/BoostParts/boost/archive/impl/basic_xml_oarchive.ipp @@ -246,26 +246,26 @@ basic_xml_oarchive::init(){ this->This()->put(">\n"); } +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL void +basic_xml_oarchive::windup(){ + // xml_trailer + this->This()->put("\n"); +} + template BOOST_ARCHIVE_OR_WARCHIVE_DECL basic_xml_oarchive::basic_xml_oarchive(unsigned int flags) : detail::common_oarchive(flags), depth(0), - indent_next(false), - pending_preamble(false) + pending_preamble(false), + indent_next(false) { } template BOOST_ARCHIVE_OR_WARCHIVE_DECL basic_xml_oarchive::~basic_xml_oarchive(){ - if(0 == (this->get_flags() & no_header)){ - BOOST_TRY{ - this->This()->put("\n"); - } - BOOST_CATCH(...){} - BOOST_CATCH_END - } } } // namespace archive diff --git a/cpp/BoostParts/boost/archive/impl/text_oarchive_impl.ipp b/cpp/BoostParts/boost/archive/impl/text_oarchive_impl.ipp index 4ff488f4cb..37d8664a98 100644 --- a/cpp/BoostParts/boost/archive/impl/text_oarchive_impl.ipp +++ b/cpp/BoostParts/boost/archive/impl/text_oarchive_impl.ipp @@ -10,7 +10,6 @@ #include #include -#include #include // size_t #include @@ -27,7 +26,6 @@ namespace std{ using ::wcslen; } #endif #endif -#include #include namespace boost { diff --git a/cpp/BoostParts/boost/archive/impl/xml_iarchive_impl.ipp b/cpp/BoostParts/boost/archive/impl/xml_iarchive_impl.ipp index bf94774987..efc32e0163 100644 --- a/cpp/BoostParts/boost/archive/impl/xml_iarchive_impl.ipp +++ b/cpp/BoostParts/boost/archive/impl/xml_iarchive_impl.ipp @@ -11,6 +11,8 @@ #include #include // memcpy #include // NULL +#include + #if defined(BOOST_NO_STDC_NAMESPACE) namespace std{ using ::memcpy; @@ -64,22 +66,22 @@ xml_iarchive_impl::load(std::wstring &ws){ #if BOOST_WORKAROUND(_RWSTD_VER, BOOST_TESTED_AT(20101)) if(NULL != ws.data()) #endif - ws.resize(0); - std::mbstate_t mbs; + ws.resize(0); + std::mbstate_t mbs = std::mbstate_t(); const char * start = s.data(); const char * end = start + s.size(); while(start < end){ wchar_t wc; - std::size_t result = std::mbrtowc(&wc, start, end - start, &mbs); - if(result == static_cast(-1)) + std::size_t count = std::mbrtowc(&wc, start, end - start, &mbs); + if(count == static_cast(-1)) boost::serialization::throw_exception( iterators::dataflow_exception( iterators::dataflow_exception::invalid_conversion ) ); - if(result == static_cast(-2)) + if(count == static_cast(-2)) continue; - start += result; + start += count; ws += wc; } } @@ -98,7 +100,7 @@ xml_iarchive_impl::load(wchar_t * ws){ ) ); - std::mbstate_t mbs; + std::mbstate_t mbs = std::mbstate_t(); const char * start = s.data(); const char * end = start + s.size(); while(start < end){ @@ -187,12 +189,10 @@ xml_iarchive_impl::xml_iarchive_impl( template BOOST_ARCHIVE_DECL xml_iarchive_impl::~xml_iarchive_impl(){ + if(std::uncaught_exception()) + return; if(0 == (this->get_flags() & no_header)){ - BOOST_TRY{ - gimpl->windup(is); - } - BOOST_CATCH(...){} - BOOST_CATCH_END + gimpl->windup(is); } } } // namespace archive diff --git a/cpp/BoostParts/boost/archive/impl/xml_oarchive_impl.ipp b/cpp/BoostParts/boost/archive/impl/xml_oarchive_impl.ipp index 9e714f3ca6..5ebd454e72 100644 --- a/cpp/BoostParts/boost/archive/impl/xml_oarchive_impl.ipp +++ b/cpp/BoostParts/boost/archive/impl/xml_oarchive_impl.ipp @@ -10,6 +10,7 @@ #include #include // std::copy #include +#include #include // strlen #include // msvc 6.0 needs this to suppress warnings @@ -113,5 +114,29 @@ xml_oarchive_impl::xml_oarchive_impl( this->init(); } +template +BOOST_ARCHIVE_DECL void +xml_oarchive_impl::save_binary(const void *address, std::size_t count){ + this->end_preamble(); + #if ! defined(__MWERKS__) + this->basic_text_oprimitive::save_binary( + #else + this->basic_text_oprimitive::save_binary( + #endif + address, + count + ); + this->indent_next = true; +} + +template +BOOST_ARCHIVE_DECL +xml_oarchive_impl::~xml_oarchive_impl(){ + if(std::uncaught_exception()) + return; + if(0 == (this->get_flags() & no_header)) + this->windup(); +} + } // namespace archive } // namespace boost diff --git a/cpp/BoostParts/boost/archive/impl/xml_wiarchive_impl.ipp b/cpp/BoostParts/boost/archive/impl/xml_wiarchive_impl.ipp index a837347edb..ee66c1263e 100644 --- a/cpp/BoostParts/boost/archive/impl/xml_wiarchive_impl.ipp +++ b/cpp/BoostParts/boost/archive/impl/xml_wiarchive_impl.ipp @@ -20,7 +20,7 @@ namespace std{ #include #include // std::copy - +#include // uncaught exception #include // Dinkumware and RogueWave #if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) #include @@ -33,11 +33,11 @@ namespace std{ #include #include -#include - #include #include +#include + #include "basic_xml_grammar.hpp" namespace boost { @@ -161,15 +161,13 @@ xml_wiarchive_impl::xml_wiarchive_impl( gimpl(new xml_wgrammar()) { if(0 == (flags & no_codecvt)){ - // note usage of argument "1" so that the locale isn't - // automatically delete the facet - archive_locale.reset( - add_facet( - is_.getloc(), - new boost::archive::detail::utf8_codecvt_facet - ) + std::locale l = std::locale( + is_.getloc(), + new boost::archive::detail::utf8_codecvt_facet ); - //is.imbue(* archive_locale); + // libstdc++ crashes without this + is_.sync(); + is_.imbue(l); } if(0 == (flags & no_header)) init(); @@ -178,12 +176,10 @@ xml_wiarchive_impl::xml_wiarchive_impl( template BOOST_WARCHIVE_DECL xml_wiarchive_impl::~xml_wiarchive_impl(){ + if(std::uncaught_exception()) + return; if(0 == (this->get_flags() & no_header)){ - BOOST_TRY{ - gimpl->windup(is); - } - BOOST_CATCH(...){} - BOOST_CATCH_END + gimpl->windup(is); } } diff --git a/cpp/BoostParts/boost/archive/impl/xml_woarchive_impl.ipp b/cpp/BoostParts/boost/archive/impl/xml_woarchive_impl.ipp index d5586d51ae..58f92c9d92 100644 --- a/cpp/BoostParts/boost/archive/impl/xml_woarchive_impl.ipp +++ b/cpp/BoostParts/boost/archive/impl/xml_woarchive_impl.ipp @@ -13,6 +13,7 @@ #include #include // std::copy #include +#include #include // strlen #include // mbtowc @@ -30,6 +31,8 @@ namespace std{ #endif #include +#include + #include #include @@ -37,8 +40,6 @@ namespace std{ #include #include -#include - namespace boost { namespace archive { @@ -122,19 +123,13 @@ xml_woarchive_impl::xml_woarchive_impl( ), basic_xml_oarchive(flags) { - // Standard behavior is that imbue can be called - // a) before output is invoked or - // b) after flush has been called. This prevents one-to-many - // transforms (such as one to many transforms from getting - // mixed up. if(0 == (flags & no_codecvt)){ - archive_locale.reset( - add_facet( - os_.getloc(), - new boost::archive::detail::utf8_codecvt_facet - ) + std::locale l = std::locale( + os_.getloc(), + new boost::archive::detail::utf8_codecvt_facet ); - //os.imbue(* archive_locale); + os_.flush(); + os_.imbue(l); } if(0 == (flags & no_header)) this->init(); @@ -143,6 +138,29 @@ xml_woarchive_impl::xml_woarchive_impl( template BOOST_WARCHIVE_DECL xml_woarchive_impl::~xml_woarchive_impl(){ + if(std::uncaught_exception()) + return; + if(0 == (this->get_flags() & no_header)){ + save(L"\n"); + } +} + +template +BOOST_WARCHIVE_DECL void +xml_woarchive_impl::save_binary( + const void *address, + std::size_t count +){ + this->end_preamble(); + #if ! defined(__MWERKS__) + this->basic_text_oprimitive::save_binary( + #else + this->basic_text_oprimitive::save_binary( + #endif + address, + count + ); + this->indent_next = true; } } // namespace archive diff --git a/cpp/BoostParts/boost/archive/iterators/istream_iterator.hpp b/cpp/BoostParts/boost/archive/iterators/istream_iterator.hpp index 41aa0be37b..9a1d555c10 100644 --- a/cpp/BoostParts/boost/archive/iterators/istream_iterator.hpp +++ b/cpp/BoostParts/boost/archive/iterators/istream_iterator.hpp @@ -54,21 +54,6 @@ class istream_iterator : return m_istream == rhs.m_istream; } -/* - //Access the value referred to - Elem dereference() const { - return m_current_value; - } - - void increment(){ - if(NULL != m_istream){ - m_current_value = static_cast(m_istream->get()); - if(! m_istream->good()){ - const_cast(this)->m_istream = NULL; - } - } - } -*/ //Access the value referred to Elem dereference() const { return m_istream->peek(); diff --git a/cpp/BoostParts/boost/archive/iterators/mb_from_wchar.hpp b/cpp/BoostParts/boost/archive/iterators/mb_from_wchar.hpp index d76eb3e2d2..d5110de28a 100644 --- a/cpp/BoostParts/boost/archive/iterators/mb_from_wchar.hpp +++ b/cpp/BoostParts/boost/archive/iterators/mb_from_wchar.hpp @@ -18,17 +18,15 @@ #include #include // size_t -#include // for mbstate_t and wcrtomb() +#include // mbstate_t #include #if defined(BOOST_NO_STDC_NAMESPACE) namespace std{ - using ::size_t; using ::mbstate_t; - using ::wcrtomb; } // namespace std #endif - +#include #include namespace boost { @@ -67,10 +65,10 @@ class mb_from_wchar } return m_buffer[m_bnext]; } + char dereference() const { return (const_cast(this))->dereference_impl(); } - // test for iterator equality bool equal(const mb_from_wchar & rhs) const { // once the value is filled, the base_reference has been incremented @@ -83,14 +81,17 @@ class mb_from_wchar } void fill(){ - std::mbstate_t mbs; - std::wcrtomb(0, 0, &mbs); wchar_t value = * this->base_reference(); - m_bend = std::wcrtomb(m_buffer, value, &mbs); - BOOST_ASSERT(-1 != m_bend); - BOOST_ASSERT((std::size_t)m_bend <= sizeof(m_buffer)); - BOOST_ASSERT(m_bend > 0); + const wchar_t *wend; + char *bend; + std::codecvt_base::result r = m_codecvt_facet.out( + m_mbs, + & value, & value + 1, wend, + m_buffer, m_buffer + sizeof(m_buffer), bend + ); + BOOST_ASSERT(std::codecvt_base::ok == r); m_bnext = 0; + m_bend = bend - m_buffer; } void increment(){ @@ -102,10 +103,12 @@ class mb_from_wchar m_full = false; } + boost::archive::detail::utf8_codecvt_facet m_codecvt_facet; + std::mbstate_t m_mbs; // buffer to handle pending characters - int m_bend; - int m_bnext; - char m_buffer[9]; + char m_buffer[9 /* MB_CUR_MAX */]; + std::size_t m_bend; + std::size_t m_bnext; bool m_full; public: @@ -113,6 +116,7 @@ class mb_from_wchar template mb_from_wchar(T start) : super_t(Base(static_cast< T >(start))), + m_mbs(std::mbstate_t()), m_bend(0), m_bnext(0), m_full(false) diff --git a/cpp/BoostParts/boost/archive/iterators/wchar_from_mb.hpp b/cpp/BoostParts/boost/archive/iterators/wchar_from_mb.hpp index 998a4686b2..52a44bdc79 100644 --- a/cpp/BoostParts/boost/archive/iterators/wchar_from_mb.hpp +++ b/cpp/BoostParts/boost/archive/iterators/wchar_from_mb.hpp @@ -19,20 +19,22 @@ #include #include #include // size_t -#include // mbstate_t and mbrtowc +#include // mbstate_t +#include // copy #include #if defined(BOOST_NO_STDC_NAMESPACE) namespace std{ using ::mbstate_t; - using ::mbrtowc; } // namespace std #endif - -#include - +#include #include +#include #include +#include + +#include namespace boost { namespace archive { @@ -62,57 +64,125 @@ class wchar_from_mb typedef wchar_from_mb this_t; - wchar_t drain(); + void drain(); - wchar_t dereference_impl() { - if(! m_full){ - m_current_value = drain(); - m_full = true; + wchar_t dereference() const { + if(m_output.m_next == m_output.m_next_available) + return static_cast(0); + return * m_output.m_next; + } + + void increment(){ + if(m_output.m_next == m_output.m_next_available) + return; + if(++m_output.m_next == m_output.m_next_available){ + if(m_input.m_done) + return; + drain(); } - return m_current_value; } - wchar_t dereference() const { - return const_cast(this)->dereference_impl(); + bool equal(this_t const & rhs) const { + return dereference() == rhs.dereference(); } - void increment(){ - dereference_impl(); - m_full = false; - ++(this->base_reference()); + boost::archive::detail::utf8_codecvt_facet m_codecvt_facet; + std::mbstate_t m_mbs; + + template + struct sliding_buffer { + boost::array m_buffer; + typename boost::array::const_iterator m_next_available; + typename boost::array::iterator m_next; + bool m_done; + // default ctor + sliding_buffer() : + m_next_available(m_buffer.begin()), + m_next(m_buffer.begin()), + m_done(false) + {} + // copy ctor + sliding_buffer(const sliding_buffer & rhs) : + m_next_available( + std::copy( + rhs.m_buffer.begin(), + rhs.m_next_available, + m_buffer.begin() + ) + ), + m_next( + m_buffer.begin() + (rhs.m_next - rhs.m_buffer.begin()) + ), + m_done(rhs.m_done) + {} }; - wchar_t m_current_value; - bool m_full; + sliding_buffer::type> m_input; + sliding_buffer::type> m_output; public: // make composible buy using templated constructor template wchar_from_mb(T start) : super_t(Base(static_cast< T >(start))), - m_full(false) - {} - // intel 7.1 doesn't like default copy constructor - wchar_from_mb(const wchar_from_mb & rhs) : + m_mbs(std::mbstate_t()) + { + BOOST_ASSERT(std::mbsinit(&m_mbs)); + drain(); + } + // default constructor used as an end iterator + wchar_from_mb(){} + + // copy ctor + wchar_from_mb(const wchar_from_mb & rhs) : super_t(rhs.base_reference()), - m_full(rhs.m_full) + m_mbs(rhs.m_mbs), + m_input(rhs.m_input), + m_output(rhs.m_output) {} }; template -wchar_t wchar_from_mb::drain(){ - std::mbstate_t mbs; - wchar_t retval; - std::size_t result; - do { - char val = *this->base_reference(); - result = std::mbrtowc(&retval, &val, 1, &mbs); - if(result == static_cast(-1)) - boost::serialization::throw_exception(iterators::dataflow_exception( - iterators::dataflow_exception::invalid_conversion - )); - } while (result == static_cast(-2)); - return retval; +void wchar_from_mb::drain(){ + BOOST_ASSERT(! m_input.m_done); + for(;;){ + typename boost::iterators::iterator_reference::type c = *(this->base_reference()); + // a null character in a multibyte stream is takes as end of string + if(0 == c){ + m_input.m_done = true; + break; + } + ++(this->base_reference()); + * const_cast::type *>( + (m_input.m_next_available++) + ) = c; + // if input buffer is full - we're done for now + if(m_input.m_buffer.end() == m_input.m_next_available) + break; + } + const typename boost::iterators::iterator_value::type * input_new_start; + typename iterator_value::type * next_available; + + std::codecvt_base::result r = m_codecvt_facet.in( + m_mbs, + m_input.m_buffer.begin(), + m_input.m_next_available, + input_new_start, + m_output.m_buffer.begin(), + m_output.m_buffer.end(), + next_available + ); + BOOST_ASSERT(std::codecvt_base::ok == r); + m_output.m_next_available = next_available; + m_output.m_next = m_output.m_buffer.begin(); + + // we're done with some of the input so shift left. + m_input.m_next_available = std::copy( + input_new_start, + m_input.m_next_available, + m_input.m_buffer.begin() + ); + m_input.m_next = m_input.m_buffer.begin(); } } // namespace iterators diff --git a/cpp/BoostParts/boost/archive/text_iarchive.hpp b/cpp/BoostParts/boost/archive/text_iarchive.hpp index e40db8371d..d9d60adf0b 100644 --- a/cpp/BoostParts/boost/archive/text_iarchive.hpp +++ b/cpp/BoostParts/boost/archive/text_iarchive.hpp @@ -48,15 +48,8 @@ class BOOST_SYMBOL_VISIBLE text_iarchive_impl : public: #else protected: - #if BOOST_WORKAROUND(BOOST_MSVC, < 1500) - // for some inexplicable reason insertion of "class" generates compile erro - // on msvc 7.1 - friend detail::interface_iarchive; - friend load_access; - #else - friend class detail::interface_iarchive; - friend class load_access; - #endif + friend class detail::interface_iarchive; + friend class load_access; #endif template void load(T & t){ diff --git a/cpp/BoostParts/boost/archive/text_oarchive.hpp b/cpp/BoostParts/boost/archive/text_oarchive.hpp index 7eaea17232..9ba0dafffb 100644 --- a/cpp/BoostParts/boost/archive/text_oarchive.hpp +++ b/cpp/BoostParts/boost/archive/text_oarchive.hpp @@ -55,17 +55,9 @@ class BOOST_SYMBOL_VISIBLE text_oarchive_impl : public: #else protected: - #if BOOST_WORKAROUND(BOOST_MSVC, < 1500) - // for some inexplicable reason insertion of "class" generates compile erro - // on msvc 7.1 - friend detail::interface_oarchive; - friend basic_text_oarchive; - friend save_access; - #else - friend class detail::interface_oarchive; - friend class basic_text_oarchive; - friend class save_access; - #endif + friend class detail::interface_oarchive; + friend class basic_text_oarchive; + friend class save_access; #endif template void save(const T & t){ diff --git a/cpp/BoostParts/boost/archive/xml_iarchive.hpp b/cpp/BoostParts/boost/archive/xml_iarchive.hpp index 055ba0f426..abd2f9fc4e 100644 --- a/cpp/BoostParts/boost/archive/xml_iarchive.hpp +++ b/cpp/BoostParts/boost/archive/xml_iarchive.hpp @@ -52,17 +52,9 @@ class BOOST_SYMBOL_VISIBLE xml_iarchive_impl : public: #else protected: - #if BOOST_WORKAROUND(BOOST_MSVC, < 1500) - // for some inexplicable reason insertion of "class" generates compile erro - // on msvc 7.1 - friend detail::interface_iarchive; - friend basic_xml_iarchive; - friend load_access; - #else - friend class detail::interface_iarchive; - friend class basic_xml_iarchive; - friend class load_access; - #endif + friend class detail::interface_iarchive; + friend class basic_xml_iarchive; + friend class load_access; #endif // use boost:scoped_ptr to implement automatic deletion; boost::scoped_ptr gimpl; diff --git a/cpp/BoostParts/boost/archive/xml_oarchive.hpp b/cpp/BoostParts/boost/archive/xml_oarchive.hpp index c5e6da9271..eea1268037 100644 --- a/cpp/BoostParts/boost/archive/xml_oarchive.hpp +++ b/cpp/BoostParts/boost/archive/xml_oarchive.hpp @@ -55,21 +55,10 @@ class BOOST_SYMBOL_VISIBLE xml_oarchive_impl : public: #else protected: - #if BOOST_WORKAROUND(BOOST_MSVC, < 1500) - // for some inexplicable reason insertion of "class" generates compile erro - // on msvc 7.1 - friend detail::interface_oarchive; - friend basic_xml_oarchive; - friend save_access; - #else - friend class detail::interface_oarchive; - friend class basic_xml_oarchive; - friend class save_access; - #endif + friend class detail::interface_oarchive; + friend class basic_xml_oarchive; + friend class save_access; #endif - //void end_preamble(){ - // basic_xml_oarchive::end_preamble(); - //} template void save(const T & t){ basic_text_oprimitive::save(t); @@ -96,22 +85,29 @@ class BOOST_SYMBOL_VISIBLE xml_oarchive_impl : #endif BOOST_ARCHIVE_DECL xml_oarchive_impl(std::ostream & os, unsigned int flags); - ~xml_oarchive_impl(){} + BOOST_ARCHIVE_DECL + ~xml_oarchive_impl(); public: - void save_binary(const void *address, std::size_t count){ - this->end_preamble(); - #if ! defined(__MWERKS__) - this->basic_text_oprimitive::save_binary( - #else - this->basic_text_oprimitive::save_binary( - #endif - address, - count - ); - this->indent_next = true; - } + BOOST_ARCHIVE_DECL + void save_binary(const void *address, std::size_t count); }; +} // namespace archive +} // namespace boost + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +#include // pops abi_suffix.hpp pragmas +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace boost { +namespace archive { + // we use the following because we can't use // typedef xml_oarchive_impl > xml_oarchive; @@ -138,6 +134,4 @@ BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::xml_oarchive) #pragma warning(pop) #endif -#include // pops abi_suffix.hpp pragmas - #endif // BOOST_ARCHIVE_XML_OARCHIVE_HPP diff --git a/cpp/BoostParts/boost/archive/xml_wiarchive.hpp b/cpp/BoostParts/boost/archive/xml_wiarchive.hpp index dbc2d721a4..ac24289ac1 100644 --- a/cpp/BoostParts/boost/archive/xml_wiarchive.hpp +++ b/cpp/BoostParts/boost/archive/xml_wiarchive.hpp @@ -29,15 +29,7 @@ #include #include #include - -#ifdef BOOST_NO_CXX11_HDR_CODECVT - #include -#else - #include - namespace boost { namespace archive { namespace detail { - typedef std::codecvt_utf8 utf8_codecvt_facet; - } } } -#endif +// #include #include // must be the last header @@ -66,17 +58,9 @@ class BOOST_SYMBOL_VISIBLE xml_wiarchive_impl : public: #else protected: - #if BOOST_WORKAROUND(BOOST_MSVC, < 1500) - // for some inexplicable reason insertion of "class" generates compile erro - // on msvc 7.1 - friend detail::interface_iarchive; - friend basic_xml_iarchive; - friend load_access; - #else - friend class detail::interface_iarchive; - friend class basic_xml_iarchive; - friend class load_access; - #endif + friend class detail::interface_iarchive; + friend class basic_xml_iarchive; + friend class load_access; #endif boost::scoped_ptr gimpl; std::wistream & get_is(){ diff --git a/cpp/BoostParts/boost/archive/xml_woarchive.hpp b/cpp/BoostParts/boost/archive/xml_woarchive.hpp index 62700162d7..cb7ce68cb6 100644 --- a/cpp/BoostParts/boost/archive/xml_woarchive.hpp +++ b/cpp/BoostParts/boost/archive/xml_woarchive.hpp @@ -20,7 +20,6 @@ #ifdef BOOST_NO_STD_WSTREAMBUF #error "wide char i/o not supported on this platform" #else - #include // size_t #if defined(BOOST_NO_STDC_NAMESPACE) namespace std{ @@ -30,21 +29,13 @@ namespace std{ #include -#include +//#include #include #include #include #include #include - -#ifdef BOOST_NO_CXX11_HDR_CODECVT - #include -#else - #include - namespace boost { namespace archive { namespace detail { - typedef std::codecvt_utf8 utf8_codecvt_facet; - } } } -#endif +//#include #include // must be the last header @@ -69,27 +60,19 @@ class BOOST_SYMBOL_VISIBLE xml_woarchive_impl : public: #else protected: - #if BOOST_WORKAROUND(BOOST_MSVC, < 1500) - // for some inexplicable reason insertion of "class" generates compile erro - // on msvc 7.1 - friend detail::interface_oarchive; - friend basic_xml_oarchive; - friend save_access; - #else - friend class detail::interface_oarchive; - friend class basic_xml_oarchive; - friend class save_access; - #endif + friend class detail::interface_oarchive; + friend class basic_xml_oarchive; + friend class save_access; #endif //void end_preamble(){ // basic_xml_oarchive::end_preamble(); //} template - void + void save(const T & t){ basic_text_oprimitive::save(t); } - void + void save(const version_type & t){ save(static_cast(t)); } @@ -111,22 +94,12 @@ class BOOST_SYMBOL_VISIBLE xml_woarchive_impl : #endif BOOST_WARCHIVE_DECL xml_woarchive_impl(std::wostream & os, unsigned int flags); - BOOST_WARCHIVE_DECL + BOOST_WARCHIVE_DECL ~xml_woarchive_impl(); public: - void - save_binary(const void *address, std::size_t count){ - this->end_preamble(); - #if ! defined(__MWERKS__) - this->basic_text_oprimitive::save_binary( - #else - this->basic_text_oprimitive::save_binary( - #endif - address, - count - ); - this->indent_next = true; - } + BOOST_WARCHIVE_DECL void + save_binary(const void *address, std::size_t count); + }; // we use the following because we can't use @@ -135,7 +108,7 @@ class BOOST_SYMBOL_VISIBLE xml_woarchive_impl : // do not derive from this class. If you want to extend this functionality // via inhertance, derived from xml_woarchive_impl instead. This will // preserve correct static polymorphism. -class BOOST_SYMBOL_VISIBLE xml_woarchive : +class BOOST_SYMBOL_VISIBLE xml_woarchive : public xml_woarchive_impl { public: diff --git a/cpp/BoostParts/boost/atomic/detail/ops_emulated.hpp b/cpp/BoostParts/boost/atomic/detail/ops_emulated.hpp index 0dc4e6828a..17032917fe 100644 --- a/cpp/BoostParts/boost/atomic/detail/ops_emulated.hpp +++ b/cpp/BoostParts/boost/atomic/detail/ops_emulated.hpp @@ -89,7 +89,7 @@ struct emulated_operations } static BOOST_FORCEINLINE bool compare_exchange_weak( - storage_type volatile& storage, storage_type& expected, storage_type desired, memory_order success_order, memory_order failure_order) BOOST_NOEXCEPT + storage_type volatile& storage, storage_type& expected, storage_type desired, memory_order, memory_order) BOOST_NOEXCEPT { // Note: This function is the exact copy of compare_exchange_strong. The reason we're not just forwarding the call // is that MSVC-12 ICEs in this case. diff --git a/cpp/BoostParts/boost/atomic/detail/ops_gcc_x86_dcas.hpp b/cpp/BoostParts/boost/atomic/detail/ops_gcc_x86_dcas.hpp index f7a84f79ce..47cc36d8e7 100644 --- a/cpp/BoostParts/boost/atomic/detail/ops_gcc_x86_dcas.hpp +++ b/cpp/BoostParts/boost/atomic/detail/ops_gcc_x86_dcas.hpp @@ -522,7 +522,7 @@ struct gcc_dcas_x86_64 return compare_exchange_strong(storage, expected, desired, success_order, failure_order); } - static BOOST_FORCEINLINE storage_type exchange(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT + static BOOST_FORCEINLINE storage_type exchange(storage_type volatile& storage, storage_type v, memory_order) BOOST_NOEXCEPT { #if defined(__clang__) // Clang cannot allocate eax:edx register pairs but it has sync intrinsics diff --git a/cpp/BoostParts/boost/config/compiler/clang.hpp b/cpp/BoostParts/boost/config/compiler/clang.hpp index 5481e5ee62..01355bb7d5 100644 --- a/cpp/BoostParts/boost/config/compiler/clang.hpp +++ b/cpp/BoostParts/boost/config/compiler/clang.hpp @@ -57,16 +57,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 diff --git a/cpp/BoostParts/boost/config/compiler/gcc.hpp b/cpp/BoostParts/boost/config/compiler/gcc.hpp index d9dd59dc5f..fbd3dd9c19 100644 --- a/cpp/BoostParts/boost/config/compiler/gcc.hpp +++ b/cpp/BoostParts/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 diff --git a/cpp/BoostParts/boost/config/compiler/intel.hpp b/cpp/BoostParts/boost/config/compiler/intel.hpp index 7789b94464..88ac023acc 100644 --- a/cpp/BoostParts/boost/config/compiler/intel.hpp +++ b/cpp/BoostParts/boost/config/compiler/intel.hpp @@ -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/cpp/BoostParts/boost/config/compiler/nvcc.hpp b/cpp/BoostParts/boost/config/compiler/nvcc.hpp index bbe81f6ee5..5a047070af 100644 --- a/cpp/BoostParts/boost/config/compiler/nvcc.hpp +++ b/cpp/BoostParts/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/cpp/BoostParts/boost/config/stdlib/libcpp.hpp b/cpp/BoostParts/boost/config/stdlib/libcpp.hpp index ab5d123544..645bb63bfc 100644 --- a/cpp/BoostParts/boost/config/stdlib/libcpp.hpp +++ b/cpp/BoostParts/boost/config/stdlib/libcpp.hpp @@ -53,19 +53,27 @@ # 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 defined(__has_include) #if !__has_include() diff --git a/cpp/BoostParts/boost/container/allocator_traits.hpp b/cpp/BoostParts/boost/container/allocator_traits.hpp index b515af6180..e6a882e594 100644 --- a/cpp/BoostParts/boost/container/allocator_traits.hpp +++ b/cpp/BoostParts/boost/container/allocator_traits.hpp @@ -77,6 +77,9 @@ namespace container { #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED +template +class small_vector_allocator; + namespace allocator_traits_detail { BOOST_INTRUSIVE_HAS_STATIC_MEMBER_FUNC_SIGNATURE(has_max_size, max_size) @@ -96,6 +99,10 @@ template struct is_std_allocator< std::allocator > { static const bool value = true; }; +template +struct is_std_allocator< small_vector_allocator< std::allocator > > +{ static const bool value = true; }; + template struct is_not_std_allocator { static const bool value = !is_std_allocator::value; }; diff --git a/cpp/BoostParts/boost/container/detail/config_begin.hpp b/cpp/BoostParts/boost/container/detail/config_begin.hpp index 7e3e03fa64..4df9e35d8b 100644 --- a/cpp/BoostParts/boost/container/detail/config_begin.hpp +++ b/cpp/BoostParts/boost/container/detail/config_begin.hpp @@ -45,7 +45,9 @@ #pragma warning (disable : 4702) // unreachable code #pragma warning (disable : 4706) // assignment within conditional expression #pragma warning (disable : 4710) // function not inlined + #pragma warning (disable : 4714) // "function": marked as __forceinline not inlined #pragma warning (disable : 4711) // function selected for automatic inline expansion #pragma warning (disable : 4786) // identifier truncated in debug info #pragma warning (disable : 4996) // "function": was declared deprecated + #endif //BOOST_MSVC diff --git a/cpp/BoostParts/boost/container/detail/iterators.hpp b/cpp/BoostParts/boost/container/detail/iterators.hpp index e8cfcf97a4..32ff32f362 100644 --- a/cpp/BoostParts/boost/container/detail/iterators.hpp +++ b/cpp/BoostParts/boost/container/detail/iterators.hpp @@ -377,7 +377,7 @@ class default_init_construct_iterator template class repeat_iterator : public ::boost::container::iterator - + { typedef repeat_iterator this_type; public: @@ -493,13 +493,13 @@ class emplace_iterator public: typedef Difference difference_type; - explicit emplace_iterator(EmplaceFunctor&e) + BOOST_CONTAINER_FORCEINLINE explicit emplace_iterator(EmplaceFunctor&e) : m_num(1), m_pe(&e){} - emplace_iterator() + BOOST_CONTAINER_FORCEINLINE emplace_iterator() : m_num(0), m_pe(0){} - this_type& operator++() + BOOST_CONTAINER_FORCEINLINE this_type& operator++() { increment(); return *this; } this_type operator++(int) @@ -509,7 +509,7 @@ class emplace_iterator return result; } - this_type& operator--() + BOOST_CONTAINER_FORCEINLINE this_type& operator--() { decrement(); return *this; } this_type operator--(int) @@ -519,29 +519,29 @@ class emplace_iterator return result; } - friend bool operator== (const this_type& i, const this_type& i2) + BOOST_CONTAINER_FORCEINLINE friend bool operator== (const this_type& i, const this_type& i2) { return i.equal(i2); } - friend bool operator!= (const this_type& i, const this_type& i2) + BOOST_CONTAINER_FORCEINLINE friend bool operator!= (const this_type& i, const this_type& i2) { return !(i == i2); } - friend bool operator< (const this_type& i, const this_type& i2) + BOOST_CONTAINER_FORCEINLINE friend bool operator< (const this_type& i, const this_type& i2) { return i.less(i2); } - friend bool operator> (const this_type& i, const this_type& i2) + BOOST_CONTAINER_FORCEINLINE friend bool operator> (const this_type& i, const this_type& i2) { return i2 < i; } - friend bool operator<= (const this_type& i, const this_type& i2) + BOOST_CONTAINER_FORCEINLINE friend bool operator<= (const this_type& i, const this_type& i2) { return !(i > i2); } - friend bool operator>= (const this_type& i, const this_type& i2) + BOOST_CONTAINER_FORCEINLINE friend bool operator>= (const this_type& i, const this_type& i2) { return !(i < i2); } - friend difference_type operator- (const this_type& i, const this_type& i2) + BOOST_CONTAINER_FORCEINLINE friend difference_type operator- (const this_type& i, const this_type& i2) { return i2.distance_to(i); } //Arithmetic - this_type& operator+=(difference_type off) + BOOST_CONTAINER_FORCEINLINE this_type& operator+=(difference_type off) { this->advance(off); return *this; } this_type operator+(difference_type off) const @@ -551,13 +551,13 @@ class emplace_iterator return other; } - friend this_type operator+(difference_type off, const this_type& right) + BOOST_CONTAINER_FORCEINLINE friend this_type operator+(difference_type off, const this_type& right) { return right + off; } - this_type& operator-=(difference_type off) + BOOST_CONTAINER_FORCEINLINE this_type& operator-=(difference_type off) { this->advance(-off); return *this; } - this_type operator-(difference_type off) const + BOOST_CONTAINER_FORCEINLINE this_type operator-(difference_type off) const { return *this + (-off); } //This pseudo-iterator's dereference operations have no sense since value is not @@ -575,28 +575,28 @@ class emplace_iterator difference_type m_num; EmplaceFunctor * m_pe; - void increment() + BOOST_CONTAINER_FORCEINLINE void increment() { --m_num; } - void decrement() + BOOST_CONTAINER_FORCEINLINE void decrement() { ++m_num; } - bool equal(const this_type &other) const + BOOST_CONTAINER_FORCEINLINE bool equal(const this_type &other) const { return m_num == other.m_num; } - bool less(const this_type &other) const + BOOST_CONTAINER_FORCEINLINE bool less(const this_type &other) const { return other.m_num < m_num; } - const T & dereference() const + BOOST_CONTAINER_FORCEINLINE const T & dereference() const { static T dummy; return dummy; } - void advance(difference_type n) + BOOST_CONTAINER_FORCEINLINE void advance(difference_type n) { m_num -= n; } - difference_type distance_to(const this_type &other)const + BOOST_CONTAINER_FORCEINLINE difference_type distance_to(const this_type &other)const { return difference_type(m_num - other.m_num); } }; @@ -616,7 +616,7 @@ struct emplace_functor { emplace_functor::inplace_impl(a, ptr, index_tuple_t()); } template - void inplace_impl(Allocator &a, T* ptr, const container_detail::index_tuple&) + BOOST_CONTAINER_FORCEINLINE void inplace_impl(Allocator &a, T* ptr, const container_detail::index_tuple&) { allocator_traits::construct (a, ptr, ::boost::forward(container_detail::get(args_))...); @@ -762,54 +762,54 @@ class iterator_from_iiterator typedef typename types_t::iterator_category iterator_category; typedef typename types_t::value_type value_type; - iterator_from_iiterator() + BOOST_CONTAINER_FORCEINLINE iterator_from_iiterator() {} - explicit iterator_from_iiterator(IIterator iit) BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE explicit iterator_from_iiterator(IIterator iit) BOOST_NOEXCEPT_OR_NOTHROW : m_iit(iit) {} - iterator_from_iiterator(iterator_from_iiterator const& other) BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE iterator_from_iiterator(iterator_from_iiterator const& other) BOOST_NOEXCEPT_OR_NOTHROW : m_iit(other.get()) {} - iterator_from_iiterator& operator++() BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE iterator_from_iiterator& operator++() BOOST_NOEXCEPT_OR_NOTHROW { ++this->m_iit; return *this; } - iterator_from_iiterator operator++(int) BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE iterator_from_iiterator operator++(int) BOOST_NOEXCEPT_OR_NOTHROW { iterator_from_iiterator result (*this); ++this->m_iit; return result; } - iterator_from_iiterator& operator--() BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE iterator_from_iiterator& operator--() BOOST_NOEXCEPT_OR_NOTHROW { //If the iterator_from_iiterator is not a bidirectional iterator, operator-- should not exist BOOST_STATIC_ASSERT((is_bidirectional_iterator::value)); --this->m_iit; return *this; } - iterator_from_iiterator operator--(int) BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE iterator_from_iiterator operator--(int) BOOST_NOEXCEPT_OR_NOTHROW { iterator_from_iiterator result (*this); --this->m_iit; return result; } - friend bool operator== (const iterator_from_iiterator& l, const iterator_from_iiterator& r) BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE friend bool operator== (const iterator_from_iiterator& l, const iterator_from_iiterator& r) BOOST_NOEXCEPT_OR_NOTHROW { return l.m_iit == r.m_iit; } - friend bool operator!= (const iterator_from_iiterator& l, const iterator_from_iiterator& r) BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE friend bool operator!= (const iterator_from_iiterator& l, const iterator_from_iiterator& r) BOOST_NOEXCEPT_OR_NOTHROW { return !(l == r); } - reference operator*() const BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE reference operator*() const BOOST_NOEXCEPT_OR_NOTHROW { return this->m_iit->get_data(); } - pointer operator->() const BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE pointer operator->() const BOOST_NOEXCEPT_OR_NOTHROW { return ::boost::intrusive::pointer_traits::pointer_to(this->operator*()); } - const IIterator &get() const BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE const IIterator &get() const BOOST_NOEXCEPT_OR_NOTHROW { return this->m_iit; } private: diff --git a/cpp/BoostParts/boost/container/detail/node_alloc_holder.hpp b/cpp/BoostParts/boost/container/detail/node_alloc_holder.hpp index 3b632a677d..1b7c4d76dc 100644 --- a/cpp/BoostParts/boost/container/detail/node_alloc_holder.hpp +++ b/cpp/BoostParts/boost/container/detail/node_alloc_holder.hpp @@ -60,14 +60,17 @@ struct node_alloc_holder { //If the intrusive container is an associative container, obtain the predicate, which will //be of type node_compare<>. If not an associative container value_compare will be a "nat" type. - typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT(boost::container::container_detail::, ICont, - value_compare, container_detail::nat) intrusive_value_compare; + typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT + ( boost::container::container_detail:: + , ICont, value_compare, container_detail::nat) intrusive_value_compare; //In that case obtain the value predicate from the node predicate via predicate_type //if intrusive_value_compare is node_compare<>, nat otherwise - typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT(boost::container::container_detail::, intrusive_value_compare, - predicate_type, container_detail::nat) value_compare; + typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT + ( boost::container::container_detail:: + , intrusive_value_compare + , predicate_type, container_detail::nat) value_compare; - typedef allocator_traits allocator_traits_type; + typedef allocator_traits allocator_traits_type; typedef typename allocator_traits_type::value_type value_type; typedef ICont intrusive_container; typedef typename ICont::value_type Node; @@ -75,19 +78,19 @@ struct node_alloc_holder portable_rebind_alloc::type NodeAlloc; typedef allocator_traits node_allocator_traits_type; typedef container_detail::allocator_version_traits node_allocator_version_traits_type; - typedef Allocator ValAlloc; + typedef Allocator ValAlloc; typedef typename node_allocator_traits_type::pointer NodePtr; typedef container_detail::scoped_deallocator Deallocator; typedef typename node_allocator_traits_type::size_type size_type; typedef typename node_allocator_traits_type::difference_type difference_type; typedef container_detail::integral_constant::value> alloc_version; - typedef typename ICont::iterator icont_iterator; - typedef typename ICont::const_iterator icont_citerator; - typedef allocator_destroyer Destroyer; - typedef allocator_traits NodeAllocTraits; - typedef allocator_version_traits AllocVersionTraits; + version::value> alloc_version; + typedef typename ICont::iterator icont_iterator; + typedef typename ICont::const_iterator icont_citerator; + typedef allocator_destroyer Destroyer; + typedef allocator_traits NodeAllocTraits; + typedef allocator_version_traits AllocVersionTraits; private: BOOST_COPYABLE_AND_MOVABLE(node_alloc_holder) @@ -208,6 +211,29 @@ struct node_alloc_holder return (p); } + template + NodePtr create_node_from_key(BOOST_FWD_REF(KeyConvertible) key) + { + NodePtr p = this->allocate_one(); + NodeAlloc &na = this->node_alloc(); + Deallocator node_deallocator(p, this->node_alloc()); + node_allocator_traits_type::construct + (na, container_detail::addressof(p->m_data.first), boost::forward(key)); + BOOST_TRY{ + node_allocator_traits_type::construct(na, container_detail::addressof(p->m_data.second)); + } + BOOST_CATCH(...){ + node_allocator_traits_type::destroy(na, container_detail::addressof(p->m_data.first)); + BOOST_RETHROW; + } + BOOST_CATCH_END + node_deallocator.release(); + //This does not throw + typedef typename Node::hook_type hook_type; + ::new(static_cast(container_detail::to_raw_pointer(p)), boost_container_new_t()) hook_type; + return (p); + } + void destroy_node(const NodePtr &nodep) { allocator_traits::destroy(this->node_alloc(), container_detail::to_raw_pointer(nodep)); diff --git a/cpp/BoostParts/boost/container/detail/pair.hpp b/cpp/BoostParts/boost/container/detail/pair.hpp index 17766f35cb..134760e1e6 100644 --- a/cpp/BoostParts/boost/container/detail/pair.hpp +++ b/cpp/BoostParts/boost/container/detail/pair.hpp @@ -317,6 +317,16 @@ struct is_class_or_union< ::boost::container::container_detail::pair > static const bool value = true; }; +template +struct is_class_or_union< std::pair > +//This specialization is needed to avoid instantiation of pair in +//is_class, and allow recursive maps. +{ + static const bool value = true; +}; + + + } //namespace move_detail{ diff --git a/cpp/BoostParts/boost/container/detail/tree.hpp b/cpp/BoostParts/boost/container/detail/tree.hpp index c2d6b1d17d..0fd6097650 100644 --- a/cpp/BoostParts/boost/container/detail/tree.hpp +++ b/cpp/BoostParts/boost/container/detail/tree.hpp @@ -50,6 +50,7 @@ #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) #include #endif +#include // other #include @@ -136,13 +137,13 @@ struct tree_node typedef tree_node< T, VoidPointer , tree_type_value, OptimizeSize> node_type; - T &get_data() + BOOST_CONTAINER_FORCEINLINE T &get_data() { T* ptr = reinterpret_cast(&this->m_data); return *ptr; } - const T &get_data() const + BOOST_CONTAINER_FORCEINLINE const T &get_data() const { const T* ptr = reinterpret_cast(&this->m_data); return *ptr; @@ -151,39 +152,39 @@ struct tree_node internal_type m_data; template - void do_assign(const std::pair &p) + BOOST_CONTAINER_FORCEINLINE void do_assign(const std::pair &p) { const_cast(m_data.first) = p.first; m_data.second = p.second; } template - void do_assign(const pair &p) + BOOST_CONTAINER_FORCEINLINE void do_assign(const pair &p) { const_cast(m_data.first) = p.first; m_data.second = p.second; } template - void do_assign(const V &v) + BOOST_CONTAINER_FORCEINLINE void do_assign(const V &v) { m_data = v; } template - void do_move_assign(std::pair &p) + BOOST_CONTAINER_FORCEINLINE void do_move_assign(std::pair &p) { const_cast(m_data.first) = ::boost::move(p.first); m_data.second = ::boost::move(p.second); } template - void do_move_assign(pair &p) + BOOST_CONTAINER_FORCEINLINE void do_move_assign(pair &p) { const_cast(m_data.first) = ::boost::move(p.first); m_data.second = ::boost::move(p.second); } template - void do_move_assign(V &v) + BOOST_CONTAINER_FORCEINLINE void do_move_assign(V &v) { m_data = ::boost::move(v); } }; @@ -526,12 +527,12 @@ class tree const const_iterator end_it(this->cend()); if(unique_insertion){ for ( ; first != last; ++first){ - this->insert_unique(end_it, *first); + this->insert_unique_convertible(end_it, *first); } } else{ for ( ; first != last; ++first){ - this->insert_equal(end_it, *first); + this->insert_equal_convertible(end_it, *first); } } } @@ -555,7 +556,7 @@ class tree //for the constructor const const_iterator end_it(this->cend()); for ( ; first != last; ++first){ - this->insert_unique(end_it, *first); + this->insert_unique_convertible(end_it, *first); } } else{ @@ -983,19 +984,8 @@ class tree #endif // !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) - iterator insert_unique(const_iterator hint, const value_type& v) - { - BOOST_ASSERT((priv_is_linked)(hint)); - insert_commit_data data; - std::pair ret = - this->insert_unique_check(hint, KeyOfValue()(v), data); - if(!ret.second) - return ret.first; - return this->insert_unique_commit(v, data); - } - template - iterator insert_unique(const_iterator hint, BOOST_FWD_REF(MovableConvertible) v) + iterator insert_unique_convertible(const_iterator hint, BOOST_FWD_REF(MovableConvertible) v) { BOOST_ASSERT((priv_is_linked)(hint)); insert_commit_data data; @@ -1006,6 +996,8 @@ class tree return this->insert_unique_commit(boost::forward(v), data); } + BOOST_MOVE_CONVERSION_AWARE_CATCH_1ARG(insert_unique, value_type, iterator, this->insert_unique_convertible, const_iterator, const_iterator) + template void insert_unique(InputIterator first, InputIterator last) { @@ -1032,18 +1024,8 @@ class tree return ret; } - iterator insert_equal(const_iterator hint, const value_type& v) - { - BOOST_ASSERT((priv_is_linked)(hint)); - NodePtr tmp(AllocHolder::create_node(v)); - scoped_destroy_deallocator destroy_deallocator(tmp, this->node_alloc()); - iterator ret(this->icont().insert_equal(hint.get(), *tmp)); - destroy_deallocator.release(); - return ret; - } - template - iterator insert_equal(const_iterator hint, BOOST_FWD_REF(MovableConvertible) v) + iterator insert_equal_convertible(const_iterator hint, BOOST_FWD_REF(MovableConvertible) v) { BOOST_ASSERT((priv_is_linked)(hint)); NodePtr tmp(AllocHolder::create_node(boost::forward(v))); @@ -1053,6 +1035,8 @@ class tree return ret; } + BOOST_MOVE_CONVERSION_AWARE_CATCH_1ARG(insert_equal, value_type, iterator, this->insert_equal_convertible, const_iterator, const_iterator) + template void insert_equal(InputIterator first, InputIterator last) { @@ -1060,6 +1044,29 @@ class tree this->insert_equal(*first); } + template + iterator insert_from_key(BOOST_FWD_REF(KeyConvertible) key) + { + insert_commit_data data; + const key_type & k = key; //Support emulated rvalue references + std::pair ret = + this->icont().insert_unique_check(k, KeyNodeCompare(value_comp()), data); + return ret.second + ? this->insert_unique_key_commit(boost::forward(key), data) + : iterator(ret.first); + } + + template + iterator insert_unique_key_commit + (BOOST_FWD_REF(KeyConvertible) key, insert_commit_data &data) + { + NodePtr tmp = AllocHolder::create_node_from_key(boost::forward(key)); + scoped_destroy_deallocator destroy_deallocator(tmp, this->node_alloc()); + iterator ret(this->icont().insert_unique_commit(*tmp, data)); + destroy_deallocator.release(); + return ret; + } + iterator erase(const_iterator position) { BOOST_ASSERT(position != this->cend() && (priv_is_linked)(position)); diff --git a/cpp/BoostParts/boost/container/detail/workaround.hpp b/cpp/BoostParts/boost/container/detail/workaround.hpp index e1f6156964..ae9151c32d 100644 --- a/cpp/BoostParts/boost/container/detail/workaround.hpp +++ b/cpp/BoostParts/boost/container/detail/workaround.hpp @@ -76,4 +76,17 @@ #define BOOST_CONTAINER_DECL #endif /* DYN_LINK */ +//#define BOOST_CONTAINER_DISABLE_FORCEINLINE + +#if defined(BOOST_CONTAINER_DISABLE_FORCEINLINE) + #define BOOST_CONTAINER_FORCEINLINE inline +#elif defined(BOOST_CONTAINER_FORCEINLINE_IS_BOOST_FORCELINE) + #define BOOST_CONTAINER_FORCEINLINE BOOST_FORCEINLINE +#elif defined(BOOST_MSVC) && defined(_DEBUG) + //"__forceinline" and MSVC seems to have some bugs in debug mode + #define BOOST_CONTAINER_FORCEINLINE inline +#else + #define BOOST_CONTAINER_FORCEINLINE BOOST_FORCEINLINE +#endif + #endif //#ifndef BOOST_CONTAINER_DETAIL_WORKAROUND_HPP diff --git a/cpp/BoostParts/boost/container/map.hpp b/cpp/BoostParts/boost/container/map.hpp index 8173181221..87cc183c8e 100644 --- a/cpp/BoostParts/boost/container/map.hpp +++ b/cpp/BoostParts/boost/container/map.hpp @@ -596,7 +596,7 @@ class map //! Complexity: Logarithmic in general, but amortized constant if t //! is inserted right before p. iterator insert(const_iterator p, BOOST_RV_REF(nonconst_value_type) x) - { return this->base_t::insert_unique(p, boost::move(x)); } + { return this->base_t::insert_unique_convertible(p, boost::move(x)); } //! Effects: Move constructs a new value from x if and only if there is //! no element in the container with key equivalent to the key of x. @@ -608,7 +608,7 @@ class map //! Complexity: Logarithmic in general, but amortized constant if t //! is inserted right before p. iterator insert(const_iterator p, BOOST_RV_REF(movable_value_type) x) - { return this->base_t::insert_unique(p, boost::move(x)); } + { return this->base_t::insert_unique_convertible(p, boost::move(x)); } //! Effects: Inserts a copy of x in the container. //! p is a hint pointing to where the insert should start to search. @@ -617,7 +617,7 @@ class map //! //! Complexity: Logarithmic. iterator insert(const_iterator p, const nonconst_value_type& x) - { return this->base_t::insert_unique(p, x); } + { return this->base_t::insert_unique_convertible(p, x); } //! Effects: Inserts an element move constructed from x in the container. //! p is a hint pointing to where the insert should start to search. @@ -847,31 +847,10 @@ class map #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED private: - mapped_type& priv_subscript(const key_type &k) + template + mapped_type& priv_subscript(BOOST_FWD_REF(KeyConvertible) k) { - //we can optimize this - iterator i = this->lower_bound(k); - // i->first is greater than or equivalent to k. - if (i == this->end() || this->key_comp()(k, (*i).first)){ - container_detail::value_init m; - movable_value_type val(k, boost::move(m.m_t)); - i = insert(i, boost::move(val)); - } - return (*i).second; - } - - mapped_type& priv_subscript(BOOST_RV_REF(key_type) mk) - { - key_type &k = mk; - //we can optimize this - iterator i = this->lower_bound(k); - // i->first is greater than or equivalent to k. - if (i == this->end() || this->key_comp()(k, (*i).first)){ - container_detail::value_init m; - movable_value_type val(boost::move(k), boost::move(m.m_t)); - i = insert(i, boost::move(val)); - } - return (*i).second; + return this->insert_from_key(boost::forward(k))->second; } #endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED @@ -1312,7 +1291,7 @@ class multimap //! Complexity: Logarithmic in general, but amortized constant if t //! is inserted right before p. iterator insert(const_iterator p, const nonconst_value_type& x) - { return this->base_t::insert_equal(p, x); } + { return this->base_t::insert_equal_convertible(p, x); } //! Effects: Inserts a new value move constructed from x in the container. //! p is a hint pointing to where the insert should start to search. @@ -1323,7 +1302,7 @@ class multimap //! Complexity: Logarithmic in general, but amortized constant if t //! is inserted right before p. iterator insert(const_iterator p, BOOST_RV_REF(nonconst_value_type) x) - { return this->base_t::insert_equal(p, boost::move(x)); } + { return this->base_t::insert_equal_convertible(p, boost::move(x)); } //! Effects: Inserts a new value move constructed from x in the container. //! p is a hint pointing to where the insert should start to search. @@ -1334,7 +1313,7 @@ class multimap //! Complexity: Logarithmic in general, but amortized constant if t //! is inserted right before p. iterator insert(const_iterator p, BOOST_RV_REF(movable_value_type) x) - { return this->base_t::insert_equal(p, boost::move(x)); } + { return this->base_t::insert_equal_convertible(p, boost::move(x)); } //! Requires: first, last are not iterators into *this. //! diff --git a/cpp/BoostParts/boost/container/throw_exception.hpp b/cpp/BoostParts/boost/container/throw_exception.hpp index 2c893e95c8..118cc399b8 100644 --- a/cpp/BoostParts/boost/container/throw_exception.hpp +++ b/cpp/BoostParts/boost/container/throw_exception.hpp @@ -24,6 +24,7 @@ #ifndef BOOST_NO_EXCEPTIONS #include //for std exception types + #include //for implicit std::string conversion #include //for std::bad_alloc #else #include diff --git a/cpp/BoostParts/boost/container/vector.hpp b/cpp/BoostParts/boost/container/vector.hpp index e3bc1068aa..fabe92df88 100644 --- a/cpp/BoostParts/boost/container/vector.hpp +++ b/cpp/BoostParts/boost/container/vector.hpp @@ -96,13 +96,13 @@ class vec_iterator Pointer m_ptr; public: - const Pointer &get_ptr() const BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE const Pointer &get_ptr() const BOOST_NOEXCEPT_OR_NOTHROW { return m_ptr; } - Pointer &get_ptr() BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE Pointer &get_ptr() BOOST_NOEXCEPT_OR_NOTHROW { return m_ptr; } - explicit vec_iterator(Pointer ptr) BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE explicit vec_iterator(Pointer ptr) BOOST_NOEXCEPT_OR_NOTHROW : m_ptr(ptr) {} #endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED @@ -110,73 +110,73 @@ class vec_iterator public: //Constructors - vec_iterator() BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE vec_iterator() BOOST_NOEXCEPT_OR_NOTHROW : m_ptr() //Value initialization to achieve "null iterators" (N3644) {} - vec_iterator(vec_iterator const& other) BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE vec_iterator(vec_iterator const& other) BOOST_NOEXCEPT_OR_NOTHROW : m_ptr(other.get_ptr()) {} //Pointer like operators - reference operator*() const BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE reference operator*() const BOOST_NOEXCEPT_OR_NOTHROW { return *m_ptr; } - pointer operator->() const BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE pointer operator->() const BOOST_NOEXCEPT_OR_NOTHROW { return ::boost::intrusive::pointer_traits::pointer_to(this->operator*()); } - reference operator[](difference_type off) const BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE reference operator[](difference_type off) const BOOST_NOEXCEPT_OR_NOTHROW { return m_ptr[off]; } //Increment / Decrement - vec_iterator& operator++() BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE vec_iterator& operator++() BOOST_NOEXCEPT_OR_NOTHROW { ++m_ptr; return *this; } - vec_iterator operator++(int) BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE vec_iterator operator++(int) BOOST_NOEXCEPT_OR_NOTHROW { return vec_iterator(m_ptr++); } - vec_iterator& operator--() BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE vec_iterator& operator--() BOOST_NOEXCEPT_OR_NOTHROW { --m_ptr; return *this; } - vec_iterator operator--(int) BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE vec_iterator operator--(int) BOOST_NOEXCEPT_OR_NOTHROW { return vec_iterator(m_ptr--); } //Arithmetic - vec_iterator& operator+=(difference_type off) BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE vec_iterator& operator+=(difference_type off) BOOST_NOEXCEPT_OR_NOTHROW { m_ptr += off; return *this; } - vec_iterator& operator-=(difference_type off) BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE vec_iterator& operator-=(difference_type off) BOOST_NOEXCEPT_OR_NOTHROW { m_ptr -= off; return *this; } - friend vec_iterator operator+(const vec_iterator &x, difference_type off) BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE friend vec_iterator operator+(const vec_iterator &x, difference_type off) BOOST_NOEXCEPT_OR_NOTHROW { return vec_iterator(x.m_ptr+off); } - friend vec_iterator operator+(difference_type off, vec_iterator right) BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE friend vec_iterator operator+(difference_type off, vec_iterator right) BOOST_NOEXCEPT_OR_NOTHROW { right.m_ptr += off; return right; } - friend vec_iterator operator-(vec_iterator left, difference_type off) BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE friend vec_iterator operator-(vec_iterator left, difference_type off) BOOST_NOEXCEPT_OR_NOTHROW { left.m_ptr -= off; return left; } - friend difference_type operator-(const vec_iterator &left, const vec_iterator& right) BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE friend difference_type operator-(const vec_iterator &left, const vec_iterator& right) BOOST_NOEXCEPT_OR_NOTHROW { return left.m_ptr - right.m_ptr; } //Comparison operators - friend bool operator== (const vec_iterator& l, const vec_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE friend bool operator== (const vec_iterator& l, const vec_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW { return l.m_ptr == r.m_ptr; } - friend bool operator!= (const vec_iterator& l, const vec_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE friend bool operator!= (const vec_iterator& l, const vec_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW { return l.m_ptr != r.m_ptr; } - friend bool operator< (const vec_iterator& l, const vec_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE friend bool operator< (const vec_iterator& l, const vec_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW { return l.m_ptr < r.m_ptr; } - friend bool operator<= (const vec_iterator& l, const vec_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE friend bool operator<= (const vec_iterator& l, const vec_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW { return l.m_ptr <= r.m_ptr; } - friend bool operator> (const vec_iterator& l, const vec_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE friend bool operator> (const vec_iterator& l, const vec_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW { return l.m_ptr > r.m_ptr; } - friend bool operator>= (const vec_iterator& l, const vec_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE friend bool operator>= (const vec_iterator& l, const vec_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW { return l.m_ptr >= r.m_ptr; } }; @@ -186,7 +186,7 @@ struct vector_insert_ordered_cursor typedef typename iterator_traits::value_type size_type; typedef typename iterator_traits::reference reference; - vector_insert_ordered_cursor(BiDirPosConstIt posit, BiDirValueIt valueit) + BOOST_CONTAINER_FORCEINLINE vector_insert_ordered_cursor(BiDirPosConstIt posit, BiDirValueIt valueit) : last_position_it(posit), last_value_it(valueit) {} @@ -200,10 +200,10 @@ struct vector_insert_ordered_cursor } } - size_type get_pos() const + BOOST_CONTAINER_FORCEINLINE size_type get_pos() const { return *last_position_it; } - reference get_val() + BOOST_CONTAINER_FORCEINLINE reference get_val() { return *last_value_it; } BiDirPosConstIt last_position_it; @@ -216,7 +216,7 @@ struct vector_merge_cursor typedef SizeType size_type; typedef typename iterator_traits::reference reference; - vector_merge_cursor(T *pbeg, T *plast, BiDirValueIt valueit, Comp &cmp) + BOOST_CONTAINER_FORCEINLINE vector_merge_cursor(T *pbeg, T *plast, BiDirValueIt valueit, Comp &cmp) : m_pbeg(pbeg), m_pcur(--plast), m_valueit(valueit), m_cmp(cmp) {} @@ -232,10 +232,10 @@ struct vector_merge_cursor } } - size_type get_pos() const + BOOST_CONTAINER_FORCEINLINE size_type get_pos() const { return static_cast((m_pcur + 1) - m_pbeg); } - reference get_val() + BOOST_CONTAINER_FORCEINLINE reference get_val() { return *m_valueit; } T *const m_pbeg; @@ -247,11 +247,11 @@ struct vector_merge_cursor } //namespace container_detail { template -const Pointer &vector_iterator_get_ptr(const container_detail::vec_iterator &it) BOOST_NOEXCEPT_OR_NOTHROW +BOOST_CONTAINER_FORCEINLINE const Pointer &vector_iterator_get_ptr(const container_detail::vec_iterator &it) BOOST_NOEXCEPT_OR_NOTHROW { return it.get_ptr(); } template -Pointer &get_ptr(container_detail::vec_iterator &it) BOOST_NOEXCEPT_OR_NOTHROW +BOOST_CONTAINER_FORCEINLINE Pointer &get_ptr(container_detail::vec_iterator &it) BOOST_NOEXCEPT_OR_NOTHROW { return it.get_ptr(); } namespace container_detail { @@ -270,7 +270,7 @@ struct vector_get_ptr_pointer_to_non_const typedef typename pointer_traits_t ::template rebind_pointer::type return_type; - static return_type get_ptr(const const_pointer &ptr) BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE static return_type get_ptr(const const_pointer &ptr) BOOST_NOEXCEPT_OR_NOTHROW { return boost::intrusive::pointer_traits::const_cast_from(ptr); } }; @@ -278,14 +278,14 @@ template struct vector_get_ptr_pointer_to_non_const { typedef const Pointer & return_type; - static return_type get_ptr(const Pointer &ptr) BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE static return_type get_ptr(const Pointer &ptr) BOOST_NOEXCEPT_OR_NOTHROW { return ptr; } }; } //namespace container_detail { template -typename container_detail::vector_get_ptr_pointer_to_non_const::return_type +BOOST_CONTAINER_FORCEINLINE typename container_detail::vector_get_ptr_pointer_to_non_const::return_type vector_iterator_get_ptr(const MaybeConstPointer &ptr) BOOST_NOEXCEPT_OR_NOTHROW { return container_detail::vector_get_ptr_pointer_to_non_const::get_ptr(ptr); @@ -451,14 +451,14 @@ struct vector_alloc_holder , m_capacity(n) {} - ~vector_alloc_holder() BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE ~vector_alloc_holder() BOOST_NOEXCEPT_OR_NOTHROW { if(this->m_capacity){ this->alloc().deallocate(this->m_start, this->m_capacity); } } - pointer allocation_command(boost::container::allocation_type command, + BOOST_CONTAINER_FORCEINLINE pointer allocation_command(boost::container::allocation_type command, size_type limit_size, size_type &prefer_in_recvd_out_size, pointer &reuse) { typedef typename container_detail::version::type alloc_version; @@ -482,7 +482,7 @@ struct vector_alloc_holder return success; } - size_type next_capacity(size_type additional_objects) const + BOOST_CONTAINER_FORCEINLINE size_type next_capacity(size_type additional_objects) const { return next_capacity_calculator (this->alloc(), container_detail::to_raw_pointer(holder.start()), n, container_detail::to_raw_pointer(this->start())); } - void priv_first_allocation(size_type cap) + BOOST_CONTAINER_FORCEINLINE void priv_first_allocation(size_type cap) { if(cap > Allocator::internal_capacity){ throw_bad_alloc(); } } - void deep_swap(vector_alloc_holder &x) + BOOST_CONTAINER_FORCEINLINE void deep_swap(vector_alloc_holder &x) { this->priv_deep_swap(x); } @@ -645,28 +645,28 @@ struct vector_alloc_holder this->priv_deep_swap(x); } - void swap_resources(vector_alloc_holder &) BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE void swap_resources(vector_alloc_holder &) BOOST_NOEXCEPT_OR_NOTHROW { //Containers with version 0 allocators can't be moved without moving elements one by one throw_bad_alloc(); } - void steal_resources(vector_alloc_holder &) + BOOST_CONTAINER_FORCEINLINE void steal_resources(vector_alloc_holder &) { //Containers with version 0 allocators can't be moved without moving elements one by one throw_bad_alloc(); } - Allocator &alloc() BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE Allocator &alloc() BOOST_NOEXCEPT_OR_NOTHROW { return *this; } - const Allocator &alloc() const BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE const Allocator &alloc() const BOOST_NOEXCEPT_OR_NOTHROW { return *this; } - bool try_expand_fwd(size_type at_least) + BOOST_CONTAINER_FORCEINLINE bool try_expand_fwd(size_type at_least) { return !at_least; } - pointer start() const BOOST_NOEXCEPT_OR_NOTHROW { return Allocator::internal_storage(); } - size_type capacity() const BOOST_NOEXCEPT_OR_NOTHROW { return Allocator::internal_capacity; } + BOOST_CONTAINER_FORCEINLINE pointer start() const BOOST_NOEXCEPT_OR_NOTHROW { return Allocator::internal_storage(); } + BOOST_CONTAINER_FORCEINLINE size_type capacity() const BOOST_NOEXCEPT_OR_NOTHROW { return Allocator::internal_capacity; } size_type m_size; private: @@ -765,16 +765,16 @@ class vector protected: - void steal_resources(vector &x) + BOOST_CONTAINER_FORCEINLINE void steal_resources(vector &x) { return this->m_holder.steal_resources(x.m_holder); } struct initial_capacity_t{}; template - vector(initial_capacity_t, pointer initial_memory, size_type capacity, BOOST_FWD_REF(AllocFwd) a) + BOOST_CONTAINER_FORCEINLINE vector(initial_capacity_t, pointer initial_memory, size_type capacity, BOOST_FWD_REF(AllocFwd) a) : m_holder(initial_memory, capacity, ::boost::forward(a)) {} - vector(initial_capacity_t, pointer initial_memory, size_type capacity) + BOOST_CONTAINER_FORCEINLINE vector(initial_capacity_t, pointer initial_memory, size_type capacity) : m_holder(initial_memory, capacity) {} @@ -822,38 +822,38 @@ class vector } //! Effects: Constructs a vector that will use a copy of allocator a - //! and inserts n default initialized values. + //! and inserts n value initialized values. //! //! Throws: If allocator_type's allocation - //! throws or T's default initialization throws. + //! throws or T's value initialization throws. //! //! Complexity: Linear to n. - //! - //! Note: Non-standard extension - vector(size_type n, default_init_t) - : m_holder(container_detail::uninitialized_size, n) + explicit vector(size_type n, const allocator_type &a) + : m_holder(container_detail::uninitialized_size, a, n) { #ifdef BOOST_CONTAINER_VECTOR_ALLOC_STATS this->num_alloc += n != 0; #endif - boost::container::uninitialized_default_init_alloc_n + boost::container::uninitialized_value_init_alloc_n (this->m_holder.alloc(), n, this->priv_raw_begin()); } //! Effects: Constructs a vector that will use a copy of allocator a - //! and inserts n value initialized values. + //! and inserts n default initialized values. //! //! Throws: If allocator_type's allocation - //! throws or T's value initialization throws. + //! throws or T's default initialization throws. //! //! Complexity: Linear to n. - explicit vector(size_type n, const allocator_type &a) - : m_holder(container_detail::uninitialized_size, a, n) + //! + //! Note: Non-standard extension + vector(size_type n, default_init_t) + : m_holder(container_detail::uninitialized_size, n) { #ifdef BOOST_CONTAINER_VECTOR_ALLOC_STATS this->num_alloc += n != 0; #endif - boost::container::uninitialized_value_init_alloc_n + boost::container::uninitialized_default_init_alloc_n (this->m_holder.alloc(), n, this->priv_raw_begin()); } @@ -918,7 +918,11 @@ class vector //! //! Complexity: Linear to the range [first, last). template - vector(InIt first, InIt last) + vector(InIt first, InIt last + BOOST_CONTAINER_DOCIGN(BOOST_MOVE_I typename container_detail::disable_if_c + < container_detail::is_convertible::value + BOOST_MOVE_I container_detail::nat >::type * = 0) + ) : m_holder() { this->assign(first, last); } @@ -930,7 +934,11 @@ class vector //! //! Complexity: Linear to the range [first, last). template - vector(InIt first, InIt last, const allocator_type& a) + vector(InIt first, InIt last, const allocator_type& a + BOOST_CONTAINER_DOCIGN(BOOST_MOVE_I typename container_detail::disable_if_c + < container_detail::is_convertible::value + BOOST_MOVE_I container_detail::nat >::type * = 0) + ) : m_holder(a) { this->assign(first, last); } @@ -1063,7 +1071,7 @@ class vector //! Throws: If memory allocation throws or T's copy/move constructor/assignment throws. //! //! Complexity: Linear to the number of elements in x. - vector& operator=(BOOST_COPY_ASSIGN_REF(vector) x) + BOOST_CONTAINER_FORCEINLINE vector& operator=(BOOST_COPY_ASSIGN_REF(vector) x) { if (&x != this){ this->priv_copy_assign(x); @@ -1075,7 +1083,7 @@ class vector //! Effects: Make *this container contains elements from il. //! //! Complexity: Linear to the range [il.begin(), il.end()). - vector& operator=(std::initializer_list il) + BOOST_CONTAINER_FORCEINLINE vector& operator=(std::initializer_list il) { this->assign(il.begin(), il.end()); return *this; @@ -1093,7 +1101,7 @@ class vector //! Complexity: Constant if allocator_traits_type:: //! propagate_on_container_move_assignment is true or //! this->get>allocator() == x.get_allocator(). Linear otherwise. - vector& operator=(BOOST_RV_REF(vector) x) + BOOST_CONTAINER_FORCEINLINE vector& operator=(BOOST_RV_REF(vector) x) BOOST_NOEXCEPT_IF(allocator_traits_type::propagate_on_container_move_assignment::value || allocator_traits_type::is_always_equal::value) { @@ -1115,7 +1123,7 @@ class vector //! //! Note: Non-standard extension to support static_vector template - typename container_detail::enable_if_and + BOOST_CONTAINER_FORCEINLINE typename container_detail::enable_if_and < vector& , container_detail::is_version , container_detail::is_different @@ -1137,7 +1145,7 @@ class vector //! //! Note: Non-standard extension to support static_vector template - typename container_detail::enable_if_and + BOOST_CONTAINER_FORCEINLINE typename container_detail::enable_if_and < vector& , container_detail::is_version , container_detail::is_different @@ -1193,7 +1201,7 @@ class vector //! Throws: If memory allocation throws or //! T's constructor from dereferencing iniializer_list iterator throws. //! - void assign(std::initializer_list il) + BOOST_CONTAINER_FORCEINLINE void assign(std::initializer_list il) { this->assign(il.begin(), il.end()); } @@ -1269,7 +1277,7 @@ class vector //! T's copy/move constructor/assignment throws. //! //! Complexity: Linear to n. - void assign(size_type n, const value_type& val) + BOOST_CONTAINER_FORCEINLINE void assign(size_type n, const value_type& val) { this->assign(cvalue_iterator(val, n), cvalue_iterator()); } //! Effects: Returns a copy of the internal allocator. @@ -1287,7 +1295,7 @@ class vector //! Complexity: Constant. //! //! Note: Non-standard extension. - stored_allocator_type &get_stored_allocator() BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE stored_allocator_type &get_stored_allocator() BOOST_NOEXCEPT_OR_NOTHROW { return this->m_holder.alloc(); } //! Effects: Returns a reference to the internal allocator. @@ -1297,7 +1305,7 @@ class vector //! Complexity: Constant. //! //! Note: Non-standard extension. - const stored_allocator_type &get_stored_allocator() const BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE const stored_allocator_type &get_stored_allocator() const BOOST_NOEXCEPT_OR_NOTHROW { return this->m_holder.alloc(); } ////////////////////////////////////////////// @@ -1311,7 +1319,7 @@ class vector //! Throws: Nothing. //! //! Complexity: Constant. - iterator begin() BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE iterator begin() BOOST_NOEXCEPT_OR_NOTHROW { return iterator(this->m_holder.start()); } //! Effects: Returns a const_iterator to the first element contained in the vector. @@ -1319,7 +1327,7 @@ class vector //! Throws: Nothing. //! //! Complexity: Constant. - const_iterator begin() const BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE const_iterator begin() const BOOST_NOEXCEPT_OR_NOTHROW { return const_iterator(this->m_holder.start()); } //! Effects: Returns an iterator to the end of the vector. @@ -1327,7 +1335,7 @@ class vector //! Throws: Nothing. //! //! Complexity: Constant. - iterator end() BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE iterator end() BOOST_NOEXCEPT_OR_NOTHROW { return iterator(this->m_holder.start() + this->m_holder.m_size); } //! Effects: Returns a const_iterator to the end of the vector. @@ -1335,7 +1343,7 @@ class vector //! Throws: Nothing. //! //! Complexity: Constant. - const_iterator end() const BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE const_iterator end() const BOOST_NOEXCEPT_OR_NOTHROW { return this->cend(); } //! Effects: Returns a reverse_iterator pointing to the beginning @@ -1344,7 +1352,7 @@ class vector //! Throws: Nothing. //! //! Complexity: Constant. - reverse_iterator rbegin() BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE reverse_iterator rbegin() BOOST_NOEXCEPT_OR_NOTHROW { return reverse_iterator(this->end()); } //! Effects: Returns a const_reverse_iterator pointing to the beginning @@ -1353,7 +1361,7 @@ class vector //! Throws: Nothing. //! //! Complexity: Constant. - const_reverse_iterator rbegin() const BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE const_reverse_iterator rbegin() const BOOST_NOEXCEPT_OR_NOTHROW { return this->crbegin(); } //! Effects: Returns a reverse_iterator pointing to the end @@ -1362,7 +1370,7 @@ class vector //! Throws: Nothing. //! //! Complexity: Constant. - reverse_iterator rend() BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE reverse_iterator rend() BOOST_NOEXCEPT_OR_NOTHROW { return reverse_iterator(this->begin()); } //! Effects: Returns a const_reverse_iterator pointing to the end @@ -1371,7 +1379,7 @@ class vector //! Throws: Nothing. //! //! Complexity: Constant. - const_reverse_iterator rend() const BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE const_reverse_iterator rend() const BOOST_NOEXCEPT_OR_NOTHROW { return this->crend(); } //! Effects: Returns a const_iterator to the first element contained in the vector. @@ -1379,7 +1387,7 @@ class vector //! Throws: Nothing. //! //! Complexity: Constant. - const_iterator cbegin() const BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE const_iterator cbegin() const BOOST_NOEXCEPT_OR_NOTHROW { return const_iterator(this->m_holder.start()); } //! Effects: Returns a const_iterator to the end of the vector. @@ -1387,7 +1395,7 @@ class vector //! Throws: Nothing. //! //! Complexity: Constant. - const_iterator cend() const BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE const_iterator cend() const BOOST_NOEXCEPT_OR_NOTHROW { return const_iterator(this->m_holder.start() + this->m_holder.m_size); } //! Effects: Returns a const_reverse_iterator pointing to the beginning @@ -1396,7 +1404,7 @@ class vector //! Throws: Nothing. //! //! Complexity: Constant. - const_reverse_iterator crbegin() const BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE const_reverse_iterator crbegin() const BOOST_NOEXCEPT_OR_NOTHROW { return const_reverse_iterator(this->end());} //! Effects: Returns a const_reverse_iterator pointing to the end @@ -1405,7 +1413,7 @@ class vector //! Throws: Nothing. //! //! Complexity: Constant. - const_reverse_iterator crend() const BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE const_reverse_iterator crend() const BOOST_NOEXCEPT_OR_NOTHROW { return const_reverse_iterator(this->begin()); } ////////////////////////////////////////////// @@ -1419,7 +1427,7 @@ class vector //! Throws: Nothing. //! //! Complexity: Constant. - bool empty() const BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE bool empty() const BOOST_NOEXCEPT_OR_NOTHROW { return !this->m_holder.m_size; } //! Effects: Returns the number of the elements contained in the vector. @@ -1427,7 +1435,7 @@ class vector //! Throws: Nothing. //! //! Complexity: Constant. - size_type size() const BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE size_type size() const BOOST_NOEXCEPT_OR_NOTHROW { return this->m_holder.m_size; } //! Effects: Returns the largest possible size of the vector. @@ -1435,7 +1443,7 @@ class vector //! Throws: Nothing. //! //! Complexity: Constant. - size_type max_size() const BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE size_type max_size() const BOOST_NOEXCEPT_OR_NOTHROW { return allocator_traits_type::max_size(this->m_holder.alloc()); } //! Effects: Inserts or erases elements at the end such that @@ -1473,7 +1481,7 @@ class vector //! Throws: Nothing. //! //! Complexity: Constant. - size_type capacity() const BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE size_type capacity() const BOOST_NOEXCEPT_OR_NOTHROW { return this->m_holder.capacity(); } //! Effects: If n is less than or equal to capacity(), this call has no @@ -1482,7 +1490,7 @@ class vector //! n; otherwise, capacity() is unchanged. In either case, size() is unchanged. //! //! Throws: If memory allocation allocation throws or T's copy/move constructor throws. - void reserve(size_type new_cap) + BOOST_CONTAINER_FORCEINLINE void reserve(size_type new_cap) { if (this->capacity() < new_cap){ this->priv_reserve_no_capacity(new_cap, alloc_version()); @@ -1495,7 +1503,7 @@ class vector //! Throws: If memory allocation throws, or T's copy/move constructor throws. //! //! Complexity: Linear to size(). - void shrink_to_fit() + BOOST_CONTAINER_FORCEINLINE void shrink_to_fit() { this->priv_shrink_to_fit(alloc_version()); } ////////////////////////////////////////////// @@ -1722,7 +1730,7 @@ class vector //! //! Complexity: Amortized constant time. template - void emplace_back(BOOST_FWD_REF(Args)...args) + BOOST_CONTAINER_FORCEINLINE void emplace_back(BOOST_FWD_REF(Args)...args) { if (BOOST_LIKELY(this->room_enough())){ //There is more memory, just construct a new object at the end @@ -1745,7 +1753,7 @@ class vector //! //! Note: Non-standard extension. template - bool stable_emplace_back(BOOST_FWD_REF(Args)...args) + BOOST_CONTAINER_FORCEINLINE bool stable_emplace_back(BOOST_FWD_REF(Args)...args) { const bool is_room_enough = this->room_enough() || (alloc_version::value == 2 && this->m_holder.try_expand_fwd(1u)); if (BOOST_LIKELY(is_room_enough)){ @@ -1780,7 +1788,7 @@ class vector #define BOOST_CONTAINER_VECTOR_EMPLACE_CODE(N) \ BOOST_MOVE_TMPL_LT##N BOOST_MOVE_CLASS##N BOOST_MOVE_GT##N \ - void emplace_back(BOOST_MOVE_UREF##N)\ + BOOST_CONTAINER_FORCEINLINE void emplace_back(BOOST_MOVE_UREF##N)\ {\ if (BOOST_LIKELY(this->room_enough())){\ allocator_traits_type::construct (this->m_holder.alloc()\ @@ -1795,7 +1803,7 @@ class vector }\ \ BOOST_MOVE_TMPL_LT##N BOOST_MOVE_CLASS##N BOOST_MOVE_GT##N \ - bool stable_emplace_back(BOOST_MOVE_UREF##N)\ + BOOST_CONTAINER_FORCEINLINE bool stable_emplace_back(BOOST_MOVE_UREF##N)\ {\ const bool is_room_enough = this->room_enough() || (alloc_version::value == 2 && this->m_holder.try_expand_fwd(1u));\ if (BOOST_LIKELY(is_room_enough)){\ @@ -1837,7 +1845,7 @@ class vector //! Complexity: Amortized constant time. void push_back(T &&x); #else - BOOST_MOVE_CONVERSION_AWARE_CATCH(push_back, T, void, priv_push_back) + BOOST_CONTAINER_FORCEINLINE BOOST_MOVE_CONVERSION_AWARE_CATCH(push_back, T, void, priv_push_back) #endif #if defined(BOOST_CONTAINER_DOXYGEN_INVOKED) @@ -3098,7 +3106,10 @@ class vector old_values_destroyer.shrink_forward(new_size-s_before); this->m_holder.m_size = new_size; //Now move remaining last objects in the old buffer begin - ::boost::container::move(pos + raw_gap, old_finish, old_start); + T * const remaining_pos = pos + raw_gap; + if(remaining_pos != old_start){ //Make sure data has to be moved + ::boost::container::move(remaining_pos, old_finish, old_start); + } //Once moved, avoid calling the destructors if trivial after move if(value_traits::trivial_dctr_after_move){ old_values_destroyer.release(); @@ -3238,8 +3249,9 @@ class vector const size_type rest_new = n - mid_n; insert_range_proxy.copy_n_and_update(this->m_holder.alloc(), old_start, rest_new); T* const move_start = old_start + rest_new; - //Displace old_end - T* const move_end = ::boost::container::move(pos, old_finish, move_start); + //Displace old_end, but make sure data has to be moved + T* const move_end = move_start != pos ? ::boost::container::move(pos, old_finish, move_start) + : old_finish; //Destroy remaining moved elements from old_end except if they //have trivial destructor after being moved size_type n_destroy = s_before - n; diff --git a/cpp/BoostParts/boost/core/demangle.hpp b/cpp/BoostParts/boost/core/demangle.hpp index 44aeb8ded7..f13c26a7f4 100644 --- a/cpp/BoostParts/boost/core/demangle.hpp +++ b/cpp/BoostParts/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/cpp/BoostParts/boost/core/scoped_enum.hpp b/cpp/BoostParts/boost/core/scoped_enum.hpp index 78c548bf81..56dd0ede43 100644 --- a/cpp/BoostParts/boost/core/scoped_enum.hpp +++ b/cpp/BoostParts/boost/core/scoped_enum.hpp @@ -43,7 +43,8 @@ namespace boost * @throws No-throws. */ template - UnderlyingType underlying_cast(EnumType v) + inline + BOOST_CONSTEXPR UnderlyingType underlying_cast(EnumType v) BOOST_NOEXCEPT { return v.get_underlying_value_(); } @@ -61,7 +62,7 @@ namespace boost */ template inline - typename EnumType::enum_type native_value(EnumType e) + BOOST_CONSTEXPR typename EnumType::enum_type native_value(EnumType e) BOOST_NOEXCEPT { return e.get_native_value_(); } @@ -75,14 +76,15 @@ namespace boost }; template - UnderlyingType underlying_cast(EnumType v) + inline + BOOST_CONSTEXPR UnderlyingType underlying_cast(EnumType v) BOOST_NOEXCEPT { return static_cast(v); } template inline - EnumType native_value(EnumType e) + BOOST_CONSTEXPR EnumType native_value(EnumType e) BOOST_NOEXCEPT { return e; } @@ -96,7 +98,7 @@ namespace boost #ifndef BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS #define BOOST_SCOPED_ENUM_UT_DECLARE_CONVERSION_OPERATOR \ - explicit operator underlying_type() const BOOST_NOEXCEPT { return get_underlying_value_(); } + explicit BOOST_CONSTEXPR operator underlying_type() const BOOST_NOEXCEPT { return get_underlying_value_(); } #else @@ -115,8 +117,8 @@ namespace boost typedef void is_boost_scoped_enum_tag; \ typedef UnderlyingType underlying_type; \ EnumType() BOOST_NOEXCEPT {} \ - explicit EnumType(underlying_type v) BOOST_NOEXCEPT : v_(v) {} \ - underlying_type get_underlying_value_() const BOOST_NOEXCEPT { return v_; } \ + explicit BOOST_CONSTEXPR EnumType(underlying_type v) BOOST_NOEXCEPT : v_(v) {} \ + BOOST_CONSTEXPR underlying_type get_underlying_value_() const BOOST_NOEXCEPT { return v_; } \ BOOST_SCOPED_ENUM_UT_DECLARE_CONVERSION_OPERATOR \ private: \ underlying_type v_; \ @@ -125,30 +127,30 @@ namespace boost enum enum_type #define BOOST_SCOPED_ENUM_DECLARE_END2() \ - enum_type get_native_value_() const BOOST_NOEXCEPT { return enum_type(v_); } \ - friend bool operator ==(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)==enum_type(rhs.v_); } \ - friend bool operator ==(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)==rhs; } \ - friend bool operator ==(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs==enum_type(rhs.v_); } \ - friend bool operator !=(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)!=enum_type(rhs.v_); } \ - friend bool operator !=(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)!=rhs; } \ - friend bool operator !=(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs!=enum_type(rhs.v_); } \ - friend bool operator <(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)>enum_type(rhs.v_); } \ - friend bool operator >(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)>rhs; } \ - friend bool operator >(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs>enum_type(rhs.v_); } \ - friend bool operator >=(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)>=enum_type(rhs.v_); } \ - friend bool operator >=(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)>=rhs; } \ - friend bool operator >=(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs>=enum_type(rhs.v_); } \ + BOOST_CONSTEXPR enum_type get_native_value_() const BOOST_NOEXCEPT { return enum_type(v_); } \ + friend BOOST_CONSTEXPR bool operator ==(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)==enum_type(rhs.v_); } \ + friend BOOST_CONSTEXPR bool operator ==(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)==rhs; } \ + friend BOOST_CONSTEXPR bool operator ==(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs==enum_type(rhs.v_); } \ + friend BOOST_CONSTEXPR bool operator !=(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)!=enum_type(rhs.v_); } \ + friend BOOST_CONSTEXPR bool operator !=(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)!=rhs; } \ + friend BOOST_CONSTEXPR bool operator !=(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs!=enum_type(rhs.v_); } \ + friend BOOST_CONSTEXPR bool operator <(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)>enum_type(rhs.v_); } \ + friend BOOST_CONSTEXPR bool operator >(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)>rhs; } \ + friend BOOST_CONSTEXPR bool operator >(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs>enum_type(rhs.v_); } \ + friend BOOST_CONSTEXPR bool operator >=(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)>=enum_type(rhs.v_); } \ + friend BOOST_CONSTEXPR bool operator >=(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)>=rhs; } \ + friend BOOST_CONSTEXPR bool operator >=(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs>=enum_type(rhs.v_); } \ }; #define BOOST_SCOPED_ENUM_DECLARE_END(EnumType) \ ; \ - EnumType(enum_type v) BOOST_NOEXCEPT : v_(v) {} \ + BOOST_CONSTEXPR EnumType(enum_type v) BOOST_NOEXCEPT : v_(v) {} \ BOOST_SCOPED_ENUM_DECLARE_END2() /** diff --git a/cpp/BoostParts/boost/detail/utf8_codecvt_facet.hpp b/cpp/BoostParts/boost/detail/utf8_codecvt_facet.hpp index 2d7ed8b2c4..b3c7346da7 100644 --- a/cpp/BoostParts/boost/detail/utf8_codecvt_facet.hpp +++ b/cpp/BoostParts/boost/detail/utf8_codecvt_facet.hpp @@ -105,16 +105,20 @@ BOOST_UTF8_BEGIN_NAMESPACE // See utf8_codecvt_facet.ipp for the implementation. // //----------------------------------------------------------------------------// +#ifndef BOOST_UTF8_DECL +#define BOOST_UTF8_DECL +#endif -struct BOOST_UTF8_DECL utf8_codecvt_facet : +struct BOOST_SYMBOL_VISIBLE utf8_codecvt_facet : public std::codecvt { public: - explicit utf8_codecvt_facet(std::size_t no_locale_manage=0) + BOOST_UTF8_DECL explicit utf8_codecvt_facet(std::size_t no_locale_manage=0) : std::codecvt(no_locale_manage) {} + virtual ~utf8_codecvt_facet(){} protected: - virtual std::codecvt_base::result do_in( + BOOST_UTF8_DECL virtual std::codecvt_base::result do_in( std::mbstate_t& state, const char * from, const char * from_end, @@ -124,7 +128,7 @@ struct BOOST_UTF8_DECL utf8_codecvt_facet : wchar_t*& to_next ) const; - virtual std::codecvt_base::result do_out( + BOOST_UTF8_DECL virtual std::codecvt_base::result do_out( std::mbstate_t & state, const wchar_t * from, const wchar_t * from_end, @@ -148,11 +152,11 @@ struct BOOST_UTF8_DECL utf8_codecvt_facet : return get_octet_count(lead_octet) - 1; } - static unsigned int get_octet_count(unsigned char lead_octet); + BOOST_UTF8_DECL static unsigned int get_octet_count(unsigned char lead_octet); // How many "continuing octets" will be needed for this word // == total octets - 1. - int get_cont_octet_out_count(wchar_t word) const ; + BOOST_UTF8_DECL int get_cont_octet_out_count(wchar_t word) const ; virtual bool do_always_noconv() const BOOST_NOEXCEPT_OR_NOTHROW { return false; @@ -176,7 +180,7 @@ struct BOOST_UTF8_DECL utf8_codecvt_facet : // How many char objects can I process to get <= max_limit // wchar_t objects? - virtual int do_length( + BOOST_UTF8_DECL virtual int do_length( const std::mbstate_t &, const char * from, const char * from_end, diff --git a/cpp/BoostParts/boost/detail/utf8_codecvt_facet.ipp b/cpp/BoostParts/boost/detail/utf8_codecvt_facet.ipp index d39170fdab..a6a5e2d375 100644 --- a/cpp/BoostParts/boost/detail/utf8_codecvt_facet.ipp +++ b/cpp/BoostParts/boost/detail/utf8_codecvt_facet.ipp @@ -31,7 +31,7 @@ BOOST_UTF8_BEGIN_NAMESPACE // implementation for wchar_t // Translate incoming UTF-8 into UCS-4 -std::codecvt_base::result utf8_codecvt_facet::do_in( +BOOST_UTF8_DECL std::codecvt_base::result utf8_codecvt_facet::do_in( std::mbstate_t& /*state*/, const char * from, const char * from_end, @@ -108,7 +108,7 @@ std::codecvt_base::result utf8_codecvt_facet::do_in( else return std::codecvt_base::partial; } -std::codecvt_base::result utf8_codecvt_facet::do_out( +BOOST_UTF8_DECL std::codecvt_base::result utf8_codecvt_facet::do_out( std::mbstate_t& /*state*/, const wchar_t * from, const wchar_t * from_end, @@ -170,7 +170,7 @@ std::codecvt_base::result utf8_codecvt_facet::do_out( // How many char objects can I process to get <= max_limit // wchar_t objects? -int utf8_codecvt_facet::do_length( +BOOST_UTF8_DECL int utf8_codecvt_facet::do_length( const std::mbstate_t &, const char * from, const char * from_end, @@ -201,7 +201,7 @@ int utf8_codecvt_facet::do_length( return static_cast(from_next-from_end); } -unsigned int utf8_codecvt_facet::get_octet_count( +BOOST_UTF8_DECL unsigned int utf8_codecvt_facet::get_octet_count( unsigned char lead_octet ){ // if the 0-bit (MSB) is 0, then 1 character @@ -273,7 +273,7 @@ int get_cont_octet_out_count_impl<4>(wchar_t word){ // How many "continuing octets" will be needed for this word // == total octets - 1. -int utf8_codecvt_facet::get_cont_octet_out_count( +BOOST_UTF8_DECL int utf8_codecvt_facet::get_cont_octet_out_count( wchar_t word ) const { return detail::get_cont_octet_out_count_impl(word); diff --git a/cpp/BoostParts/boost/detail/winapi/GetCurrentProcess.hpp b/cpp/BoostParts/boost/detail/winapi/GetCurrentProcess.hpp index 431b52fa4c..14d5186888 100644 --- a/cpp/BoostParts/boost/detail/winapi/GetCurrentProcess.hpp +++ b/cpp/BoostParts/boost/detail/winapi/GetCurrentProcess.hpp @@ -10,25 +10,16 @@ #ifndef BOOST_DETAIL_WINAPI_GETCURRENTPROCESS_HPP #define BOOST_DETAIL_WINAPI_GETCURRENTPROCESS_HPP -#include +#include #ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif -// Windows CE define GetCurrentProcess as an inline function in kfuncs.h -#if !defined( BOOST_USE_WINDOWS_H ) && !defined( UNDER_CE ) -extern "C" { -BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI GetCurrentProcess(BOOST_DETAIL_WINAPI_VOID); -} +#if defined(__GNUC__) +#pragma message "This header is deprecated, use boost/detail/winapi/get_current_process.hpp instead." +#elif defined(_MSC_VER) +#pragma message("This header is deprecated, use boost/detail/winapi/get_current_process.hpp instead.") #endif -namespace boost { -namespace detail { -namespace winapi { -using ::GetCurrentProcess; -} -} -} - #endif // BOOST_DETAIL_WINAPI_GETCURRENTPROCESS_HPP diff --git a/cpp/BoostParts/boost/detail/winapi/GetCurrentThread.hpp b/cpp/BoostParts/boost/detail/winapi/GetCurrentThread.hpp index cbcdc97bda..047add8c9c 100644 --- a/cpp/BoostParts/boost/detail/winapi/GetCurrentThread.hpp +++ b/cpp/BoostParts/boost/detail/winapi/GetCurrentThread.hpp @@ -10,25 +10,16 @@ #ifndef BOOST_DETAIL_WINAPI_GETCURRENTTHREAD_HPP #define BOOST_DETAIL_WINAPI_GETCURRENTTHREAD_HPP -#include +#include #ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif -// Windows CE define GetCurrentThread as an inline function in kfuncs.h -#if !defined( BOOST_USE_WINDOWS_H ) && !defined( UNDER_CE ) -extern "C" { -BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI GetCurrentThread(BOOST_DETAIL_WINAPI_VOID); -} +#if defined(__GNUC__) +#pragma message "This header is deprecated, use boost/detail/winapi/get_current_thread.hpp instead." +#elif defined(_MSC_VER) +#pragma message("This header is deprecated, use boost/detail/winapi/get_current_thread.hpp instead.") #endif -namespace boost { -namespace detail { -namespace winapi { -using ::GetCurrentThread; -} -} -} - #endif // BOOST_DETAIL_WINAPI_GETCURRENTTHREAD_HPP diff --git a/cpp/BoostParts/boost/detail/winapi/GetLastError.hpp b/cpp/BoostParts/boost/detail/winapi/GetLastError.hpp index 8874ba853a..7fda753806 100644 --- a/cpp/BoostParts/boost/detail/winapi/GetLastError.hpp +++ b/cpp/BoostParts/boost/detail/winapi/GetLastError.hpp @@ -10,24 +10,16 @@ #ifndef BOOST_DETAIL_WINAPI_GETLASTERROR_HPP #define BOOST_DETAIL_WINAPI_GETLASTERROR_HPP -#include +#include #ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif -#if !defined( BOOST_USE_WINDOWS_H ) -extern "C" { -BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI GetLastError(BOOST_DETAIL_WINAPI_VOID); -} +#if defined(__GNUC__) +#pragma message "This header is deprecated, use boost/detail/winapi/get_last_error.hpp instead." +#elif defined(_MSC_VER) +#pragma message("This header is deprecated, use boost/detail/winapi/get_last_error.hpp instead.") #endif -namespace boost { -namespace detail { -namespace winapi { -using ::GetLastError; -} -} -} - #endif // BOOST_DETAIL_WINAPI_GETLASTERROR_HPP diff --git a/cpp/BoostParts/boost/detail/winapi/GetProcessTimes.hpp b/cpp/BoostParts/boost/detail/winapi/GetProcessTimes.hpp index 41b3f0e493..7b2b969261 100644 --- a/cpp/BoostParts/boost/detail/winapi/GetProcessTimes.hpp +++ b/cpp/BoostParts/boost/detail/winapi/GetProcessTimes.hpp @@ -9,52 +9,16 @@ #ifndef BOOST_DETAIL_WINAPI_GETPROCESSTIMES_HPP #define BOOST_DETAIL_WINAPI_GETPROCESSTIMES_HPP -#include +#include #ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif -// Windows CE does not define GetProcessTimes -#if !defined( UNDER_CE ) - -#include -#include - -#if !defined( BOOST_USE_WINDOWS_H ) -extern "C" { -BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI -GetProcessTimes( - boost::detail::winapi::HANDLE_ hProcess, - ::_FILETIME* lpCreationTime, - ::_FILETIME* lpExitTime, - ::_FILETIME* lpKernelTime, - ::_FILETIME* lpUserTime); -} +#if defined(__GNUC__) +#pragma message "This header is deprecated, use boost/detail/winapi/get_process_times.hpp instead." +#elif defined(_MSC_VER) +#pragma message("This header is deprecated, use boost/detail/winapi/get_process_times.hpp instead.") #endif -namespace boost { -namespace detail { -namespace winapi { - -BOOST_FORCEINLINE BOOL_ GetProcessTimes( - HANDLE_ hProcess, - LPFILETIME_ lpCreationTime, - LPFILETIME_ lpExitTime, - LPFILETIME_ lpKernelTime, - LPFILETIME_ lpUserTime) -{ - return ::GetProcessTimes( - hProcess, - reinterpret_cast< ::_FILETIME* >(lpCreationTime), - reinterpret_cast< ::_FILETIME* >(lpExitTime), - reinterpret_cast< ::_FILETIME* >(lpKernelTime), - reinterpret_cast< ::_FILETIME* >(lpUserTime)); -} - -} -} -} - -#endif // !defined( UNDER_CE ) #endif // BOOST_DETAIL_WINAPI_GETPROCESSTIMES_HPP diff --git a/cpp/BoostParts/boost/detail/winapi/GetThreadTimes.hpp b/cpp/BoostParts/boost/detail/winapi/GetThreadTimes.hpp index 2e1eb8f45c..d69c410e61 100644 --- a/cpp/BoostParts/boost/detail/winapi/GetThreadTimes.hpp +++ b/cpp/BoostParts/boost/detail/winapi/GetThreadTimes.hpp @@ -10,46 +10,16 @@ #ifndef BOOST_DETAIL_WINAPI_GETTHREADTIMES_HPP #define BOOST_DETAIL_WINAPI_GETTHREADTIMES_HPP -#include -#include +#include #ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif -#if !defined( BOOST_USE_WINDOWS_H ) -extern "C" { -BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI -GetThreadTimes( - boost::detail::winapi::HANDLE_ hThread, - ::_FILETIME* lpCreationTime, - ::_FILETIME* lpExitTime, - ::_FILETIME* lpKernelTime, - ::_FILETIME* lpUserTime); -} +#if defined(__GNUC__) +#pragma message "This header is deprecated, use boost/detail/winapi/get_thread_times.hpp instead." +#elif defined(_MSC_VER) +#pragma message("This header is deprecated, use boost/detail/winapi/get_thread_times.hpp instead.") #endif -namespace boost { -namespace detail { -namespace winapi { - -BOOST_FORCEINLINE BOOL_ GetThreadTimes( - HANDLE_ hThread, - LPFILETIME_ lpCreationTime, - LPFILETIME_ lpExitTime, - LPFILETIME_ lpKernelTime, - LPFILETIME_ lpUserTime) -{ - return ::GetThreadTimes( - hThread, - reinterpret_cast< ::_FILETIME* >(lpCreationTime), - reinterpret_cast< ::_FILETIME* >(lpExitTime), - reinterpret_cast< ::_FILETIME* >(lpKernelTime), - reinterpret_cast< ::_FILETIME* >(lpUserTime)); -} - -} -} -} - #endif // BOOST_DETAIL_WINAPI_GETTHREADTIMES_HPP diff --git a/cpp/BoostParts/boost/detail/winapi/basic_types.hpp b/cpp/BoostParts/boost/detail/winapi/basic_types.hpp index 717e934e42..30df135642 100644 --- a/cpp/BoostParts/boost/detail/winapi/basic_types.hpp +++ b/cpp/BoostParts/boost/detail/winapi/basic_types.hpp @@ -98,6 +98,10 @@ typedef ::PDWORD PDWORD_; typedef ::LPDWORD LPDWORD_; typedef ::HANDLE HANDLE_; typedef ::PHANDLE PHANDLE_; +typedef ::SHORT SHORT_; +typedef ::PSHORT PSHORT_; +typedef ::USHORT USHORT_; +typedef ::PUSHORT PUSHORT_; typedef ::INT INT_; typedef ::PINT PINT_; typedef ::LPINT LPINT_; @@ -150,6 +154,10 @@ typedef DWORD_* LPDWORD_; typedef void* HANDLE_; typedef void** PHANDLE_; +typedef short SHORT_; +typedef SHORT_* PSHORT_; +typedef unsigned short USHORT_; +typedef USHORT_* PUSHORT_; typedef int INT_; typedef INT_* PINT_; typedef INT_* LPINT_; diff --git a/cpp/BoostParts/boost/detail/winapi/config.hpp b/cpp/BoostParts/boost/detail/winapi/config.hpp index c67d670dd2..1f08c2a88e 100644 --- a/cpp/BoostParts/boost/detail/winapi/config.hpp +++ b/cpp/BoostParts/boost/detail/winapi/config.hpp @@ -9,15 +9,10 @@ #ifndef BOOST_DETAIL_WINAPI_CONFIG_HPP_INCLUDED_ #define BOOST_DETAIL_WINAPI_CONFIG_HPP_INCLUDED_ -#include #if defined __MINGW32__ #include <_mingw.h> #endif -#ifdef BOOST_HAS_PRAGMA_ONCE -#pragma once -#endif - // BOOST_WINAPI_IS_MINGW indicates that the target Windows SDK is provided by MinGW (http://mingw.org/). // BOOST_WINAPI_IS_MINGW_W64 indicates that the target Windows SDK is provided by MinGW-w64 (http://mingw-w64.org). #if defined __MINGW32__ @@ -51,7 +46,7 @@ #define BOOST_USE_WINAPI_VERSION WINVER #else // By default use Windows Vista API on compilers that support it and XP on the others -#if (defined(_MSC_VER) && _MSC_VER <= 1400) || defined(BOOST_WINAPI_IS_MINGW) +#if (defined(_MSC_VER) && _MSC_VER < 1500) || defined(BOOST_WINAPI_IS_MINGW) #define BOOST_USE_WINAPI_VERSION BOOST_WINAPI_VERSION_WINXP #else #define BOOST_USE_WINAPI_VERSION BOOST_WINAPI_VERSION_WIN6 @@ -69,4 +64,10 @@ #endif #endif +#include + +#ifdef BOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + #endif // BOOST_DETAIL_WINAPI_CONFIG_HPP_INCLUDED_ diff --git a/cpp/BoostParts/boost/detail/winapi/get_current_process.hpp b/cpp/BoostParts/boost/detail/winapi/get_current_process.hpp new file mode 100644 index 0000000000..e5f4f2aaab --- /dev/null +++ b/cpp/BoostParts/boost/detail/winapi/get_current_process.hpp @@ -0,0 +1,34 @@ +// get_current_process.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba +// Copyright 2015 Andrey Semashev + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef BOOST_DETAIL_WINAPI_GET_CURRENT_PROCESS_HPP +#define BOOST_DETAIL_WINAPI_GET_CURRENT_PROCESS_HPP + +#include + +#ifdef BOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +// Windows CE define GetCurrentProcess as an inline function in kfuncs.h +#if !defined( BOOST_USE_WINDOWS_H ) && !defined( UNDER_CE ) +extern "C" { +BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI GetCurrentProcess(BOOST_DETAIL_WINAPI_VOID); +} +#endif + +namespace boost { +namespace detail { +namespace winapi { +using ::GetCurrentProcess; +} +} +} + +#endif // BOOST_DETAIL_WINAPI_GET_CURRENT_PROCESS_HPP diff --git a/cpp/BoostParts/boost/detail/winapi/get_current_thread.hpp b/cpp/BoostParts/boost/detail/winapi/get_current_thread.hpp new file mode 100644 index 0000000000..b52c3a8c19 --- /dev/null +++ b/cpp/BoostParts/boost/detail/winapi/get_current_thread.hpp @@ -0,0 +1,34 @@ +// get_current_thread.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba +// Copyright 2015 Andrey Semashev + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef BOOST_DETAIL_WINAPI_GET_CURRENT_THREAD_HPP +#define BOOST_DETAIL_WINAPI_GET_CURRENT_THREAD_HPP + +#include + +#ifdef BOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +// Windows CE define GetCurrentThread as an inline function in kfuncs.h +#if !defined( BOOST_USE_WINDOWS_H ) && !defined( UNDER_CE ) +extern "C" { +BOOST_SYMBOL_IMPORT boost::detail::winapi::HANDLE_ WINAPI GetCurrentThread(BOOST_DETAIL_WINAPI_VOID); +} +#endif + +namespace boost { +namespace detail { +namespace winapi { +using ::GetCurrentThread; +} +} +} + +#endif // BOOST_DETAIL_WINAPI_GET_CURRENT_THREAD_HPP diff --git a/cpp/BoostParts/boost/detail/winapi/get_last_error.hpp b/cpp/BoostParts/boost/detail/winapi/get_last_error.hpp new file mode 100644 index 0000000000..543efaf9a0 --- /dev/null +++ b/cpp/BoostParts/boost/detail/winapi/get_last_error.hpp @@ -0,0 +1,33 @@ +// get_last_error.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba +// Copyright 2015 Andrey Semashev + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef BOOST_DETAIL_WINAPI_GET_LAST_ERROR_HPP +#define BOOST_DETAIL_WINAPI_GET_LAST_ERROR_HPP + +#include + +#ifdef BOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +#if !defined( BOOST_USE_WINDOWS_H ) +extern "C" { +BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI GetLastError(BOOST_DETAIL_WINAPI_VOID); +} +#endif + +namespace boost { +namespace detail { +namespace winapi { +using ::GetLastError; +} +} +} + +#endif // BOOST_DETAIL_WINAPI_GET_LAST_ERROR_HPP diff --git a/cpp/BoostParts/boost/detail/winapi/get_process_times.hpp b/cpp/BoostParts/boost/detail/winapi/get_process_times.hpp new file mode 100644 index 0000000000..a79eeb0128 --- /dev/null +++ b/cpp/BoostParts/boost/detail/winapi/get_process_times.hpp @@ -0,0 +1,60 @@ +// get_process_times.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef BOOST_DETAIL_WINAPI_GET_PROCESS_TIMES_HPP +#define BOOST_DETAIL_WINAPI_GET_PROCESS_TIMES_HPP + +#include + +#ifdef BOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +// Windows CE does not define GetProcessTimes +#if !defined( UNDER_CE ) + +#include +#include + +#if !defined( BOOST_USE_WINDOWS_H ) +extern "C" { +BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI +GetProcessTimes( + boost::detail::winapi::HANDLE_ hProcess, + ::_FILETIME* lpCreationTime, + ::_FILETIME* lpExitTime, + ::_FILETIME* lpKernelTime, + ::_FILETIME* lpUserTime); +} +#endif + +namespace boost { +namespace detail { +namespace winapi { + +BOOST_FORCEINLINE BOOL_ GetProcessTimes( + HANDLE_ hProcess, + LPFILETIME_ lpCreationTime, + LPFILETIME_ lpExitTime, + LPFILETIME_ lpKernelTime, + LPFILETIME_ lpUserTime) +{ + return ::GetProcessTimes( + hProcess, + reinterpret_cast< ::_FILETIME* >(lpCreationTime), + reinterpret_cast< ::_FILETIME* >(lpExitTime), + reinterpret_cast< ::_FILETIME* >(lpKernelTime), + reinterpret_cast< ::_FILETIME* >(lpUserTime)); +} + +} +} +} + +#endif // !defined( UNDER_CE ) +#endif // BOOST_DETAIL_WINAPI_GET_PROCESS_TIMES_HPP diff --git a/cpp/BoostParts/boost/detail/winapi/get_thread_times.hpp b/cpp/BoostParts/boost/detail/winapi/get_thread_times.hpp new file mode 100644 index 0000000000..13308d84da --- /dev/null +++ b/cpp/BoostParts/boost/detail/winapi/get_thread_times.hpp @@ -0,0 +1,55 @@ +// get_thread_times.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba +// Copyright 2015 Andrey Semashev + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef BOOST_DETAIL_WINAPI_GET_THREAD_TIMES_HPP +#define BOOST_DETAIL_WINAPI_GET_THREAD_TIMES_HPP + +#include +#include + +#ifdef BOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +#if !defined( BOOST_USE_WINDOWS_H ) +extern "C" { +BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI +GetThreadTimes( + boost::detail::winapi::HANDLE_ hThread, + ::_FILETIME* lpCreationTime, + ::_FILETIME* lpExitTime, + ::_FILETIME* lpKernelTime, + ::_FILETIME* lpUserTime); +} +#endif + +namespace boost { +namespace detail { +namespace winapi { + +BOOST_FORCEINLINE BOOL_ GetThreadTimes( + HANDLE_ hThread, + LPFILETIME_ lpCreationTime, + LPFILETIME_ lpExitTime, + LPFILETIME_ lpKernelTime, + LPFILETIME_ lpUserTime) +{ + return ::GetThreadTimes( + hThread, + reinterpret_cast< ::_FILETIME* >(lpCreationTime), + reinterpret_cast< ::_FILETIME* >(lpExitTime), + reinterpret_cast< ::_FILETIME* >(lpKernelTime), + reinterpret_cast< ::_FILETIME* >(lpUserTime)); +} + +} +} +} + +#endif // BOOST_DETAIL_WINAPI_GET_THREAD_TIMES_HPP diff --git a/cpp/BoostParts/boost/interprocess/detail/utilities.hpp b/cpp/BoostParts/boost/interprocess/detail/utilities.hpp index 7ff3def65b..e1be2f1598 100644 --- a/cpp/BoostParts/boost/interprocess/detail/utilities.hpp +++ b/cpp/BoostParts/boost/interprocess/detail/utilities.hpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2005-2012. +// (C) Copyright Ion Gaztanaga 2005-2015. // (C) Copyright Gennaro Prota 2003 - 2004. // // Distributed under the Boost Software License, Version 1.0. @@ -123,8 +123,8 @@ struct is_intrusive_index static const bool value = false; }; -template T* -addressof(T& v) +template +BOOST_INTERPROCESS_FORCEINLINE T* addressof(T& v) { return reinterpret_cast( &const_cast(reinterpret_cast(v))); @@ -148,7 +148,7 @@ inline bool multiplication_overflows(SizeType a, SizeType b) } template -inline bool size_overflows(SizeType count) +BOOST_INTERPROCESS_FORCEINLINE bool size_overflows(SizeType count) { //Compile time-check BOOST_STATIC_ASSERT(SztSizeOfType <= SizeType(-1)); @@ -163,18 +163,18 @@ template class pointer_uintptr_caster { public: - BOOST_FORCEINLINE explicit pointer_uintptr_caster(uintptr_t sz) + BOOST_INTERPROCESS_FORCEINLINE explicit pointer_uintptr_caster(uintptr_t sz) : m_uintptr(sz) {} - BOOST_FORCEINLINE explicit pointer_uintptr_caster(const volatile T *p) + BOOST_INTERPROCESS_FORCEINLINE explicit pointer_uintptr_caster(const volatile T *p) : m_uintptr(reinterpret_cast(p)) {} - BOOST_FORCEINLINE uintptr_t uintptr() const + BOOST_INTERPROCESS_FORCEINLINE uintptr_t uintptr() const { return m_uintptr; } - BOOST_FORCEINLINE T* pointer() const + BOOST_INTERPROCESS_FORCEINLINE T* pointer() const { return reinterpret_cast(m_uintptr); } private: @@ -196,7 +196,7 @@ class value_eraser ~value_eraser() { if(m_erase) m_cont.erase(m_index_it); } - void release() { m_erase = false; } + BOOST_INTERPROCESS_FORCEINLINE void release() { m_erase = false; } private: Cont &m_cont; diff --git a/cpp/BoostParts/boost/interprocess/detail/win32_api.hpp b/cpp/BoostParts/boost/interprocess/detail/win32_api.hpp index 0329b6dbe4..f1bfee66d5 100644 --- a/cpp/BoostParts/boost/interprocess/detail/win32_api.hpp +++ b/cpp/BoostParts/boost/interprocess/detail/win32_api.hpp @@ -35,11 +35,11 @@ #include # if defined(BOOST_INTERPROCESS_BOOTSTAMP_IS_LASTBOOTUPTIME) -# include -# include +# include +# include # endif -#include +#include #endif #if defined(_MSC_VER) diff --git a/cpp/BoostParts/boost/interprocess/detail/workaround.hpp b/cpp/BoostParts/boost/interprocess/detail/workaround.hpp index d7e86f464d..5089696fb6 100644 --- a/cpp/BoostParts/boost/interprocess/detail/workaround.hpp +++ b/cpp/BoostParts/boost/interprocess/detail/workaround.hpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2005-2012. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2005-2015. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // @@ -19,8 +19,6 @@ # pragma once #endif -#include - #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) #define BOOST_INTERPROCESS_WINDOWS #define BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION @@ -191,6 +189,17 @@ #define BOOST_INTERPROCESS_I , #define BOOST_INTERPROCESS_DOCIGN(T1) T1 -#include +//#define BOOST_INTERPROCESS_DISABLE_FORCEINLINE + +#if defined(BOOST_INTERPROCESS_DISABLE_FORCEINLINE) + #define BOOST_INTERPROCESS_FORCEINLINE inline +#elif defined(BOOST_INTERPROCESS_FORCEINLINE_IS_BOOST_FORCELINE) + #define BOOST_INTERPROCESS_FORCEINLINE BOOST_FORCEINLINE +#elif defined(BOOST_MSVC) && defined(_DEBUG) + //"__forceinline" and MSVC seems to have some bugs in debug mode + #define BOOST_INTERPROCESS_FORCEINLINE inline +#else + #define BOOST_INTERPROCESS_FORCEINLINE BOOST_FORCEINLINE +#endif #endif //#ifndef BOOST_INTERPROCESS_DETAIL_WORKAROUND_HPP diff --git a/cpp/BoostParts/boost/interprocess/offset_ptr.hpp b/cpp/BoostParts/boost/interprocess/offset_ptr.hpp index 622b3cd6e3..d668fca6ba 100644 --- a/cpp/BoostParts/boost/interprocess/offset_ptr.hpp +++ b/cpp/BoostParts/boost/interprocess/offset_ptr.hpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2005-2014. Distributed under the Boost +// (C) Copyright Ion Gaztanaga 2005-2015. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // @@ -79,7 +79,7 @@ namespace ipcdetail { // //////////////////////////////////////////////////////////////////////// #define BOOST_INTERPROCESS_OFFSET_PTR_BRANCHLESS_TO_PTR - BOOST_FORCEINLINE void * offset_ptr_to_raw_pointer(const volatile void *this_ptr, uintptr_t offset) + BOOST_INTERPROCESS_FORCEINLINE void * offset_ptr_to_raw_pointer(const volatile void *this_ptr, uintptr_t offset) { typedef pointer_uintptr_caster caster_t; #ifndef BOOST_INTERPROCESS_OFFSET_PTR_BRANCHLESS_TO_PTR @@ -104,7 +104,7 @@ namespace ipcdetail { // //////////////////////////////////////////////////////////////////////// #define BOOST_INTERPROCESS_OFFSET_PTR_BRANCHLESS_TO_OFF - BOOST_FORCEINLINE uintptr_t offset_ptr_to_offset(const volatile void *ptr, const volatile void *this_ptr) + BOOST_INTERPROCESS_FORCEINLINE uintptr_t offset_ptr_to_offset(const volatile void *ptr, const volatile void *this_ptr) { typedef pointer_uintptr_caster caster_t; #ifndef BOOST_INTERPROCESS_OFFSET_PTR_BRANCHLESS_TO_OFF @@ -137,7 +137,7 @@ namespace ipcdetail { // //////////////////////////////////////////////////////////////////////// #define BOOST_INTERPROCESS_OFFSET_PTR_BRANCHLESS_TO_OFF_FROM_OTHER - BOOST_FORCEINLINE uintptr_t offset_ptr_to_offset_from_other + BOOST_INTERPROCESS_FORCEINLINE uintptr_t offset_ptr_to_offset_from_other (const volatile void *this_ptr, const volatile void *other_ptr, uintptr_t other_offset) { typedef pointer_uintptr_caster caster_t; @@ -242,20 +242,20 @@ class offset_ptr //!Default constructor (null pointer). //!Never throws. - BOOST_FORCEINLINE offset_ptr() BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE offset_ptr() BOOST_NOEXCEPT : internal(1) {} //!Constructor from raw pointer (allows "0" pointer conversion). //!Never throws. - BOOST_FORCEINLINE offset_ptr(pointer ptr) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE offset_ptr(pointer ptr) BOOST_NOEXCEPT : internal(static_cast(ipcdetail::offset_ptr_to_offset(ptr, this))) {} //!Constructor from other pointer. //!Never throws. template - BOOST_FORCEINLINE offset_ptr( T *ptr + BOOST_INTERPROCESS_FORCEINLINE offset_ptr( T *ptr , typename ipcdetail::enable_if< ipcdetail::is_convertible >::type * = 0) BOOST_NOEXCEPT : internal(static_cast (ipcdetail::offset_ptr_to_offset(static_cast(ptr), this))) @@ -263,7 +263,7 @@ class offset_ptr //!Constructor from other offset_ptr //!Never throws. - BOOST_FORCEINLINE offset_ptr(const offset_ptr& ptr) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE offset_ptr(const offset_ptr& ptr) BOOST_NOEXCEPT : internal(static_cast (ipcdetail::offset_ptr_to_offset_from_other(this, &ptr, ptr.internal.m_offset))) {} @@ -271,7 +271,7 @@ class offset_ptr //!Constructor from other offset_ptr. If pointers of pointee types are //!convertible, offset_ptrs will be convertibles. Never throws. template - BOOST_FORCEINLINE offset_ptr( const offset_ptr &ptr + BOOST_INTERPROCESS_FORCEINLINE offset_ptr( const offset_ptr &ptr #ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED , typename ipcdetail::enable_if_convertible_equal_address::type* = 0 #endif @@ -285,7 +285,7 @@ class offset_ptr //!Constructor from other offset_ptr. If pointers of pointee types are //!convertible, offset_ptrs will be convertibles. Never throws. template - BOOST_FORCEINLINE offset_ptr( const offset_ptr &ptr + BOOST_INTERPROCESS_FORCEINLINE offset_ptr( const offset_ptr &ptr , typename ipcdetail::enable_if_convertible_unequal_address::type* = 0) BOOST_NOEXCEPT : internal(static_cast (ipcdetail::offset_ptr_to_offset(static_cast(ptr.get()), this))) @@ -296,7 +296,7 @@ class offset_ptr //!Emulates static_cast operator. //!Never throws. template - BOOST_FORCEINLINE offset_ptr(const offset_ptr & r, ipcdetail::static_cast_tag) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE offset_ptr(const offset_ptr & r, ipcdetail::static_cast_tag) BOOST_NOEXCEPT : internal(static_cast (ipcdetail::offset_ptr_to_offset(static_cast(r.get()), this))) {} @@ -304,7 +304,7 @@ class offset_ptr //!Emulates const_cast operator. //!Never throws. template - BOOST_FORCEINLINE offset_ptr(const offset_ptr & r, ipcdetail::const_cast_tag) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE offset_ptr(const offset_ptr & r, ipcdetail::const_cast_tag) BOOST_NOEXCEPT : internal(static_cast (ipcdetail::offset_ptr_to_offset(const_cast(r.get()), this))) {} @@ -312,7 +312,7 @@ class offset_ptr //!Emulates dynamic_cast operator. //!Never throws. template - BOOST_FORCEINLINE offset_ptr(const offset_ptr & r, ipcdetail::dynamic_cast_tag) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE offset_ptr(const offset_ptr & r, ipcdetail::dynamic_cast_tag) BOOST_NOEXCEPT : internal(static_cast (ipcdetail::offset_ptr_to_offset(dynamic_cast(r.get()), this))) {} @@ -320,27 +320,27 @@ class offset_ptr //!Emulates reinterpret_cast operator. //!Never throws. template - BOOST_FORCEINLINE offset_ptr(const offset_ptr & r, ipcdetail::reinterpret_cast_tag) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE offset_ptr(const offset_ptr & r, ipcdetail::reinterpret_cast_tag) BOOST_NOEXCEPT : internal(static_cast (ipcdetail::offset_ptr_to_offset(reinterpret_cast(r.get()), this))) {} //!Obtains raw pointer from offset. //!Never throws. - BOOST_FORCEINLINE pointer get() const BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE pointer get() const BOOST_NOEXCEPT { return (pointer)ipcdetail::offset_ptr_to_raw_pointer(this, this->internal.m_offset); } - BOOST_FORCEINLINE offset_type get_offset() const BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE offset_type get_offset() const BOOST_NOEXCEPT { return this->internal.m_offset; } //!Pointer-like -> operator. It can return 0 pointer. //!Never throws. - BOOST_FORCEINLINE pointer operator->() const BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE pointer operator->() const BOOST_NOEXCEPT { return this->get(); } //!Dereferencing operator, if it is a null offset_ptr behavior //! is undefined. Never throws. - BOOST_FORCEINLINE reference operator* () const BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE reference operator* () const BOOST_NOEXCEPT { pointer p = this->get(); reference r = *p; @@ -349,12 +349,12 @@ class offset_ptr //!Indexing operator. //!Never throws. - BOOST_FORCEINLINE reference operator[](difference_type idx) const BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE reference operator[](difference_type idx) const BOOST_NOEXCEPT { return this->get()[idx]; } //!Assignment from pointer (saves extra conversion). //!Never throws. - BOOST_FORCEINLINE offset_ptr& operator= (pointer from) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE offset_ptr& operator= (pointer from) BOOST_NOEXCEPT { this->internal.m_offset = static_cast(ipcdetail::offset_ptr_to_offset(from, this)); @@ -363,7 +363,7 @@ class offset_ptr //!Assignment from other offset_ptr. //!Never throws. - BOOST_FORCEINLINE offset_ptr& operator= (const offset_ptr & ptr) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE offset_ptr& operator= (const offset_ptr & ptr) BOOST_NOEXCEPT { this->internal.m_offset = static_cast(ipcdetail::offset_ptr_to_offset_from_other(this, &ptr, ptr.internal.m_offset)); @@ -372,7 +372,7 @@ class offset_ptr //!Assignment from related offset_ptr. If pointers of pointee types //! are assignable, offset_ptrs will be assignable. Never throws. - template BOOST_FORCEINLINE + template BOOST_INTERPROCESS_FORCEINLINE #ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED typename ipcdetail::enable_if_c < ipcdetail::is_convertible::value, offset_ptr&>::type @@ -389,22 +389,22 @@ class offset_ptr //!offset_ptr += difference_type. //!Never throws. - BOOST_FORCEINLINE offset_ptr &operator+= (difference_type offset) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE offset_ptr &operator+= (difference_type offset) BOOST_NOEXCEPT { this->inc_offset(offset * sizeof (PointedType)); return *this; } //!offset_ptr -= difference_type. //!Never throws. - BOOST_FORCEINLINE offset_ptr &operator-= (difference_type offset) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE offset_ptr &operator-= (difference_type offset) BOOST_NOEXCEPT { this->dec_offset(offset * sizeof (PointedType)); return *this; } //!++offset_ptr. //!Never throws. - BOOST_FORCEINLINE offset_ptr& operator++ (void) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE offset_ptr& operator++ (void) BOOST_NOEXCEPT { this->inc_offset(sizeof (PointedType)); return *this; } //!offset_ptr++. //!Never throws. - BOOST_FORCEINLINE offset_ptr operator++ (int) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE offset_ptr operator++ (int) BOOST_NOEXCEPT { offset_ptr tmp(*this); this->inc_offset(sizeof (PointedType)); @@ -413,12 +413,12 @@ class offset_ptr //!--offset_ptr. //!Never throws. - BOOST_FORCEINLINE offset_ptr& operator-- (void) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE offset_ptr& operator-- (void) BOOST_NOEXCEPT { this->dec_offset(sizeof (PointedType)); return *this; } //!offset_ptr--. //!Never throws. - BOOST_FORCEINLINE offset_ptr operator-- (int) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE offset_ptr operator-- (int) BOOST_NOEXCEPT { offset_ptr tmp(*this); this->dec_offset(sizeof (PointedType)); @@ -428,7 +428,7 @@ class offset_ptr //!safe bool conversion operator. //!Never throws. #if defined(BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS) - BOOST_FORCEINLINE operator unspecified_bool_type() const BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE operator unspecified_bool_type() const BOOST_NOEXCEPT { return this->internal.m_offset != 1? &self_t::unspecified_bool_type_func : 0; } #else explicit operator bool() const BOOST_NOEXCEPT @@ -437,7 +437,7 @@ class offset_ptr //!Not operator. Not needed in theory, but improves portability. //!Never throws - BOOST_FORCEINLINE bool operator! () const BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE bool operator! () const BOOST_NOEXCEPT { return this->internal.m_offset == 1; } //!Compatibility with pointer_traits @@ -448,92 +448,92 @@ class offset_ptr //!Compatibility with pointer_traits //! - BOOST_FORCEINLINE static offset_ptr pointer_to(reference r) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE static offset_ptr pointer_to(reference r) BOOST_NOEXCEPT { return offset_ptr(&r); } //!difference_type + offset_ptr //!operation - BOOST_FORCEINLINE friend offset_ptr operator+(difference_type diff, offset_ptr right) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend offset_ptr operator+(difference_type diff, offset_ptr right) BOOST_NOEXCEPT { right += diff; return right; } //!offset_ptr + difference_type //!operation - BOOST_FORCEINLINE friend offset_ptr operator+(offset_ptr left, difference_type diff) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend offset_ptr operator+(offset_ptr left, difference_type diff) BOOST_NOEXCEPT { left += diff; return left; } //!offset_ptr - diff //!operation - BOOST_FORCEINLINE friend offset_ptr operator-(offset_ptr left, difference_type diff) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend offset_ptr operator-(offset_ptr left, difference_type diff) BOOST_NOEXCEPT { left -= diff; return left; } //!offset_ptr - diff //!operation - BOOST_FORCEINLINE friend offset_ptr operator-(difference_type diff, offset_ptr right) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend offset_ptr operator-(difference_type diff, offset_ptr right) BOOST_NOEXCEPT { right -= diff; return right; } //!offset_ptr - offset_ptr //!operation - BOOST_FORCEINLINE friend difference_type operator-(const offset_ptr &pt, const offset_ptr &pt2) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend difference_type operator-(const offset_ptr &pt, const offset_ptr &pt2) BOOST_NOEXCEPT { return difference_type(pt.get()- pt2.get()); } //Comparison - BOOST_FORCEINLINE friend bool operator== (const offset_ptr &pt1, const offset_ptr &pt2) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend bool operator== (const offset_ptr &pt1, const offset_ptr &pt2) BOOST_NOEXCEPT { return pt1.get() == pt2.get(); } - BOOST_FORCEINLINE friend bool operator!= (const offset_ptr &pt1, const offset_ptr &pt2) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend bool operator!= (const offset_ptr &pt1, const offset_ptr &pt2) BOOST_NOEXCEPT { return pt1.get() != pt2.get(); } - BOOST_FORCEINLINE friend bool operator<(const offset_ptr &pt1, const offset_ptr &pt2) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend bool operator<(const offset_ptr &pt1, const offset_ptr &pt2) BOOST_NOEXCEPT { return pt1.get() < pt2.get(); } - BOOST_FORCEINLINE friend bool operator<=(const offset_ptr &pt1, const offset_ptr &pt2) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend bool operator<=(const offset_ptr &pt1, const offset_ptr &pt2) BOOST_NOEXCEPT { return pt1.get() <= pt2.get(); } - BOOST_FORCEINLINE friend bool operator>(const offset_ptr &pt1, const offset_ptr &pt2) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend bool operator>(const offset_ptr &pt1, const offset_ptr &pt2) BOOST_NOEXCEPT { return pt1.get() > pt2.get(); } - BOOST_FORCEINLINE friend bool operator>=(const offset_ptr &pt1, const offset_ptr &pt2) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend bool operator>=(const offset_ptr &pt1, const offset_ptr &pt2) BOOST_NOEXCEPT { return pt1.get() >= pt2.get(); } //Comparison to raw ptr to support literal 0 - BOOST_FORCEINLINE friend bool operator== (pointer pt1, const offset_ptr &pt2) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend bool operator== (pointer pt1, const offset_ptr &pt2) BOOST_NOEXCEPT { return pt1 == pt2.get(); } - BOOST_FORCEINLINE friend bool operator!= (pointer pt1, const offset_ptr &pt2) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend bool operator!= (pointer pt1, const offset_ptr &pt2) BOOST_NOEXCEPT { return pt1 != pt2.get(); } - BOOST_FORCEINLINE friend bool operator<(pointer pt1, const offset_ptr &pt2) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend bool operator<(pointer pt1, const offset_ptr &pt2) BOOST_NOEXCEPT { return pt1 < pt2.get(); } - BOOST_FORCEINLINE friend bool operator<=(pointer pt1, const offset_ptr &pt2) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend bool operator<=(pointer pt1, const offset_ptr &pt2) BOOST_NOEXCEPT { return pt1 <= pt2.get(); } - BOOST_FORCEINLINE friend bool operator>(pointer pt1, const offset_ptr &pt2) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend bool operator>(pointer pt1, const offset_ptr &pt2) BOOST_NOEXCEPT { return pt1 > pt2.get(); } - BOOST_FORCEINLINE friend bool operator>=(pointer pt1, const offset_ptr &pt2) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend bool operator>=(pointer pt1, const offset_ptr &pt2) BOOST_NOEXCEPT { return pt1 >= pt2.get(); } //Comparison - BOOST_FORCEINLINE friend bool operator== (const offset_ptr &pt1, pointer pt2) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend bool operator== (const offset_ptr &pt1, pointer pt2) BOOST_NOEXCEPT { return pt1.get() == pt2; } - BOOST_FORCEINLINE friend bool operator!= (const offset_ptr &pt1, pointer pt2) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend bool operator!= (const offset_ptr &pt1, pointer pt2) BOOST_NOEXCEPT { return pt1.get() != pt2; } - BOOST_FORCEINLINE friend bool operator<(const offset_ptr &pt1, pointer pt2) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend bool operator<(const offset_ptr &pt1, pointer pt2) BOOST_NOEXCEPT { return pt1.get() < pt2; } - BOOST_FORCEINLINE friend bool operator<=(const offset_ptr &pt1, pointer pt2) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend bool operator<=(const offset_ptr &pt1, pointer pt2) BOOST_NOEXCEPT { return pt1.get() <= pt2; } - BOOST_FORCEINLINE friend bool operator>(const offset_ptr &pt1, pointer pt2) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend bool operator>(const offset_ptr &pt1, pointer pt2) BOOST_NOEXCEPT { return pt1.get() > pt2; } - BOOST_FORCEINLINE friend bool operator>=(const offset_ptr &pt1, pointer pt2) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend bool operator>=(const offset_ptr &pt1, pointer pt2) BOOST_NOEXCEPT { return pt1.get() >= pt2; } - BOOST_FORCEINLINE friend void swap(offset_ptr &left, offset_ptr &right) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE friend void swap(offset_ptr &left, offset_ptr &right) BOOST_NOEXCEPT { pointer ptr = right.get(); right = left; @@ -542,33 +542,33 @@ class offset_ptr private: template - BOOST_FORCEINLINE void assign(const offset_ptr &ptr, ipcdetail::bool_) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE void assign(const offset_ptr &ptr, ipcdetail::bool_) BOOST_NOEXCEPT { //no need to pointer adjustment this->internal.m_offset = static_cast(ipcdetail::offset_ptr_to_offset_from_other(this, &ptr, ptr.get_offset())); } template - BOOST_FORCEINLINE void assign(const offset_ptr &ptr, ipcdetail::bool_) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE void assign(const offset_ptr &ptr, ipcdetail::bool_) BOOST_NOEXCEPT { //we must convert to raw before calculating the offset this->internal.m_offset = static_cast(ipcdetail::offset_ptr_to_offset(static_cast(ptr.get()), this)); } #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED) - BOOST_FORCEINLINE void inc_offset(DifferenceType bytes) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE void inc_offset(DifferenceType bytes) BOOST_NOEXCEPT { internal.m_offset += bytes; } - BOOST_FORCEINLINE void dec_offset(DifferenceType bytes) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE void dec_offset(DifferenceType bytes) BOOST_NOEXCEPT { internal.m_offset -= bytes; } ipcdetail::offset_ptr_internal internal; public: - BOOST_FORCEINLINE const OffsetType &priv_offset() const BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE const OffsetType &priv_offset() const BOOST_NOEXCEPT { return internal.m_offset; } - BOOST_FORCEINLINE OffsetType &priv_offset() BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE OffsetType &priv_offset() BOOST_NOEXCEPT { return internal.m_offset; } #endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED @@ -590,7 +590,7 @@ inline std::basic_istream & operator>> //!Simulation of static_cast between pointers. Never throws. template -BOOST_FORCEINLINE boost::interprocess::offset_ptr +BOOST_INTERPROCESS_FORCEINLINE boost::interprocess::offset_ptr static_pointer_cast(const boost::interprocess::offset_ptr & r) BOOST_NOEXCEPT { return boost::interprocess::offset_ptr @@ -599,7 +599,7 @@ BOOST_FORCEINLINE boost::interprocess::offset_ptr //!Simulation of const_cast between pointers. Never throws. template -BOOST_FORCEINLINE boost::interprocess::offset_ptr +BOOST_INTERPROCESS_FORCEINLINE boost::interprocess::offset_ptr const_pointer_cast(const boost::interprocess::offset_ptr & r) BOOST_NOEXCEPT { return boost::interprocess::offset_ptr @@ -608,7 +608,7 @@ BOOST_FORCEINLINE boost::interprocess::offset_ptr //!Simulation of dynamic_cast between pointers. Never throws. template -BOOST_FORCEINLINE boost::interprocess::offset_ptr +BOOST_INTERPROCESS_FORCEINLINE boost::interprocess::offset_ptr dynamic_pointer_cast(const boost::interprocess::offset_ptr & r) BOOST_NOEXCEPT { return boost::interprocess::offset_ptr @@ -617,7 +617,7 @@ BOOST_FORCEINLINE boost::interprocess::offset_ptr //!Simulation of reinterpret_cast between pointers. Never throws. template -BOOST_FORCEINLINE boost::interprocess::offset_ptr +BOOST_INTERPROCESS_FORCEINLINE boost::interprocess::offset_ptr reinterpret_pointer_cast(const boost::interprocess::offset_ptr & r) BOOST_NOEXCEPT { return boost::interprocess::offset_ptr @@ -651,7 +651,7 @@ namespace interprocess { //!to_raw_pointer() enables boost::mem_fn to recognize offset_ptr. //!Never throws. template -BOOST_FORCEINLINE T * to_raw_pointer(boost::interprocess::offset_ptr const & p) BOOST_NOEXCEPT +BOOST_INTERPROCESS_FORCEINLINE T * to_raw_pointer(boost::interprocess::offset_ptr const & p) BOOST_NOEXCEPT { return ipcdetail::to_raw_pointer(p); } } //namespace interprocess @@ -696,7 +696,7 @@ struct pointer_plus_bits, NumBits> //We must ALWAYS take argument "n" by reference as a copy of a null pointer //with a bit (e.g. offset == 3) would be incorrectly copied and interpreted as non-null. - BOOST_FORCEINLINE static pointer get_pointer(const pointer &n) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE static pointer get_pointer(const pointer &n) BOOST_NOEXCEPT { pointer p; O const tmp_off = n.priv_offset() & O(~Mask); @@ -704,7 +704,7 @@ struct pointer_plus_bits, NumBits> return p; } - BOOST_FORCEINLINE static void set_pointer(pointer &n, const pointer &p) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE static void set_pointer(pointer &n, const pointer &p) BOOST_NOEXCEPT { BOOST_ASSERT(0 == (get_bits)(p)); O const stored_bits = O(n.priv_offset() & Mask); @@ -712,12 +712,12 @@ struct pointer_plus_bits, NumBits> n.priv_offset() |= stored_bits; } - BOOST_FORCEINLINE static std::size_t get_bits(const pointer &n) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE static std::size_t get_bits(const pointer &n) BOOST_NOEXCEPT { return std::size_t((n.priv_offset() & Mask) >> 1u); } - BOOST_FORCEINLINE static void set_bits(pointer &n, std::size_t const b) BOOST_NOEXCEPT + BOOST_INTERPROCESS_FORCEINLINE static void set_bits(pointer &n, std::size_t const b) BOOST_NOEXCEPT { BOOST_ASSERT(b < (std::size_t(1) << NumBits)); O tmp = n.priv_offset(); diff --git a/cpp/BoostParts/boost/intrusive/avltree.hpp b/cpp/BoostParts/boost/intrusive/avltree.hpp index 8462293d6f..741d482827 100644 --- a/cpp/BoostParts/boost/intrusive/avltree.hpp +++ b/cpp/BoostParts/boost/intrusive/avltree.hpp @@ -121,10 +121,13 @@ class avltree_impl typedef typename implementation_defined::insert_commit_data insert_commit_data; + //! @copydoc ::boost::intrusive::bstree::bstree() + avltree_impl() + : tree_type() + {} //! @copydoc ::boost::intrusive::bstree::bstree(const key_compare &,const value_traits &) - explicit avltree_impl( const key_compare &cmp = key_compare() - , const value_traits &v_traits = value_traits()) + explicit avltree_impl( const key_compare &cmp, const value_traits &v_traits = value_traits()) : tree_type(cmp, v_traits) {} @@ -257,6 +260,14 @@ class avltree_impl (const_iterator hint, const KeyType &key ,KeyTypeKeyCompare comp, insert_commit_data &commit_data); + //! @copydoc ::boost::intrusive::bstree::insert_unique_check(const key_type&,insert_commit_data&) + std::pair insert_unique_check + (const key_type &key, insert_commit_data &commit_data); + + //! @copydoc ::boost::intrusive::bstree::insert_unique_check(const_iterator,const key_type&,insert_commit_data&) + std::pair insert_unique_check + (const_iterator hint, const key_type &key, insert_commit_data &commit_data); + //! @copydoc ::boost::intrusive::bstree::insert_unique_commit iterator insert_unique_commit(reference value, const insert_commit_data &commit_data); @@ -507,8 +518,11 @@ class avltree //Assert if passed value traits are compatible with the type BOOST_STATIC_ASSERT((detail::is_same::value)); - explicit avltree( const key_compare &cmp = key_compare() - , const value_traits &v_traits = value_traits()) + avltree() + : Base() + {} + + explicit avltree( const key_compare &cmp, const value_traits &v_traits = value_traits()) : Base(cmp, v_traits) {} diff --git a/cpp/BoostParts/boost/intrusive/bstree.hpp b/cpp/BoostParts/boost/intrusive/bstree.hpp index b08c49b5f1..0fb921887d 100644 --- a/cpp/BoostParts/boost/intrusive/bstree.hpp +++ b/cpp/BoostParts/boost/intrusive/bstree.hpp @@ -476,8 +476,20 @@ struct bstbase2 } //insert_unique_check - template std::pair insert_unique_check + (const key_type &key, insert_commit_data &commit_data) + { return this->insert_unique_check(key, this->key_comp(), commit_data); } + + std::pair insert_unique_check + (const_iterator hint, const key_type &key, insert_commit_data &commit_data) + { return this->insert_unique_check(hint, key, this->key_comp(), commit_data); } + + template + BOOST_INTRUSIVE_DOC1ST(std::pair + , typename detail::disable_if_convertible + >::type) + insert_unique_check (const KeyType &key, KeyTypeKeyCompare comp, insert_commit_data &commit_data) { std::pair ret = @@ -488,8 +500,7 @@ struct bstbase2 template std::pair insert_unique_check - (const_iterator hint, const KeyType &key - ,KeyTypeKeyCompare comp, insert_commit_data &commit_data) + (const_iterator hint, const KeyType &key, KeyTypeKeyCompare comp, insert_commit_data &commit_data) { std::pair ret = (node_algorithms::insert_unique_check @@ -679,8 +690,18 @@ class bstree_impl //! Throws: If value_traits::node_traits::node //! constructor throws (this does not happen with predefined Boost.Intrusive hooks) //! or the copy constructor of the key_compare object throws. Basic guarantee. - explicit bstree_impl( const key_compare &cmp = key_compare() - , const value_traits &v_traits = value_traits()) + bstree_impl() + : data_type(key_compare(), value_traits()) + {} + + //! Effects: Constructs an empty container with given comparison and traits. + //! + //! Complexity: Constant. + //! + //! Throws: If value_traits::node_traits::node + //! constructor throws (this does not happen with predefined Boost.Intrusive hooks) + //! or the copy constructor of the key_compare object throws. Basic guarantee. + explicit bstree_impl( const key_compare &cmp, const value_traits &v_traits = value_traits()) : data_type(cmp, v_traits) {} @@ -2052,8 +2073,11 @@ class bstree //Assert if passed value traits are compatible with the type BOOST_STATIC_ASSERT((detail::is_same::value)); - bstree( const key_compare &cmp = key_compare() - , const value_traits &v_traits = value_traits()) + bstree() + : Base() + {} + + explicit bstree( const key_compare &cmp, const value_traits &v_traits = value_traits()) : Base(cmp, v_traits) {} diff --git a/cpp/BoostParts/boost/intrusive/detail/avltree_node.hpp b/cpp/BoostParts/boost/intrusive/detail/avltree_node.hpp index 22b8fd1219..16d1c1d291 100644 --- a/cpp/BoostParts/boost/intrusive/detail/avltree_node.hpp +++ b/cpp/BoostParts/boost/intrusive/detail/avltree_node.hpp @@ -22,6 +22,7 @@ #endif #include +#include #include #include #include @@ -68,49 +69,49 @@ struct default_avltree_node_traits_impl typedef typename node::balance balance; - static node_ptr get_parent(const const_node_ptr & n) + BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const const_node_ptr & n) { return n->parent_; } - static node_ptr get_parent(const node_ptr & n) + BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const node_ptr & n) { return n->parent_; } - static void set_parent(const node_ptr & n, const node_ptr & p) + BOOST_INTRUSIVE_FORCEINLINE static void set_parent(const node_ptr & n, const node_ptr & p) { n->parent_ = p; } - static node_ptr get_left(const const_node_ptr & n) + BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const const_node_ptr & n) { return n->left_; } - static node_ptr get_left(const node_ptr & n) + BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const node_ptr & n) { return n->left_; } - static void set_left(const node_ptr & n, const node_ptr & l) + BOOST_INTRUSIVE_FORCEINLINE static void set_left(const node_ptr & n, const node_ptr & l) { n->left_ = l; } - static node_ptr get_right(const const_node_ptr & n) + BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const const_node_ptr & n) { return n->right_; } - static node_ptr get_right(const node_ptr & n) + BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const node_ptr & n) { return n->right_; } - static void set_right(const node_ptr & n, const node_ptr & r) + BOOST_INTRUSIVE_FORCEINLINE static void set_right(const node_ptr & n, const node_ptr & r) { n->right_ = r; } - static balance get_balance(const const_node_ptr & n) + BOOST_INTRUSIVE_FORCEINLINE static balance get_balance(const const_node_ptr & n) { return n->balance_; } - static balance get_balance(const node_ptr & n) + BOOST_INTRUSIVE_FORCEINLINE static balance get_balance(const node_ptr & n) { return n->balance_; } - static void set_balance(const node_ptr & n, balance b) + BOOST_INTRUSIVE_FORCEINLINE static void set_balance(const node_ptr & n, balance b) { n->balance_ = b; } - static balance negative() + BOOST_INTRUSIVE_FORCEINLINE static balance negative() { return node::negative_t; } - static balance zero() + BOOST_INTRUSIVE_FORCEINLINE static balance zero() { return node::zero_t; } - static balance positive() + BOOST_INTRUSIVE_FORCEINLINE static balance positive() { return node::positive_t; } }; @@ -126,37 +127,37 @@ struct compact_avltree_node_traits_impl typedef pointer_plus_bits ptr_bit; - static node_ptr get_parent(const const_node_ptr & n) + BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const const_node_ptr & n) { return ptr_bit::get_pointer(n->parent_); } - static void set_parent(const node_ptr & n, const node_ptr & p) + BOOST_INTRUSIVE_FORCEINLINE static void set_parent(const node_ptr & n, const node_ptr & p) { ptr_bit::set_pointer(n->parent_, p); } - static node_ptr get_left(const const_node_ptr & n) + BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const const_node_ptr & n) { return n->left_; } - static void set_left(const node_ptr & n, const node_ptr & l) + BOOST_INTRUSIVE_FORCEINLINE static void set_left(const node_ptr & n, const node_ptr & l) { n->left_ = l; } - static node_ptr get_right(const const_node_ptr & n) + BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const const_node_ptr & n) { return n->right_; } - static void set_right(const node_ptr & n, const node_ptr & r) + BOOST_INTRUSIVE_FORCEINLINE static void set_right(const node_ptr & n, const node_ptr & r) { n->right_ = r; } - static balance get_balance(const const_node_ptr & n) + BOOST_INTRUSIVE_FORCEINLINE static balance get_balance(const const_node_ptr & n) { return (balance)ptr_bit::get_bits(n->parent_); } - static void set_balance(const node_ptr & n, balance b) + BOOST_INTRUSIVE_FORCEINLINE static void set_balance(const node_ptr & n, balance b) { ptr_bit::set_bits(n->parent_, (std::size_t)b); } - static balance negative() + BOOST_INTRUSIVE_FORCEINLINE static balance negative() { return node::negative_t; } - static balance zero() + BOOST_INTRUSIVE_FORCEINLINE static balance zero() { return node::zero_t; } - static balance positive() + BOOST_INTRUSIVE_FORCEINLINE static balance positive() { return node::positive_t; } }; diff --git a/cpp/BoostParts/boost/intrusive/detail/bstree_algorithms_base.hpp b/cpp/BoostParts/boost/intrusive/detail/bstree_algorithms_base.hpp index ed28a430ea..8404010565 100644 --- a/cpp/BoostParts/boost/intrusive/detail/bstree_algorithms_base.hpp +++ b/cpp/BoostParts/boost/intrusive/detail/bstree_algorithms_base.hpp @@ -69,8 +69,8 @@ class bstree_algorithms_base static node_ptr prev_node(const node_ptr & node) { if(is_header(node)){ - return NodeTraits::get_right(node); - //return maximum(NodeTraits::get_parent(node)); + //return NodeTraits::get_right(node); + return maximum(NodeTraits::get_parent(node)); } else if(NodeTraits::get_left(node)){ return maximum(NodeTraits::get_left(node)); diff --git a/cpp/BoostParts/boost/intrusive/detail/config_begin.hpp b/cpp/BoostParts/boost/intrusive/detail/config_begin.hpp index 36d605d072..cef8616812 100644 --- a/cpp/BoostParts/boost/intrusive/detail/config_begin.hpp +++ b/cpp/BoostParts/boost/intrusive/detail/config_begin.hpp @@ -38,13 +38,18 @@ #pragma warning (disable : 4284) // odd return type for operator-> #pragma warning (disable : 4244) // possible loss of data #pragma warning (disable : 4521) ////Disable "multiple copy constructors specified" - #pragma warning (disable : 4522) + #pragma warning (disable : 4127) //conditional expression is constant #pragma warning (disable : 4146) #pragma warning (disable : 4267) //conversion from 'X' to 'Y', possible loss of data - #pragma warning (disable : 4127) //conditional expression is constant - #pragma warning (disable : 4706) //assignment within conditional expression #pragma warning (disable : 4541) //'typeid' used on polymorphic type 'boost::exception' with /GR- #pragma warning (disable : 4512) //'typeid' used on polymorphic type 'boost::exception' with /GR- + #pragma warning (disable : 4522) + #pragma warning (disable : 4706) //assignment within conditional expression + #pragma warning (disable : 4710) // function not inlined + #pragma warning (disable : 4714) // "function": marked as __forceinline not inlined + #pragma warning (disable : 4711) // function selected for automatic inline expansion + #pragma warning (disable : 4786) // identifier truncated in debug info + #pragma warning (disable : 4996) // "function": was declared deprecated #endif //#define BOOST_INTRUSIVE_USE_ITERATOR_FACADE diff --git a/cpp/BoostParts/boost/intrusive/detail/default_header_holder.hpp b/cpp/BoostParts/boost/intrusive/detail/default_header_holder.hpp index 5f9cd9a444..288f8a0e41 100644 --- a/cpp/BoostParts/boost/intrusive/detail/default_header_holder.hpp +++ b/cpp/BoostParts/boost/intrusive/detail/default_header_holder.hpp @@ -21,6 +21,7 @@ # pragma once #endif +#include #include #include @@ -39,14 +40,14 @@ struct default_header_holder : public NodeTraits::node default_header_holder() : node() {} - const_node_ptr get_node() const + BOOST_INTRUSIVE_FORCEINLINE const_node_ptr get_node() const { return pointer_traits< const_node_ptr >::pointer_to(*static_cast< const node* >(this)); } - node_ptr get_node() + BOOST_INTRUSIVE_FORCEINLINE node_ptr get_node() { return pointer_traits< node_ptr >::pointer_to(*static_cast< node* >(this)); } // (unsafe) downcast used to implement container-from-iterator - static default_header_holder* get_holder(const node_ptr &p) + BOOST_INTRUSIVE_FORCEINLINE static default_header_holder* get_holder(const node_ptr &p) { return static_cast< default_header_holder* >(boost::intrusive::detail::to_raw_pointer(p)); } }; diff --git a/cpp/BoostParts/boost/intrusive/detail/ebo_functor_holder.hpp b/cpp/BoostParts/boost/intrusive/detail/ebo_functor_holder.hpp index 9fec5a32b7..ef278ed805 100644 --- a/cpp/BoostParts/boost/intrusive/detail/ebo_functor_holder.hpp +++ b/cpp/BoostParts/boost/intrusive/detail/ebo_functor_holder.hpp @@ -22,6 +22,7 @@ # pragma once #endif +#include #include namespace boost { @@ -165,57 +166,57 @@ class ebo_functor_holder public: typedef T functor_type; - ebo_functor_holder() + BOOST_INTRUSIVE_FORCEINLINE ebo_functor_holder() : t_() {} - explicit ebo_functor_holder(const T &t) + BOOST_INTRUSIVE_FORCEINLINE explicit ebo_functor_holder(const T &t) : t_(t) {} - explicit ebo_functor_holder(BOOST_RV_REF(T) t) + BOOST_INTRUSIVE_FORCEINLINE explicit ebo_functor_holder(BOOST_RV_REF(T) t) : t_(::boost::move(t)) {} template - ebo_functor_holder(BOOST_FWD_REF(Arg1) arg1, BOOST_FWD_REF(Arg2) arg2) + BOOST_INTRUSIVE_FORCEINLINE ebo_functor_holder(BOOST_FWD_REF(Arg1) arg1, BOOST_FWD_REF(Arg2) arg2) : t_(::boost::forward(arg1), ::boost::forward(arg2)) {} - ebo_functor_holder(const ebo_functor_holder &x) - : t_(x) + BOOST_INTRUSIVE_FORCEINLINE ebo_functor_holder(const ebo_functor_holder &x) + : t_(x.t_) {} - ebo_functor_holder(BOOST_RV_REF(ebo_functor_holder) x) + BOOST_INTRUSIVE_FORCEINLINE ebo_functor_holder(BOOST_RV_REF(ebo_functor_holder) x) : t_(x.t_) {} - ebo_functor_holder& operator=(BOOST_COPY_ASSIGN_REF(ebo_functor_holder) x) + BOOST_INTRUSIVE_FORCEINLINE ebo_functor_holder& operator=(BOOST_COPY_ASSIGN_REF(ebo_functor_holder) x) { this->get() = x.get(); return *this; } - ebo_functor_holder& operator=(BOOST_RV_REF(ebo_functor_holder) x) + BOOST_INTRUSIVE_FORCEINLINE ebo_functor_holder& operator=(BOOST_RV_REF(ebo_functor_holder) x) { this->get() = ::boost::move(x.get()); return *this; } - ebo_functor_holder& operator=(const T &x) + BOOST_INTRUSIVE_FORCEINLINE ebo_functor_holder& operator=(const T &x) { this->get() = x; return *this; } - ebo_functor_holder& operator=(BOOST_RV_REF(T) x) + BOOST_INTRUSIVE_FORCEINLINE ebo_functor_holder& operator=(BOOST_RV_REF(T) x) { this->get() = ::boost::move(x); return *this; } - T& get(){return t_;} - const T& get()const{return t_;} + BOOST_INTRUSIVE_FORCEINLINE T& get(){return t_;} + BOOST_INTRUSIVE_FORCEINLINE const T& get()const{return t_;} private: T t_; @@ -230,58 +231,58 @@ class ebo_functor_holder public: typedef T functor_type; - ebo_functor_holder() + BOOST_INTRUSIVE_FORCEINLINE ebo_functor_holder() : T() {} - explicit ebo_functor_holder(const T &t) + BOOST_INTRUSIVE_FORCEINLINE explicit ebo_functor_holder(const T &t) : T(t) {} - explicit ebo_functor_holder(BOOST_RV_REF(T) t) + BOOST_INTRUSIVE_FORCEINLINE explicit ebo_functor_holder(BOOST_RV_REF(T) t) : T(::boost::move(t)) {} template - ebo_functor_holder(BOOST_FWD_REF(Arg1) arg1, BOOST_FWD_REF(Arg2) arg2) + BOOST_INTRUSIVE_FORCEINLINE ebo_functor_holder(BOOST_FWD_REF(Arg1) arg1, BOOST_FWD_REF(Arg2) arg2) : T(::boost::forward(arg1), ::boost::forward(arg2)) {} - ebo_functor_holder(const ebo_functor_holder &x) + BOOST_INTRUSIVE_FORCEINLINE ebo_functor_holder(const ebo_functor_holder &x) : T(static_cast(x)) {} - ebo_functor_holder(BOOST_RV_REF(ebo_functor_holder) x) + BOOST_INTRUSIVE_FORCEINLINE ebo_functor_holder(BOOST_RV_REF(ebo_functor_holder) x) : T(BOOST_MOVE_BASE(T, x)) {} - ebo_functor_holder& operator=(BOOST_COPY_ASSIGN_REF(ebo_functor_holder) x) + BOOST_INTRUSIVE_FORCEINLINE ebo_functor_holder& operator=(BOOST_COPY_ASSIGN_REF(ebo_functor_holder) x) { const ebo_functor_holder&r = x; this->get() = x.get(); return *this; } - ebo_functor_holder& operator=(BOOST_RV_REF(ebo_functor_holder) x) + BOOST_INTRUSIVE_FORCEINLINE ebo_functor_holder& operator=(BOOST_RV_REF(ebo_functor_holder) x) { this->get() = ::boost::move(x.get()); return *this; } - ebo_functor_holder& operator=(const T &x) + BOOST_INTRUSIVE_FORCEINLINE ebo_functor_holder& operator=(const T &x) { this->get() = x; return *this; } - ebo_functor_holder& operator=(BOOST_RV_REF(T) x) + BOOST_INTRUSIVE_FORCEINLINE ebo_functor_holder& operator=(BOOST_RV_REF(T) x) { this->get() = ::boost::move(x); return *this; } - T& get(){return *this;} - const T& get()const{return *this;} + BOOST_INTRUSIVE_FORCEINLINE T& get(){return *this;} + BOOST_INTRUSIVE_FORCEINLINE const T& get()const{return *this;} }; } //namespace detail { diff --git a/cpp/BoostParts/boost/intrusive/detail/equal_to_value.hpp b/cpp/BoostParts/boost/intrusive/detail/equal_to_value.hpp index c341f488e9..c5d9e5305c 100644 --- a/cpp/BoostParts/boost/intrusive/detail/equal_to_value.hpp +++ b/cpp/BoostParts/boost/intrusive/detail/equal_to_value.hpp @@ -21,6 +21,8 @@ # pragma once #endif +#include + namespace boost { namespace intrusive { namespace detail { @@ -37,7 +39,7 @@ class equal_to_value : t_(t) {} - bool operator()(ConstReference t)const + BOOST_INTRUSIVE_FORCEINLINE bool operator()(ConstReference t)const { return t_ == t; } }; diff --git a/cpp/BoostParts/boost/intrusive/detail/exception_disposer.hpp b/cpp/BoostParts/boost/intrusive/detail/exception_disposer.hpp index a10d63a75d..91c5bf3b67 100644 --- a/cpp/BoostParts/boost/intrusive/detail/exception_disposer.hpp +++ b/cpp/BoostParts/boost/intrusive/detail/exception_disposer.hpp @@ -21,6 +21,8 @@ # pragma once #endif +#include + namespace boost { namespace intrusive { namespace detail { @@ -39,7 +41,7 @@ class exception_disposer : cont_(&cont), disp_(disp) {} - void release() + BOOST_INTRUSIVE_FORCEINLINE void release() { cont_ = 0; } ~exception_disposer() @@ -67,7 +69,7 @@ class exception_array_disposer : cont_(&cont), disp_(disp), constructed_(constructed) {} - void release() + BOOST_INTRUSIVE_FORCEINLINE void release() { cont_ = 0; } ~exception_array_disposer() diff --git a/cpp/BoostParts/boost/intrusive/detail/has_member_function_callable_with.hpp b/cpp/BoostParts/boost/intrusive/detail/has_member_function_callable_with.hpp index c9a8e7e637..2e73305d17 100644 --- a/cpp/BoostParts/boost/intrusive/detail/has_member_function_callable_with.hpp +++ b/cpp/BoostParts/boost/intrusive/detail/has_member_function_callable_with.hpp @@ -164,13 +164,14 @@ BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEG { struct BaseMixin { - void BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME(); + void BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME() + {} //Some compilers require the definition or linker errors happen }; struct Base : public boost_intrusive_hmfcw::remove_cv::type, public BaseMixin { //Declare the unneeded default constructor as some old compilers wrongly require it with is_convertible - Base(); + Base(){} }; template class Helper{}; diff --git a/cpp/BoostParts/boost/intrusive/detail/hook_traits.hpp b/cpp/BoostParts/boost/intrusive/detail/hook_traits.hpp index 71f342af06..2a16061a54 100644 --- a/cpp/BoostParts/boost/intrusive/detail/hook_traits.hpp +++ b/cpp/BoostParts/boost/intrusive/detail/hook_traits.hpp @@ -21,6 +21,7 @@ # pragma once #endif +#include #include #include #include @@ -54,25 +55,25 @@ struct bhtraits_base typedef node& node_reference; typedef const node & const_node_reference; - static pointer to_value_ptr(const node_ptr & n) + BOOST_INTRUSIVE_FORCEINLINE static pointer to_value_ptr(const node_ptr & n) { return pointer_traits::pointer_to (static_cast(static_cast(*n))); } - static const_pointer to_value_ptr(const const_node_ptr & n) + BOOST_INTRUSIVE_FORCEINLINE static const_pointer to_value_ptr(const const_node_ptr & n) { return pointer_traits::pointer_to (static_cast(static_cast(*n))); } - static node_ptr to_node_ptr(reference value) + BOOST_INTRUSIVE_FORCEINLINE static node_ptr to_node_ptr(reference value) { return pointer_traits::pointer_to (static_cast(static_cast(value))); } - static const_node_ptr to_node_ptr(const_reference value) + BOOST_INTRUSIVE_FORCEINLINE static const_node_ptr to_node_ptr(const_reference value) { return pointer_traits::pointer_to (static_cast(static_cast(value))); @@ -111,26 +112,26 @@ struct mhtraits static const link_mode_type link_mode = Hook::hooktags::link_mode; - static node_ptr to_node_ptr(reference value) + BOOST_INTRUSIVE_FORCEINLINE static node_ptr to_node_ptr(reference value) { return pointer_traits::pointer_to (static_cast(static_cast(value.*P))); } - static const_node_ptr to_node_ptr(const_reference value) + BOOST_INTRUSIVE_FORCEINLINE static const_node_ptr to_node_ptr(const_reference value) { return pointer_traits::pointer_to (static_cast(static_cast(value.*P))); } - static pointer to_value_ptr(const node_ptr & n) + BOOST_INTRUSIVE_FORCEINLINE static pointer to_value_ptr(const node_ptr & n) { return pointer_traits::pointer_to (*detail::parent_from_member (static_cast(boost::intrusive::detail::to_raw_pointer(n)), P)); } - static const_pointer to_value_ptr(const const_node_ptr & n) + BOOST_INTRUSIVE_FORCEINLINE static const_pointer to_value_ptr(const const_node_ptr & n) { return pointer_traits::pointer_to (*detail::parent_from_member diff --git a/cpp/BoostParts/boost/intrusive/detail/iiterator.hpp b/cpp/BoostParts/boost/intrusive/detail/iiterator.hpp index 5c6721bd0e..5ab1de2bb1 100644 --- a/cpp/BoostParts/boost/intrusive/detail/iiterator.hpp +++ b/cpp/BoostParts/boost/intrusive/detail/iiterator.hpp @@ -21,6 +21,7 @@ # pragma once #endif +#include #include #include #include @@ -70,7 +71,7 @@ struct iiterator , difference_type , pointer , reference - > iterator_traits; + > iterator_type; typedef typename value_traits_pointers ::value_traits_ptr value_traits_ptr; typedef typename value_traits_pointers @@ -83,15 +84,15 @@ template struct iiterator_members { - iiterator_members() + BOOST_INTRUSIVE_FORCEINLINE iiterator_members() : nodeptr_()//Value initialization to achieve "null iterators" (N3644) {} - iiterator_members(const NodePtr &n_ptr, const StoredPointer &data) + BOOST_INTRUSIVE_FORCEINLINE iiterator_members(const NodePtr &n_ptr, const StoredPointer &data) : nodeptr_(n_ptr), ptr_(data) {} - StoredPointer get_ptr() const + BOOST_INTRUSIVE_FORCEINLINE StoredPointer get_ptr() const { return ptr_; } NodePtr nodeptr_; @@ -101,15 +102,15 @@ struct iiterator_members template struct iiterator_members { - iiterator_members() + BOOST_INTRUSIVE_FORCEINLINE iiterator_members() : nodeptr_()//Value initialization to achieve "null iterators" (N3644) {} - iiterator_members(const NodePtr &n_ptr, const StoredPointer &) + BOOST_INTRUSIVE_FORCEINLINE iiterator_members(const NodePtr &n_ptr, const StoredPointer &) : nodeptr_(n_ptr) {} - StoredPointer get_ptr() const + BOOST_INTRUSIVE_FORCEINLINE StoredPointer get_ptr() const { return StoredPointer(); } NodePtr nodeptr_; diff --git a/cpp/BoostParts/boost/intrusive/detail/iterator.hpp b/cpp/BoostParts/boost/intrusive/detail/iterator.hpp index 9f0fe606f4..2ae6abb7d0 100644 --- a/cpp/BoostParts/boost/intrusive/detail/iterator.hpp +++ b/cpp/BoostParts/boost/intrusive/detail/iterator.hpp @@ -23,6 +23,7 @@ #include #include +#include #include #include @@ -34,14 +35,14 @@ using boost::movelib::iterator_traits; //////////////////// // iterator //////////////////// -template +template struct iterator { - typedef Category iterator_category; - typedef T value_type; - typedef Distance difference_type; - typedef Pointer pointer; - typedef Reference reference; + typedef Category iterator_category; + typedef T value_type; + typedef Difference difference_type; + typedef Pointer pointer; + typedef Reference reference; }; //////////////////////////////////////// @@ -83,7 +84,7 @@ struct iterator_disable_if_tag_difference_type //////////////////// // advance //////////////////// -template inline +template typename iterator_enable_if_tag::type iterator_advance(InputIt& it, Distance n) { @@ -91,7 +92,7 @@ typename iterator_enable_if_tag::type ++it; } -template inline +template typename iterator_enable_if_tag::type iterator_advance(InputIt& it, Distance n) { @@ -99,7 +100,7 @@ typename iterator_enable_if_tag::type ++it; } -template inline +template typename iterator_enable_if_tag::type iterator_advance(InputIt& it, Distance n) { @@ -109,8 +110,8 @@ typename iterator_enable_if_tag::type --it; } -template inline -typename iterator_enable_if_tag::type +template +BOOST_INTRUSIVE_FORCEINLINE typename iterator_enable_if_tag::type iterator_advance(InputIt& it, Distance n) { it += n; @@ -132,8 +133,8 @@ typename iterator_disable_if_tag_difference_type return off; } -template inline -typename iterator_enable_if_tag_difference_type +template +BOOST_INTRUSIVE_FORCEINLINE typename iterator_enable_if_tag_difference_type ::type iterator_distance(InputIt first, InputIt last) { @@ -142,11 +143,11 @@ typename iterator_enable_if_tag_difference_type } template -typename iterator_traits::pointer iterator_arrow_result(const I &i) +BOOST_INTRUSIVE_FORCEINLINE typename iterator_traits::pointer iterator_arrow_result(const I &i) { return i.operator->(); } template -T * iterator_arrow_result(T *p) +BOOST_INTRUSIVE_FORCEINLINE T * iterator_arrow_result(T *p) { return p; } } //namespace intrusive diff --git a/cpp/BoostParts/boost/intrusive/detail/parent_from_member.hpp b/cpp/BoostParts/boost/intrusive/detail/parent_from_member.hpp index 8701c3f269..275229ab47 100644 --- a/cpp/BoostParts/boost/intrusive/detail/parent_from_member.hpp +++ b/cpp/BoostParts/boost/intrusive/detail/parent_from_member.hpp @@ -21,9 +21,10 @@ #endif #include +#include #include -#if defined(BOOST_MSVC) || ((defined(_WIN32) || defined(__WIN32__) || defined(WIN32)) && defined(BOOST_INTEL)) +#if defined(_MSC_VER) #define BOOST_INTRUSIVE_MSVC_ABI_PTR_TO_MEMBER #include #endif @@ -33,7 +34,7 @@ namespace intrusive { namespace detail { template -inline std::ptrdiff_t offset_from_pointer_to_member(const Member Parent::* ptr_to_member) +BOOST_INTRUSIVE_FORCEINLINE std::ptrdiff_t offset_from_pointer_to_member(const Member Parent::* ptr_to_member) { //The implementation of a pointer to member is compiler dependent. #if defined(BOOST_INTRUSIVE_MSVC_ABI_PTR_TO_MEMBER) @@ -88,7 +89,7 @@ inline std::ptrdiff_t offset_from_pointer_to_member(const Member Parent::* ptr_t } template -inline Parent *parent_from_member(Member *member, const Member Parent::* ptr_to_member) +BOOST_INTRUSIVE_FORCEINLINE Parent *parent_from_member(Member *member, const Member Parent::* ptr_to_member) { return static_cast ( @@ -100,7 +101,7 @@ inline Parent *parent_from_member(Member *member, const Member Parent::* ptr_to_ } template -inline const Parent *parent_from_member(const Member *member, const Member Parent::* ptr_to_member) +BOOST_INTRUSIVE_FORCEINLINE const Parent *parent_from_member(const Member *member, const Member Parent::* ptr_to_member) { return static_cast ( diff --git a/cpp/BoostParts/boost/intrusive/detail/rbtree_node.hpp b/cpp/BoostParts/boost/intrusive/detail/rbtree_node.hpp index c4364399d8..68f4bdf8e2 100644 --- a/cpp/BoostParts/boost/intrusive/detail/rbtree_node.hpp +++ b/cpp/BoostParts/boost/intrusive/detail/rbtree_node.hpp @@ -23,6 +23,7 @@ #endif #include +#include #include #include #include @@ -73,46 +74,46 @@ struct default_rbtree_node_traits_impl typedef typename node::color color; - static node_ptr get_parent(const const_node_ptr & n) + BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const const_node_ptr & n) { return n->parent_; } - static node_ptr get_parent(const node_ptr & n) + BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const node_ptr & n) { return n->parent_; } - static void set_parent(const node_ptr & n, const node_ptr & p) + BOOST_INTRUSIVE_FORCEINLINE static void set_parent(const node_ptr & n, const node_ptr & p) { n->parent_ = p; } - static node_ptr get_left(const const_node_ptr & n) + BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const const_node_ptr & n) { return n->left_; } - static node_ptr get_left(const node_ptr & n) + BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const node_ptr & n) { return n->left_; } - static void set_left(const node_ptr & n, const node_ptr & l) + BOOST_INTRUSIVE_FORCEINLINE static void set_left(const node_ptr & n, const node_ptr & l) { n->left_ = l; } - static node_ptr get_right(const const_node_ptr & n) + BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const const_node_ptr & n) { return n->right_; } - static node_ptr get_right(const node_ptr & n) + BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const node_ptr & n) { return n->right_; } - static void set_right(const node_ptr & n, const node_ptr & r) + BOOST_INTRUSIVE_FORCEINLINE static void set_right(const node_ptr & n, const node_ptr & r) { n->right_ = r; } - static color get_color(const const_node_ptr & n) + BOOST_INTRUSIVE_FORCEINLINE static color get_color(const const_node_ptr & n) { return n->color_; } - static color get_color(const node_ptr & n) + BOOST_INTRUSIVE_FORCEINLINE static color get_color(const node_ptr & n) { return n->color_; } - static void set_color(const node_ptr & n, color c) + BOOST_INTRUSIVE_FORCEINLINE static void set_color(const node_ptr & n, color c) { n->color_ = c; } - static color black() + BOOST_INTRUSIVE_FORCEINLINE static color black() { return node::black_t; } - static color red() + BOOST_INTRUSIVE_FORCEINLINE static color red() { return node::red_t; } }; @@ -129,46 +130,46 @@ struct compact_rbtree_node_traits_impl typedef typename node::color color; - static node_ptr get_parent(const const_node_ptr & n) + BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const const_node_ptr & n) { return ptr_bit::get_pointer(n->parent_); } - static node_ptr get_parent(const node_ptr & n) + BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const node_ptr & n) { return ptr_bit::get_pointer(n->parent_); } - static void set_parent(const node_ptr & n, const node_ptr & p) + BOOST_INTRUSIVE_FORCEINLINE static void set_parent(const node_ptr & n, const node_ptr & p) { ptr_bit::set_pointer(n->parent_, p); } - static node_ptr get_left(const const_node_ptr & n) + BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const const_node_ptr & n) { return n->left_; } - static node_ptr get_left(const node_ptr & n) + BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const node_ptr & n) { return n->left_; } - static void set_left(const node_ptr & n, const node_ptr & l) + BOOST_INTRUSIVE_FORCEINLINE static void set_left(const node_ptr & n, const node_ptr & l) { n->left_ = l; } - static node_ptr get_right(const const_node_ptr & n) + BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const const_node_ptr & n) { return n->right_; } - static node_ptr get_right(const node_ptr & n) + BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const node_ptr & n) { return n->right_; } - static void set_right(const node_ptr & n, const node_ptr & r) + BOOST_INTRUSIVE_FORCEINLINE static void set_right(const node_ptr & n, const node_ptr & r) { n->right_ = r; } - static color get_color(const const_node_ptr & n) + BOOST_INTRUSIVE_FORCEINLINE static color get_color(const const_node_ptr & n) { return (color)ptr_bit::get_bits(n->parent_); } - static color get_color(const node_ptr & n) + BOOST_INTRUSIVE_FORCEINLINE static color get_color(const node_ptr & n) { return (color)ptr_bit::get_bits(n->parent_); } - static void set_color(const node_ptr & n, color c) + BOOST_INTRUSIVE_FORCEINLINE static void set_color(const node_ptr & n, color c) { ptr_bit::set_bits(n->parent_, c != 0); } - static color black() + BOOST_INTRUSIVE_FORCEINLINE static color black() { return node::black_t; } - static color red() + BOOST_INTRUSIVE_FORCEINLINE static color red() { return node::red_t; } }; diff --git a/cpp/BoostParts/boost/intrusive/detail/reverse_iterator.hpp b/cpp/BoostParts/boost/intrusive/detail/reverse_iterator.hpp index 552e8f4d71..57631feb5d 100644 --- a/cpp/BoostParts/boost/intrusive/detail/reverse_iterator.hpp +++ b/cpp/BoostParts/boost/intrusive/detail/reverse_iterator.hpp @@ -43,12 +43,16 @@ class reverse_iterator reverse_iterator() : m_current() //Value initialization to achieve "null iterators" (N3644) - {} + {} explicit reverse_iterator(It r) : m_current(r) {} + reverse_iterator(const reverse_iterator& r) + : m_current(r.base()) + {} + template reverse_iterator( const reverse_iterator& r , typename boost::intrusive::detail::enable_if_convertible::type* =0 @@ -56,6 +60,9 @@ class reverse_iterator : m_current(r.base()) {} + reverse_iterator & operator=( const reverse_iterator& r) + { m_current = r.base(); return *this; } + template typename boost::intrusive::detail::enable_if_convertible::type operator=( const reverse_iterator& r) @@ -65,20 +72,34 @@ class reverse_iterator { return m_current; } reference operator*() const - { It temp(m_current); --temp; return *temp; } + { + It temp(m_current); + --temp; + reference r = *temp; + return r; + } pointer operator->() const - { It temp(m_current); --temp; return iterator_arrow_result(temp); } + { + It temp(m_current); + --temp; + return iterator_arrow_result(temp); + } reference operator[](difference_type off) const - { return this->m_current[-off - 1]; } + { + return this->m_current[-off - 1]; + } reverse_iterator& operator++() - { --m_current; return *this; } + { + --m_current; + return *this; + } reverse_iterator operator++(int) { - reverse_iterator temp = *this; + reverse_iterator temp((*this)); --m_current; return temp; } @@ -91,7 +112,7 @@ class reverse_iterator reverse_iterator operator--(int) { - reverse_iterator temp(*this); + reverse_iterator temp((*this)); ++m_current; return temp; } @@ -117,17 +138,17 @@ class reverse_iterator reverse_iterator& operator+=(difference_type off) { m_current -= off; return *this; } + reverse_iterator& operator-=(difference_type off) + { m_current += off; return *this; } + friend reverse_iterator operator+(reverse_iterator l, difference_type off) - { l.m_current -= off; return l; } + { return (l += off); } friend reverse_iterator operator+(difference_type off, reverse_iterator r) { return (r += off); } - reverse_iterator& operator-=(difference_type off) - { m_current += off; return *this; } - friend reverse_iterator operator-(reverse_iterator l, difference_type off) - { l.m_current += off; return l; } + { return (l-= off); } friend difference_type operator-(const reverse_iterator& l, const reverse_iterator& r) { return r.m_current - l.m_current; } diff --git a/cpp/BoostParts/boost/intrusive/detail/size_holder.hpp b/cpp/BoostParts/boost/intrusive/detail/size_holder.hpp index de1933ed50..9802ac32f1 100644 --- a/cpp/BoostParts/boost/intrusive/detail/size_holder.hpp +++ b/cpp/BoostParts/boost/intrusive/detail/size_holder.hpp @@ -21,6 +21,8 @@ # pragma once #endif +#include + namespace boost { namespace intrusive { namespace detail { @@ -31,22 +33,22 @@ struct size_holder static const bool constant_time_size = ConstantSize; typedef SizeType size_type; - SizeType get_size() const + BOOST_INTRUSIVE_FORCEINLINE SizeType get_size() const { return size_; } - void set_size(SizeType size) + BOOST_INTRUSIVE_FORCEINLINE void set_size(SizeType size) { size_ = size; } - void decrement() + BOOST_INTRUSIVE_FORCEINLINE void decrement() { --size_; } - void increment() + BOOST_INTRUSIVE_FORCEINLINE void increment() { ++size_; } - void increase(SizeType n) + BOOST_INTRUSIVE_FORCEINLINE void increase(SizeType n) { size_ += n; } - void decrease(SizeType n) + BOOST_INTRUSIVE_FORCEINLINE void decrease(SizeType n) { size_ -= n; } SizeType size_; @@ -58,22 +60,22 @@ struct size_holder static const bool constant_time_size = false; typedef SizeType size_type; - size_type get_size() const + BOOST_INTRUSIVE_FORCEINLINE size_type get_size() const { return 0; } - void set_size(size_type) + BOOST_INTRUSIVE_FORCEINLINE void set_size(size_type) {} - void decrement() + BOOST_INTRUSIVE_FORCEINLINE void decrement() {} - void increment() + BOOST_INTRUSIVE_FORCEINLINE void increment() {} - void increase(SizeType) + BOOST_INTRUSIVE_FORCEINLINE void increase(SizeType) {} - void decrease(SizeType) + BOOST_INTRUSIVE_FORCEINLINE void decrease(SizeType) {} }; diff --git a/cpp/BoostParts/boost/intrusive/detail/slist_iterator.hpp b/cpp/BoostParts/boost/intrusive/detail/slist_iterator.hpp index 1699064ec1..63ce5c3fef 100644 --- a/cpp/BoostParts/boost/intrusive/detail/slist_iterator.hpp +++ b/cpp/BoostParts/boost/intrusive/detail/slist_iterator.hpp @@ -23,6 +23,7 @@ #endif #include +#include #include #include #include @@ -50,67 +51,67 @@ class slist_iterator typedef typename types_t::const_value_traits_ptr const_value_traits_ptr; public: - typedef typename types_t::iterator_traits::difference_type difference_type; - typedef typename types_t::iterator_traits::value_type value_type; - typedef typename types_t::iterator_traits::pointer pointer; - typedef typename types_t::iterator_traits::reference reference; - typedef typename types_t::iterator_traits::iterator_category iterator_category; + typedef typename types_t::iterator_type::difference_type difference_type; + typedef typename types_t::iterator_type::value_type value_type; + typedef typename types_t::iterator_type::pointer pointer; + typedef typename types_t::iterator_type::reference reference; + typedef typename types_t::iterator_type::iterator_category iterator_category; - slist_iterator() + BOOST_INTRUSIVE_FORCEINLINE slist_iterator() {} - explicit slist_iterator(const node_ptr & nodeptr, const const_value_traits_ptr &traits_ptr) + BOOST_INTRUSIVE_FORCEINLINE explicit slist_iterator(const node_ptr & nodeptr, const const_value_traits_ptr &traits_ptr) : members_(nodeptr, traits_ptr) {} - slist_iterator(slist_iterator const& other) + BOOST_INTRUSIVE_FORCEINLINE slist_iterator(slist_iterator const& other) : members_(other.pointed_node(), other.get_value_traits()) {} - const node_ptr &pointed_node() const + BOOST_INTRUSIVE_FORCEINLINE const node_ptr &pointed_node() const { return members_.nodeptr_; } - slist_iterator &operator=(const node_ptr &node) + BOOST_INTRUSIVE_FORCEINLINE slist_iterator &operator=(const node_ptr &node) { members_.nodeptr_ = node; return static_cast(*this); } - const_value_traits_ptr get_value_traits() const + BOOST_INTRUSIVE_FORCEINLINE const_value_traits_ptr get_value_traits() const { return members_.get_ptr(); } public: - slist_iterator& operator++() + BOOST_INTRUSIVE_FORCEINLINE slist_iterator& operator++() { members_.nodeptr_ = node_traits::get_next(members_.nodeptr_); return static_cast (*this); } - slist_iterator operator++(int) + BOOST_INTRUSIVE_FORCEINLINE slist_iterator operator++(int) { slist_iterator result (*this); members_.nodeptr_ = node_traits::get_next(members_.nodeptr_); return result; } - friend bool operator== (const slist_iterator& l, const slist_iterator& r) + BOOST_INTRUSIVE_FORCEINLINE friend bool operator== (const slist_iterator& l, const slist_iterator& r) { return l.pointed_node() == r.pointed_node(); } - friend bool operator!= (const slist_iterator& l, const slist_iterator& r) + BOOST_INTRUSIVE_FORCEINLINE friend bool operator!= (const slist_iterator& l, const slist_iterator& r) { return !(l == r); } - reference operator*() const + BOOST_INTRUSIVE_FORCEINLINE reference operator*() const { return *operator->(); } - pointer operator->() const + BOOST_INTRUSIVE_FORCEINLINE pointer operator->() const { return this->operator_arrow(detail::bool_()); } - slist_iterator unconst() const + BOOST_INTRUSIVE_FORCEINLINE slist_iterator unconst() const { return slist_iterator(this->pointed_node(), this->get_value_traits()); } private: - pointer operator_arrow(detail::false_) const + BOOST_INTRUSIVE_FORCEINLINE pointer operator_arrow(detail::false_) const { return ValueTraits::to_value_ptr(members_.nodeptr_); } - pointer operator_arrow(detail::true_) const + BOOST_INTRUSIVE_FORCEINLINE pointer operator_arrow(detail::true_) const { return this->get_value_traits()->to_value_ptr(members_.nodeptr_); } iiterator_members members_; diff --git a/cpp/BoostParts/boost/intrusive/detail/slist_node.hpp b/cpp/BoostParts/boost/intrusive/detail/slist_node.hpp index 3d5fbfb6e5..848764e571 100644 --- a/cpp/BoostParts/boost/intrusive/detail/slist_node.hpp +++ b/cpp/BoostParts/boost/intrusive/detail/slist_node.hpp @@ -23,6 +23,7 @@ #endif #include +#include #include namespace boost { @@ -45,13 +46,13 @@ struct slist_node_traits typedef typename node::node_ptr node_ptr; typedef typename pointer_rebind::type const_node_ptr; - static node_ptr get_next(const const_node_ptr & n) + BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_next(const const_node_ptr & n) { return n->next_; } - static node_ptr get_next(const node_ptr & n) + BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_next(const node_ptr & n) { return n->next_; } - static void set_next(const node_ptr & n, const node_ptr & next) + BOOST_INTRUSIVE_FORCEINLINE static void set_next(const node_ptr & n, const node_ptr & next) { n->next_ = next; } }; diff --git a/cpp/BoostParts/boost/intrusive/detail/to_raw_pointer.hpp b/cpp/BoostParts/boost/intrusive/detail/to_raw_pointer.hpp index 387f63f2a4..8ea884959d 100644 --- a/cpp/BoostParts/boost/intrusive/detail/to_raw_pointer.hpp +++ b/cpp/BoostParts/boost/intrusive/detail/to_raw_pointer.hpp @@ -22,6 +22,7 @@ #endif #include +#include #include namespace boost { @@ -29,11 +30,11 @@ namespace intrusive { namespace detail { template -inline T* to_raw_pointer(T* p) +BOOST_INTRUSIVE_FORCEINLINE T* to_raw_pointer(T* p) { return p; } template -inline typename boost::intrusive::pointer_element::type* +BOOST_INTRUSIVE_FORCEINLINE typename boost::intrusive::pointer_element::type* to_raw_pointer(const Pointer &p) { return boost::intrusive::detail::to_raw_pointer(p.operator->()); } diff --git a/cpp/BoostParts/boost/intrusive/detail/tree_iterator.hpp b/cpp/BoostParts/boost/intrusive/detail/tree_iterator.hpp index 4985c6ce7b..f36a1f244b 100644 --- a/cpp/BoostParts/boost/intrusive/detail/tree_iterator.hpp +++ b/cpp/BoostParts/boost/intrusive/detail/tree_iterator.hpp @@ -22,6 +22,7 @@ #endif #include +#include #include #include #include @@ -56,27 +57,27 @@ class tree_iterator typedef void (tree_iterator::*unspecified_bool_type)() const; public: - typedef typename types_t::iterator_traits::difference_type difference_type; - typedef typename types_t::iterator_traits::value_type value_type; - typedef typename types_t::iterator_traits::pointer pointer; - typedef typename types_t::iterator_traits::reference reference; - typedef typename types_t::iterator_traits::iterator_category iterator_category; + typedef typename types_t::iterator_type::difference_type difference_type; + typedef typename types_t::iterator_type::value_type value_type; + typedef typename types_t::iterator_type::pointer pointer; + typedef typename types_t::iterator_type::reference reference; + typedef typename types_t::iterator_type::iterator_category iterator_category; - tree_iterator() + BOOST_INTRUSIVE_FORCEINLINE tree_iterator() {} - explicit tree_iterator(const node_ptr & nodeptr, const const_value_traits_ptr &traits_ptr) + BOOST_INTRUSIVE_FORCEINLINE explicit tree_iterator(const node_ptr & nodeptr, const const_value_traits_ptr &traits_ptr) : members_(nodeptr, traits_ptr) {} - tree_iterator(tree_iterator const& other) + BOOST_INTRUSIVE_FORCEINLINE tree_iterator(tree_iterator const& other) : members_(other.pointed_node(), other.get_value_traits()) {} - const node_ptr &pointed_node() const + BOOST_INTRUSIVE_FORCEINLINE const node_ptr &pointed_node() const { return members_.nodeptr_; } - tree_iterator &operator=(const node_ptr &nodeptr) + BOOST_INTRUSIVE_FORCEINLINE tree_iterator &operator=(const node_ptr &nodeptr) { members_.nodeptr_ = nodeptr; return static_cast(*this); } public: @@ -106,43 +107,43 @@ class tree_iterator return result; } - tree_iterator& go_left() + BOOST_INTRUSIVE_FORCEINLINE tree_iterator& go_left() { members_.nodeptr_ = node_traits::get_left(members_.nodeptr_); return static_cast (*this); } - tree_iterator& go_right() + BOOST_INTRUSIVE_FORCEINLINE tree_iterator& go_right() { members_.nodeptr_ = node_traits::get_right(members_.nodeptr_); return static_cast (*this); } - tree_iterator& go_parent() + BOOST_INTRUSIVE_FORCEINLINE tree_iterator& go_parent() { members_.nodeptr_ = node_traits::get_parent(members_.nodeptr_); return static_cast (*this); } - operator unspecified_bool_type() const + BOOST_INTRUSIVE_FORCEINLINE operator unspecified_bool_type() const { return members_.nodeptr_ ? &tree_iterator::unspecified_bool_type_func : 0; } - bool operator! () const + BOOST_INTRUSIVE_FORCEINLINE bool operator! () const { return !members_.nodeptr_; } - friend bool operator== (const tree_iterator& l, const tree_iterator& r) + BOOST_INTRUSIVE_FORCEINLINE friend bool operator== (const tree_iterator& l, const tree_iterator& r) { return l.pointed_node() == r.pointed_node(); } - friend bool operator!= (const tree_iterator& l, const tree_iterator& r) + BOOST_INTRUSIVE_FORCEINLINE friend bool operator!= (const tree_iterator& l, const tree_iterator& r) { return !(l == r); } - reference operator*() const + BOOST_INTRUSIVE_FORCEINLINE reference operator*() const { return *operator->(); } - pointer operator->() const + BOOST_INTRUSIVE_FORCEINLINE pointer operator->() const { return this->operator_arrow(detail::bool_()); } - const_value_traits_ptr get_value_traits() const + BOOST_INTRUSIVE_FORCEINLINE const_value_traits_ptr get_value_traits() const { return members_.get_ptr(); } tree_iterator end_iterator_from_it() const @@ -154,10 +155,10 @@ class tree_iterator { return tree_iterator(this->pointed_node(), this->get_value_traits()); } private: - pointer operator_arrow(detail::false_) const + BOOST_INTRUSIVE_FORCEINLINE pointer operator_arrow(detail::false_) const { return ValueTraits::to_value_ptr(members_.nodeptr_); } - pointer operator_arrow(detail::true_) const + BOOST_INTRUSIVE_FORCEINLINE pointer operator_arrow(detail::true_) const { return this->get_value_traits()->to_value_ptr(members_.nodeptr_); } iiterator_members members_; diff --git a/cpp/BoostParts/boost/intrusive/detail/tree_node.hpp b/cpp/BoostParts/boost/intrusive/detail/tree_node.hpp index e36a82a6d6..606fbc865e 100644 --- a/cpp/BoostParts/boost/intrusive/detail/tree_node.hpp +++ b/cpp/BoostParts/boost/intrusive/detail/tree_node.hpp @@ -22,6 +22,7 @@ #endif #include +#include #include namespace boost { @@ -43,31 +44,31 @@ struct tree_node_traits typedef typename node::node_ptr node_ptr; typedef typename pointer_rebind::type const_node_ptr; - static node_ptr get_parent(const const_node_ptr & n) + BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const const_node_ptr & n) { return n->parent_; } - static node_ptr get_parent(const node_ptr & n) + BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const node_ptr & n) { return n->parent_; } - static void set_parent(const node_ptr & n, const node_ptr & p) + BOOST_INTRUSIVE_FORCEINLINE static void set_parent(const node_ptr & n, const node_ptr & p) { n->parent_ = p; } - static node_ptr get_left(const const_node_ptr & n) + BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const const_node_ptr & n) { return n->left_; } - static node_ptr get_left(const node_ptr & n) + BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const node_ptr & n) { return n->left_; } - static void set_left(const node_ptr & n, const node_ptr & l) + BOOST_INTRUSIVE_FORCEINLINE static void set_left(const node_ptr & n, const node_ptr & l) { n->left_ = l; } - static node_ptr get_right(const const_node_ptr & n) + BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const const_node_ptr & n) { return n->right_; } - static node_ptr get_right(const node_ptr & n) + BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const node_ptr & n) { return n->right_; } - static void set_right(const node_ptr & n, const node_ptr & r) + BOOST_INTRUSIVE_FORCEINLINE static void set_right(const node_ptr & n, const node_ptr & r) { n->right_ = r; } }; diff --git a/cpp/BoostParts/boost/intrusive/detail/tree_value_compare.hpp b/cpp/BoostParts/boost/intrusive/detail/tree_value_compare.hpp index dc554442fe..810d894066 100644 --- a/cpp/BoostParts/boost/intrusive/detail/tree_value_compare.hpp +++ b/cpp/BoostParts/boost/intrusive/detail/tree_value_compare.hpp @@ -18,6 +18,7 @@ # pragma once #endif +#include #include #include @@ -53,10 +54,10 @@ struct tree_value_compare tree_value_compare &operator=(const key_compare &x) { this->base_t::get() = x; return *this; } - const key_compare &key_comp() const + BOOST_INTRUSIVE_FORCEINLINE const key_compare &key_comp() const { return static_cast(*this); } - key_compare &key_comp() + BOOST_INTRUSIVE_FORCEINLINE key_compare &key_comp() { return static_cast(*this); } template @@ -70,16 +71,16 @@ struct tree_value_compare { return key; } template - const key_type & key_forward + BOOST_INTRUSIVE_FORCEINLINE const key_type & key_forward (const U &key, typename boost::intrusive::detail::disable_if >::type* = 0) const { return KeyOfValue()(key); } template - bool operator()(const KeyType &key1, const KeyType2 &key2) const + BOOST_INTRUSIVE_FORCEINLINE bool operator()(const KeyType &key1, const KeyType2 &key2) const { return key_compare::operator()(this->key_forward(key1), this->key_forward(key2)); } template - bool operator()(const KeyType &key1, const KeyType2 &key2) + BOOST_INTRUSIVE_FORCEINLINE bool operator()(const KeyType &key1, const KeyType2 &key2) { return key_compare::operator()(this->key_forward(key1), this->key_forward(key2)); } }; diff --git a/cpp/BoostParts/boost/intrusive/detail/workaround.hpp b/cpp/BoostParts/boost/intrusive/detail/workaround.hpp index b73f4ef8bf..7a9ac48e0b 100644 --- a/cpp/BoostParts/boost/intrusive/detail/workaround.hpp +++ b/cpp/BoostParts/boost/intrusive/detail/workaround.hpp @@ -34,5 +34,17 @@ #define BOOST_INTRUSIVE_I , #define BOOST_INTRUSIVE_DOCIGN(T1) T1 +#define BOOST_INTRUSIVE_DISABLE_FORCEINLINE + +#if defined(BOOST_INTRUSIVE_DISABLE_FORCEINLINE) + #define BOOST_INTRUSIVE_FORCEINLINE inline +#elif defined(BOOST_INTRUSIVE_FORCEINLINE_IS_BOOST_FORCELINE) + #define BOOST_INTRUSIVE_FORCEINLINE BOOST_FORCEINLINE +#elif defined(BOOST_MSVC) && defined(_DEBUG) + //"__forceinline" and MSVC seems to have some bugs in debug mode + #define BOOST_INTRUSIVE_FORCEINLINE inline +#else + #define BOOST_INTRUSIVE_FORCEINLINE BOOST_FORCEINLINE +#endif #endif //#ifndef BOOST_INTRUSIVE_DETAIL_WORKAROUND_HPP diff --git a/cpp/BoostParts/boost/intrusive/parent_from_member.hpp b/cpp/BoostParts/boost/intrusive/parent_from_member.hpp index af3aa1f808..a9a9293c7c 100644 --- a/cpp/BoostParts/boost/intrusive/parent_from_member.hpp +++ b/cpp/BoostParts/boost/intrusive/parent_from_member.hpp @@ -13,6 +13,7 @@ #define BOOST_INTRUSIVE_PARENT_FROM_MEMBER_HPP #include +#include #include #include @@ -29,7 +30,7 @@ namespace intrusive { //! Note: this function does not work with pointer to members that rely on //! virtual inheritance. template -inline Parent *get_parent_from_member(Member *member, const Member Parent::* ptr_to_member) +BOOST_INTRUSIVE_FORCEINLINE Parent *get_parent_from_member(Member *member, const Member Parent::* ptr_to_member) { return ::boost::intrusive::detail::parent_from_member(member, ptr_to_member); } //! Given a const pointer to a member and its corresponding const pointer to data member, @@ -37,7 +38,7 @@ inline Parent *get_parent_from_member(Member *member, const Member Parent::* ptr //! Note: this function does not work with pointer to members that rely on //! virtual inheritance. template -inline const Parent *get_parent_from_member(const Member *member, const Member Parent::* ptr_to_member) +BOOST_INTRUSIVE_FORCEINLINE const Parent *get_parent_from_member(const Member *member, const Member Parent::* ptr_to_member) { return ::boost::intrusive::detail::parent_from_member(member, ptr_to_member); } } //namespace intrusive { diff --git a/cpp/BoostParts/boost/intrusive/pointer_plus_bits.hpp b/cpp/BoostParts/boost/intrusive/pointer_plus_bits.hpp index 6168ea8ea4..dfde66b712 100644 --- a/cpp/BoostParts/boost/intrusive/pointer_plus_bits.hpp +++ b/cpp/BoostParts/boost/intrusive/pointer_plus_bits.hpp @@ -67,19 +67,19 @@ struct pointer_plus_bits static const uintptr_t Mask = uintptr_t((uintptr_t(1u) << NumBits) - 1); typedef T* pointer; - static pointer get_pointer(pointer n) + BOOST_INTRUSIVE_FORCEINLINE static pointer get_pointer(pointer n) { return pointer(uintptr_t(n) & uintptr_t(~Mask)); } - static void set_pointer(pointer &n, pointer p) + BOOST_INTRUSIVE_FORCEINLINE static void set_pointer(pointer &n, pointer p) { BOOST_INTRUSIVE_INVARIANT_ASSERT(0 == (uintptr_t(p) & Mask)); n = pointer(uintptr_t(p) | (uintptr_t(n) & Mask)); } - static std::size_t get_bits(pointer n) + BOOST_INTRUSIVE_FORCEINLINE static std::size_t get_bits(pointer n) { return std::size_t(uintptr_t(n) & Mask); } - static void set_bits(pointer &n, std::size_t c) + BOOST_INTRUSIVE_FORCEINLINE static void set_bits(pointer &n, std::size_t c) { BOOST_INTRUSIVE_INVARIANT_ASSERT(uintptr_t(c) <= Mask); n = pointer(uintptr_t((get_pointer)(n)) | uintptr_t(c)); diff --git a/cpp/BoostParts/boost/intrusive/pointer_traits.hpp b/cpp/BoostParts/boost/intrusive/pointer_traits.hpp index 731432b01f..5baf5e807c 100644 --- a/cpp/BoostParts/boost/intrusive/pointer_traits.hpp +++ b/cpp/BoostParts/boost/intrusive/pointer_traits.hpp @@ -288,25 +288,25 @@ struct pointer_traits //! Returns: addressof(r) //! - static pointer pointer_to(reference r) + BOOST_INTRUSIVE_FORCEINLINE static pointer pointer_to(reference r) { return boost::intrusive::detail::addressof(r); } //! Returns: static_cast(uptr) //! template - static pointer static_cast_from(U *uptr) + BOOST_INTRUSIVE_FORCEINLINE static pointer static_cast_from(U *uptr) { return static_cast(uptr); } //! Returns: const_cast(uptr) //! template - static pointer const_cast_from(U *uptr) + BOOST_INTRUSIVE_FORCEINLINE static pointer const_cast_from(U *uptr) { return const_cast(uptr); } //! Returns: dynamic_cast(uptr) //! template - static pointer dynamic_cast_from(U *uptr) + BOOST_INTRUSIVE_FORCEINLINE static pointer dynamic_cast_from(U *uptr) { return dynamic_cast(uptr); } }; diff --git a/cpp/BoostParts/boost/intrusive/rbtree.hpp b/cpp/BoostParts/boost/intrusive/rbtree.hpp index f3afd017c8..276362d2fc 100644 --- a/cpp/BoostParts/boost/intrusive/rbtree.hpp +++ b/cpp/BoostParts/boost/intrusive/rbtree.hpp @@ -121,9 +121,13 @@ class rbtree_impl typedef typename implementation_defined::insert_commit_data insert_commit_data; + //! @copydoc ::boost::intrusive::bstree::bstree() + rbtree_impl() + : tree_type() + {} + //! @copydoc ::boost::intrusive::bstree::bstree(const key_compare &,const value_traits &) - explicit rbtree_impl( const key_compare &cmp = key_compare() - , const value_traits &v_traits = value_traits()) + explicit rbtree_impl( const key_compare &cmp, const value_traits &v_traits = value_traits()) : tree_type(cmp, v_traits) {} @@ -259,6 +263,14 @@ class rbtree_impl (const_iterator hint, const KeyType &key ,KeyTypeKeyCompare comp, insert_commit_data &commit_data); + //! @copydoc ::boost::intrusive::bstree::insert_unique_check(const key_type&,insert_commit_data&) + std::pair insert_unique_check + (const key_type &key, insert_commit_data &commit_data); + + //! @copydoc ::boost::intrusive::bstree::insert_unique_check(const_iterator,const key_type&,insert_commit_data&) + std::pair insert_unique_check + (const_iterator hint, const key_type &key, insert_commit_data &commit_data); + //! @copydoc ::boost::intrusive::bstree::insert_unique_commit iterator insert_unique_commit(reference value, const insert_commit_data &commit_data); @@ -509,8 +521,11 @@ class rbtree //Assert if passed value traits are compatible with the type BOOST_STATIC_ASSERT((detail::is_same::value)); - explicit rbtree( const key_compare &cmp = key_compare() - , const value_traits &v_traits = value_traits()) + rbtree() + : Base() + {} + + explicit rbtree( const key_compare &cmp, const value_traits &v_traits = value_traits()) : Base(cmp, v_traits) {} diff --git a/cpp/BoostParts/boost/intrusive/set.hpp b/cpp/BoostParts/boost/intrusive/set.hpp index f0072eab20..36c46c7e6e 100644 --- a/cpp/BoostParts/boost/intrusive/set.hpp +++ b/cpp/BoostParts/boost/intrusive/set.hpp @@ -83,9 +83,13 @@ class set_impl static const bool constant_time_size = tree_type::constant_time_size; public: + //! @copydoc ::boost::intrusive::rbtree::rbtree() + set_impl() + : tree_type() + {} + //! @copydoc ::boost::intrusive::rbtree::rbtree(const key_compare &,const value_traits &) - explicit set_impl( const key_compare &cmp = key_compare() - , const value_traits &v_traits = value_traits()) + explicit set_impl( const key_compare &cmp, const value_traits &v_traits = value_traits()) : tree_type(cmp, v_traits) {} @@ -196,6 +200,17 @@ class set_impl iterator insert(const_iterator hint, reference value) { return tree_type::insert_unique(hint, value); } + //! @copydoc ::boost::intrusive::rbtree::insert_unique_check(const key_type&,insert_commit_data&) + std::pair insert_check + (const key_type &key, insert_commit_data &commit_data) + { return tree_type::insert_unique_check(key, commit_data); } + + //! @copydoc ::boost::intrusive::rbtree::insert_unique_check(const_iterator,const key_type&,insert_commit_data&) + std::pair insert_check + (const_iterator hint, const key_type &key + ,insert_commit_data &commit_data) + { return tree_type::insert_unique_check(hint, key, commit_data); } + //! @copydoc ::boost::intrusive::rbtree::insert_unique_check(const KeyType&,KeyTypeKeyCompare,insert_commit_data&) template std::pair insert_check @@ -476,8 +491,11 @@ class set //Assert if passed value traits are compatible with the type BOOST_STATIC_ASSERT((detail::is_same::value)); - explicit set( const key_compare &cmp = key_compare() - , const value_traits &v_traits = value_traits()) + set() + : Base() + {} + + explicit set( const key_compare &cmp, const value_traits &v_traits = value_traits()) : Base(cmp, v_traits) {} @@ -573,9 +591,13 @@ class multiset_impl static const bool constant_time_size = tree_type::constant_time_size; public: + //! @copydoc ::boost::intrusive::rbtree::rbtree() + multiset_impl() + : tree_type() + {} + //! @copydoc ::boost::intrusive::rbtree::rbtree(const key_compare &,const value_traits &) - explicit multiset_impl( const key_compare &cmp = key_compare() - , const value_traits &v_traits = value_traits()) + explicit multiset_impl( const key_compare &cmp, const value_traits &v_traits = value_traits()) : tree_type(cmp, v_traits) {} @@ -936,8 +958,11 @@ class multiset //Assert if passed value traits are compatible with the type BOOST_STATIC_ASSERT((detail::is_same::value)); - multiset( const key_compare &cmp = key_compare() - , const value_traits &v_traits = value_traits()) + multiset() + : Base() + {} + + explicit multiset( const key_compare &cmp, const value_traits &v_traits = value_traits()) : Base(cmp, v_traits) {} diff --git a/cpp/BoostParts/boost/intrusive/sgtree.hpp b/cpp/BoostParts/boost/intrusive/sgtree.hpp index b4c4cdec1a..6e7af7dfd3 100644 --- a/cpp/BoostParts/boost/intrusive/sgtree.hpp +++ b/cpp/BoostParts/boost/intrusive/sgtree.hpp @@ -281,9 +281,13 @@ class sgtree_impl typedef BOOST_INTRUSIVE_IMPDEF(typename node_algorithms::insert_commit_data) insert_commit_data; + //! @copydoc ::boost::intrusive::bstree::bstree() + sgtree_impl() + : tree_type() + {} + //! @copydoc ::boost::intrusive::bstree::bstree(const key_compare &,const value_traits &) - explicit sgtree_impl( const key_compare &cmp = key_compare() - , const value_traits &v_traits = value_traits()) + explicit sgtree_impl( const key_compare &cmp, const value_traits &v_traits = value_traits()) : tree_type(cmp, v_traits) {} @@ -486,7 +490,11 @@ class sgtree_impl //! @copydoc ::boost::intrusive::bstree::insert_unique_check(const KeyType&,KeyTypeKeyCompare,insert_commit_data&) template - std::pair insert_unique_check + BOOST_INTRUSIVE_DOC1ST(std::pair + , typename detail::disable_if_convertible + >::type) + insert_unique_check (const KeyType &key, KeyTypeKeyCompare comp, insert_commit_data &commit_data) { std::pair ret = @@ -507,6 +515,16 @@ class sgtree_impl return std::pair(iterator(ret.first, this->priv_value_traits_ptr()), ret.second); } + //! @copydoc ::boost::intrusive::bstree::insert_unique_check(const key_type&,insert_commit_data&) + std::pair insert_unique_check + (const key_type &key, insert_commit_data &commit_data) + { return this->insert_unique_check(key, this->key_comp(), commit_data); } + + //! @copydoc ::boost::intrusive::bstree::insert_unique_check(const_iterator,const key_type&,insert_commit_data&) + std::pair insert_unique_check + (const_iterator hint, const key_type &key, insert_commit_data &commit_data) + { return this->insert_unique_check(hint, key, this->key_comp(), commit_data); } + //! @copydoc ::boost::intrusive::bstree::insert_unique_commit iterator insert_unique_commit(reference value, const insert_commit_data &commit_data) { @@ -934,8 +952,11 @@ class sgtree //Assert if passed value traits are compatible with the type BOOST_STATIC_ASSERT((detail::is_same::value)); - explicit sgtree( const key_compare &cmp = key_compare() - , const value_traits &v_traits = value_traits()) + sgtree() + : Base() + {} + + explicit sgtree(const key_compare &cmp, const value_traits &v_traits = value_traits()) : Base(cmp, v_traits) {} diff --git a/cpp/BoostParts/boost/intrusive/slist.hpp b/cpp/BoostParts/boost/intrusive/slist.hpp index dd3a05f2f8..d64bf49d18 100644 --- a/cpp/BoostParts/boost/intrusive/slist.hpp +++ b/cpp/BoostParts/boost/intrusive/slist.hpp @@ -307,7 +307,17 @@ class slist_impl //! //! Throws: If value_traits::node_traits::node //! constructor throws (this does not happen with predefined Boost.Intrusive hooks). - explicit slist_impl(const value_traits &v_traits = value_traits()) + slist_impl() + : data_(value_traits()) + { this->set_default_constructed_state(); } + + //! Effects: constructs an empty list. + //! + //! Complexity: Constant + //! + //! Throws: If value_traits::node_traits::node + //! constructor throws (this does not happen with predefined Boost.Intrusive hooks). + explicit slist_impl(const value_traits &v_traits) : data_(v_traits) { this->set_default_constructed_state(); } @@ -2190,7 +2200,11 @@ class slist typedef typename Base::size_type size_type; typedef typename Base::node_ptr node_ptr; - explicit slist(const value_traits &v_traits = value_traits()) + slist() + : Base() + {} + + explicit slist(const value_traits &v_traits) : Base(v_traits) {} diff --git a/cpp/BoostParts/boost/intrusive/splaytree.hpp b/cpp/BoostParts/boost/intrusive/splaytree.hpp index 27d75df70f..afc10819a3 100644 --- a/cpp/BoostParts/boost/intrusive/splaytree.hpp +++ b/cpp/BoostParts/boost/intrusive/splaytree.hpp @@ -111,9 +111,13 @@ class splaytree_impl typedef typename implementation_defined::insert_commit_data insert_commit_data; + //! @copydoc ::boost::intrusive::bstree::bstree() + splaytree_impl() + : tree_type() + {} + //! @copydoc ::boost::intrusive::bstree::bstree(const key_compare &,const value_traits &) - explicit splaytree_impl( const key_compare &cmp = key_compare() - , const value_traits &v_traits = value_traits()) + explicit splaytree_impl( const key_compare &cmp, const value_traits &v_traits = value_traits()) : tree_type(cmp, v_traits) {} @@ -240,6 +244,14 @@ class splaytree_impl //! @copydoc ::boost::intrusive::bstree::insert_unique(const_iterator,reference) iterator insert_unique(const_iterator hint, reference value); + //! @copydoc ::boost::intrusive::bstree::insert_unique_check(const key_type&,insert_commit_data&) + std::pair insert_unique_check + (const key_type &key, insert_commit_data &commit_data); + + //! @copydoc ::boost::intrusive::bstree::insert_unique_check(const_iterator,const key_type&,insert_commit_data&) + std::pair insert_unique_check + (const_iterator hint, const key_type &key, insert_commit_data &commit_data); + //! @copydoc ::boost::intrusive::bstree::insert_unique_check(const KeyType&,KeyTypeKeyCompare,insert_commit_data&) template std::pair insert_unique_check @@ -584,8 +596,11 @@ class splaytree //Assert if passed value traits are compatible with the type BOOST_STATIC_ASSERT((detail::is_same::value)); - explicit splaytree( const key_compare &cmp = key_compare() - , const value_traits &v_traits = value_traits()) + splaytree() + : Base() + {} + + explicit splaytree( const key_compare &cmp, const value_traits &v_traits = value_traits()) : Base(cmp, v_traits) {} diff --git a/cpp/BoostParts/boost/lexical_cast.hpp b/cpp/BoostParts/boost/lexical_cast.hpp index dc3d7e3fb7..3dc21f88a4 100644 --- a/cpp/BoostParts/boost/lexical_cast.hpp +++ b/cpp/BoostParts/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/cpp/BoostParts/boost/lexical_cast/try_lexical_convert.hpp b/cpp/BoostParts/boost/lexical_cast/try_lexical_convert.hpp index 1881cdf371..b079fd42ae 100644 --- a/cpp/BoostParts/boost/lexical_cast/try_lexical_convert.hpp +++ b/cpp/BoostParts/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/cpp/BoostParts/boost/lockfree/detail/atomic.hpp b/cpp/BoostParts/boost/lockfree/detail/atomic.hpp index 47dcd8c504..d15474ada9 100644 --- a/cpp/BoostParts/boost/lockfree/detail/atomic.hpp +++ b/cpp/BoostParts/boost/lockfree/detail/atomic.hpp @@ -42,6 +42,12 @@ #endif // BOOST_CLANG +// Stdlib should also be checked +#include +#if defined(BOOST_NO_CXX11_HDR_ATOMIC) && !defined(BOOST_LOCKFREE_NO_HDR_ATOMIC) +# define BOOST_LOCKFREE_NO_HDR_ATOMIC +#endif + #endif // BOOST_LOCKFREE_FORCE_STD_ATOMIC diff --git a/cpp/BoostParts/boost/lockfree/detail/freelist.hpp b/cpp/BoostParts/boost/lockfree/detail/freelist.hpp index 6b84e6c974..3a134e29b9 100644 --- a/cpp/BoostParts/boost/lockfree/detail/freelist.hpp +++ b/cpp/BoostParts/boost/lockfree/detail/freelist.hpp @@ -1,6 +1,6 @@ // lock-free freelist // -// Copyright (C) 2008-2013 Tim Blechmann +// Copyright (C) 2008-2016 Tim Blechmann // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at @@ -18,6 +18,9 @@ #include #include +#include +#include + #include #include #include @@ -328,7 +331,7 @@ struct compiletime_sized_freelist_storage // array-based freelists only support a 16bit address space. BOOST_STATIC_ASSERT(size < 65536); - boost::array data; + boost::array data; // unused ... only for API purposes template @@ -337,7 +340,8 @@ struct compiletime_sized_freelist_storage T * nodes(void) const { - return reinterpret_cast(const_cast(data.data())); + char * data_pointer = const_cast(data.data()); + return reinterpret_cast( boost::alignment::align_up( data_pointer, BOOST_LOCKFREE_CACHELINE_BYTES ) ); } std::size_t node_count(void) const @@ -349,23 +353,24 @@ struct compiletime_sized_freelist_storage template > struct runtime_sized_freelist_storage: - Alloc + boost::alignment::aligned_allocator_adaptor { + typedef boost::alignment::aligned_allocator_adaptor allocator_type; T * nodes_; std::size_t node_count_; template runtime_sized_freelist_storage(Allocator const & alloc, std::size_t count): - Alloc(alloc), node_count_(count) + allocator_type(alloc), node_count_(count) { if (count > 65535) boost::throw_exception(std::runtime_error("boost.lockfree: freelist size is limited to a maximum of 65535 objects")); - nodes_ = Alloc::allocate(count); + nodes_ = allocator_type::allocate(count); } ~runtime_sized_freelist_storage(void) { - Alloc::deallocate(nodes_, node_count_); + allocator_type::deallocate(nodes_, node_count_); } T * nodes(void) const diff --git a/cpp/BoostParts/boost/lockfree/spsc_queue.hpp b/cpp/BoostParts/boost/lockfree/spsc_queue.hpp index b877cde4db..5ecfb2a21e 100644 --- a/cpp/BoostParts/boost/lockfree/spsc_queue.hpp +++ b/cpp/BoostParts/boost/lockfree/spsc_queue.hpp @@ -601,28 +601,28 @@ class runtime_sized_ringbuffer: template ConstIterator push(ConstIterator begin, ConstIterator end) { - return ringbuffer_base::push(begin, end, array_, max_elements_); + return ringbuffer_base::push(begin, end, &*array_, max_elements_); } size_type pop(T * ret, size_type size) { - return ringbuffer_base::pop(ret, size, array_, max_elements_); + return ringbuffer_base::pop(ret, size, &*array_, max_elements_); } template size_type pop_to_output_iterator(OutputIterator it) { - return ringbuffer_base::pop_to_output_iterator(it, array_, max_elements_); + return ringbuffer_base::pop_to_output_iterator(it, &*array_, max_elements_); } const T& front(void) const { - return ringbuffer_base::front(array_); + return ringbuffer_base::front(&*array_); } T& front(void) { - return ringbuffer_base::front(array_); + return ringbuffer_base::front(&*array_); } }; diff --git a/cpp/BoostParts/boost/math/special_functions/fpclassify.hpp b/cpp/BoostParts/boost/math/special_functions/fpclassify.hpp index 0a4e1ac7aa..d83e111c48 100644 --- a/cpp/BoostParts/boost/math/special_functions/fpclassify.hpp +++ b/cpp/BoostParts/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/cpp/BoostParts/boost/math/tools/config.hpp b/cpp/BoostParts/boost/math/tools/config.hpp index ffd0ab43a6..75d29b646e 100644 --- a/cpp/BoostParts/boost/math/tools/config.hpp +++ b/cpp/BoostParts/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__) \ diff --git a/cpp/BoostParts/boost/move/adl_move_swap.hpp b/cpp/BoostParts/boost/move/adl_move_swap.hpp index 2a010cda57..930320108d 100644 --- a/cpp/BoostParts/boost/move/adl_move_swap.hpp +++ b/cpp/BoostParts/boost/move/adl_move_swap.hpp @@ -22,9 +22,8 @@ //Based on Boost.Core's swap. //Many thanks to Steven Watanabe, Joseph Gauterin and Niels Dekker. - -#include #include //for std::size_t +#include //forceinline //Try to avoid including , as it's quite big #if defined(_MSC_VER) && defined(BOOST_DINKUMWARE_STDLIB) @@ -156,7 +155,7 @@ struct and_op_not {}; template -void swap_proxy(T& x, T& y, typename boost::move_detail::enable_if_c::value>::type* = 0) +BOOST_MOVE_FORCEINLINE void swap_proxy(T& x, T& y, typename boost::move_detail::enable_if_c::value>::type* = 0) { //use std::swap if argument dependent lookup fails //Use using directive ("using namespace xxx;") instead as some older compilers @@ -166,14 +165,14 @@ void swap_proxy(T& x, T& y, typename boost::move_detail::enable_if_c -void swap_proxy(T& x, T& y +BOOST_MOVE_FORCEINLINE void swap_proxy(T& x, T& y , typename boost::move_detail::enable_if< and_op_not_impl , boost_move_member_swap::has_member_swap > >::type* = 0) { T t(::boost::move(x)); x = ::boost::move(y); y = ::boost::move(t); } template -void swap_proxy(T& x, T& y +BOOST_MOVE_FORCEINLINE void swap_proxy(T& x, T& y , typename boost::move_detail::enable_if< and_op_impl< boost::move_detail::has_move_emulation_enabled_impl , boost_move_member_swap::has_member_swap > >::type* = 0) @@ -186,7 +185,7 @@ void swap_proxy(T& x, T& y namespace boost_move_adl_swap{ template -void swap_proxy(T& x, T& y) +BOOST_MOVE_FORCEINLINE void swap_proxy(T& x, T& y) { using std::swap; swap(x, y); @@ -223,11 +222,45 @@ namespace boost{ //! - Otherwise a move-based swap is called, equivalent to: //! T t(::boost::move(x)); x = ::boost::move(y); y = ::boost::move(t);. template -void adl_move_swap(T& x, T& y) +BOOST_MOVE_FORCEINLINE void adl_move_swap(T& x, T& y) { ::boost_move_adl_swap::swap_proxy(x, y); } +//! Exchanges elements between range [first1, last1) and another range starting at first2 +//! using boost::adl_move_swap. +//! +//! Parameters: +//! first1, last1 - the first range of elements to swap +//! first2 - beginning of the second range of elements to swap +//! +//! Type requirements: +//! - ForwardIt1, ForwardIt2 must meet the requirements of ForwardIterator. +//! - The types of dereferenced ForwardIt1 and ForwardIt2 must meet the +//! requirements of Swappable +//! +//! Return value: Iterator to the element past the last element exchanged in the range +//! beginning with first2. +template +ForwardIt2 adl_move_swap_ranges(ForwardIt1 first1, ForwardIt1 last1, ForwardIt2 first2) +{ + while (first1 != last1) { + ::boost::adl_move_swap(*first1, *first2); + ++first1; + ++first2; + } + return first2; +} + +template +BidirIt2 adl_move_swap_ranges_backward(BidirIt1 first1, BidirIt1 last1, BidirIt2 last2) +{ + while (first1 != last1) { + ::boost::adl_move_swap(*(--last1), *(--last2)); + } + return last2; +} + } //namespace boost{ #endif //#ifndef BOOST_MOVE_ADL_MOVE_SWAP_HPP diff --git a/cpp/BoostParts/boost/move/algo/move.hpp b/cpp/BoostParts/boost/move/algo/move.hpp new file mode 100644 index 0000000000..943f286c94 --- /dev/null +++ b/cpp/BoostParts/boost/move/algo/move.hpp @@ -0,0 +1,155 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2012-2016. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// See http://www.boost.org/libs/move for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +//! \file + +#ifndef BOOST_MOVE_ALGO_MOVE_HPP +#define BOOST_MOVE_ALGO_MOVE_HPP + +#ifndef BOOST_CONFIG_HPP +# include +#endif +# +#if defined(BOOST_HAS_PRAGMA_ONCE) +# pragma once +#endif + +#include + +#include +#include +#include + +namespace boost { + +////////////////////////////////////////////////////////////////////////////// +// +// move +// +////////////////////////////////////////////////////////////////////////////// + +#if !defined(BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE) + + //! Effects: Moves elements in the range [first,last) into the range [result,result + (last - + //! first)) starting from first and proceeding to last. For each non-negative integer n < (last-first), + //! performs *(result + n) = ::boost::move (*(first + n)). + //! + //! Effects: result + (last - first). + //! + //! Requires: result shall not be in the range [first,last). + //! + //! Complexity: Exactly last - first move assignments. + template // O models OutputIterator + O move(I f, I l, O result) + { + while (f != l) { + *result = ::boost::move(*f); + ++f; ++result; + } + return result; + } + + ////////////////////////////////////////////////////////////////////////////// + // + // move_backward + // + ////////////////////////////////////////////////////////////////////////////// + + //! Effects: Moves elements in the range [first,last) into the range + //! [result - (last-first),result) starting from last - 1 and proceeding to + //! first. For each positive integer n <= (last - first), + //! performs *(result - n) = ::boost::move(*(last - n)). + //! + //! Requires: result shall not be in the range [first,last). + //! + //! Returns: result - (last - first). + //! + //! Complexity: Exactly last - first assignments. + template // O models BidirectionalIterator + O move_backward(I f, I l, O result) + { + while (f != l) { + --l; --result; + *result = ::boost::move(*l); + } + return result; + } + +#else + + using ::std::move_backward; + +#endif //!defined(BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE) + +////////////////////////////////////////////////////////////////////////////// +// +// uninitialized_move +// +////////////////////////////////////////////////////////////////////////////// + +//! Effects: +//! \code +//! for (; first != last; ++result, ++first) +//! new (static_cast(&*result)) +//! typename iterator_traits::value_type(boost::move(*first)); +//! \endcode +//! +//! Returns: result +template + // F models ForwardIterator +F uninitialized_move(I f, I l, F r + /// @cond +// ,typename ::boost::move_detail::enable_if::value_type> >::type* = 0 + /// @endcond + ) +{ + typedef typename boost::movelib::iterator_traits::value_type input_value_type; + + F back = r; + BOOST_TRY{ + while (f != l) { + void * const addr = static_cast(::boost::move_detail::addressof(*r)); + ::new(addr) input_value_type(::boost::move(*f)); + ++f; ++r; + } + } + BOOST_CATCH(...){ + for (; back != r; ++back){ + back->~input_value_type(); + } + BOOST_RETHROW; + } + BOOST_CATCH_END + return r; +} + +/// @cond +/* +template + // F models ForwardIterator +F uninitialized_move(I f, I l, F r, + typename ::boost::move_detail::disable_if::value_type> >::type* = 0) +{ + return std::uninitialized_copy(f, l, r); +} +*/ + +/// @endcond + +} //namespace boost { + +#include + +#endif //#ifndef BOOST_MOVE_ALGO_MOVE_HPP diff --git a/cpp/BoostParts/boost/move/algorithm.hpp b/cpp/BoostParts/boost/move/algorithm.hpp index fbda0f40d1..825d7716c2 100644 --- a/cpp/BoostParts/boost/move/algorithm.hpp +++ b/cpp/BoostParts/boost/move/algorithm.hpp @@ -26,6 +26,7 @@ #include #include +#include #include #include //copy, copy_backward @@ -33,122 +34,6 @@ namespace boost { -////////////////////////////////////////////////////////////////////////////// -// -// move -// -////////////////////////////////////////////////////////////////////////////// - -#if !defined(BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE) - - //! Effects: Moves elements in the range [first,last) into the range [result,result + (last - - //! first)) starting from first and proceeding to last. For each non-negative integer n < (last-first), - //! performs *(result + n) = ::boost::move (*(first + n)). - //! - //! Effects: result + (last - first). - //! - //! Requires: result shall not be in the range [first,last). - //! - //! Complexity: Exactly last - first move assignments. - template // O models OutputIterator - O move(I f, I l, O result) - { - while (f != l) { - *result = ::boost::move(*f); - ++f; ++result; - } - return result; - } - - ////////////////////////////////////////////////////////////////////////////// - // - // move_backward - // - ////////////////////////////////////////////////////////////////////////////// - - //! Effects: Moves elements in the range [first,last) into the range - //! [result - (last-first),result) starting from last - 1 and proceeding to - //! first. For each positive integer n <= (last - first), - //! performs *(result - n) = ::boost::move(*(last - n)). - //! - //! Requires: result shall not be in the range [first,last). - //! - //! Returns: result - (last - first). - //! - //! Complexity: Exactly last - first assignments. - template // O models BidirectionalIterator - O move_backward(I f, I l, O result) - { - while (f != l) { - --l; --result; - *result = ::boost::move(*l); - } - return result; - } - -#else - - using ::std::move_backward; - -#endif //!defined(BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE) - -////////////////////////////////////////////////////////////////////////////// -// -// uninitialized_move -// -////////////////////////////////////////////////////////////////////////////// - -//! Effects: -//! \code -//! for (; first != last; ++result, ++first) -//! new (static_cast(&*result)) -//! typename iterator_traits::value_type(boost::move(*first)); -//! \endcode -//! -//! Returns: result -template - // F models ForwardIterator -F uninitialized_move(I f, I l, F r - /// @cond -// ,typename ::boost::move_detail::enable_if::value_type> >::type* = 0 - /// @endcond - ) -{ - typedef typename std::iterator_traits::value_type input_value_type; - - F back = r; - BOOST_TRY{ - while (f != l) { - void * const addr = static_cast(::boost::move_detail::addressof(*r)); - ::new(addr) input_value_type(::boost::move(*f)); - ++f; ++r; - } - } - BOOST_CATCH(...){ - for (; back != r; ++back){ - back->~input_value_type(); - } - BOOST_RETHROW; - } - BOOST_CATCH_END - return r; -} - -/// @cond -/* -template - // F models ForwardIterator -F uninitialized_move(I f, I l, F r, - typename ::boost::move_detail::disable_if::value_type> >::type* = 0) -{ - return std::uninitialized_copy(f, l, r); -} -*/ - ////////////////////////////////////////////////////////////////////////////// // // uninitialized_copy_or_move diff --git a/cpp/BoostParts/boost/move/core.hpp b/cpp/BoostParts/boost/move/core.hpp index 54aece0b71..c9cbec23a1 100644 --- a/cpp/BoostParts/boost/move/core.hpp +++ b/cpp/BoostParts/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:\ // @@ -263,18 +263,18 @@ 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/cpp/BoostParts/boost/move/detail/config_begin.hpp b/cpp/BoostParts/boost/move/detail/config_begin.hpp index 342390b816..637eb158bd 100644 --- a/cpp/BoostParts/boost/move/detail/config_begin.hpp +++ b/cpp/BoostParts/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/cpp/BoostParts/boost/move/detail/iterator_traits.hpp b/cpp/BoostParts/boost/move/detail/iterator_traits.hpp index a75ee03827..5ffcb2cf05 100644 --- a/cpp/BoostParts/boost/move/detail/iterator_traits.hpp +++ b/cpp/BoostParts/boost/move/detail/iterator_traits.hpp @@ -23,6 +23,7 @@ #endif #include +#include #include BOOST_MOVE_STD_NS_BEG @@ -46,6 +47,7 @@ struct iterator_traits typedef typename Iterator::pointer pointer; typedef typename Iterator::reference reference; typedef typename Iterator::iterator_category iterator_category; + typedef typename boost::move_detail::make_unsigned::type size_type; }; template @@ -56,6 +58,7 @@ struct iterator_traits typedef T* pointer; typedef T& reference; typedef std::random_access_iterator_tag iterator_category; + typedef typename boost::move_detail::make_unsigned::type size_type; }; template @@ -66,6 +69,7 @@ struct iterator_traits typedef const T* pointer; typedef const T& reference; typedef std::random_access_iterator_tag iterator_category; + typedef typename boost::move_detail::make_unsigned::type size_type; }; }} //namespace boost { namespace movelib{ diff --git a/cpp/BoostParts/boost/move/detail/meta_utils.hpp b/cpp/BoostParts/boost/move/detail/meta_utils.hpp index 323c13af10..e45394c97d 100644 --- a/cpp/BoostParts/boost/move/detail/meta_utils.hpp +++ b/cpp/BoostParts/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/cpp/BoostParts/boost/move/detail/move_helpers.hpp b/cpp/BoostParts/boost/move/detail/move_helpers.hpp index 7b62e26994..a2502bf7dc 100644 --- a/cpp/BoostParts/boost/move/detail/move_helpers.hpp +++ b/cpp/BoostParts/boost/move/detail/move_helpers.hpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2010-2012. +// (C) Copyright Ion Gaztanaga 2010-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) @@ -20,8 +20,9 @@ # pragma once #endif +#include #include -#include +#include #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) @@ -43,6 +44,30 @@ //////////////////////////////////////// #ifdef BOOST_NO_CXX11_RVALUE_REFERENCES + + template + struct boost_move_conversion_aware_catch_1 + : public ::boost::move_detail::enable_if_and + < RETURN_VALUE + , ::boost::move_detail::is_same + , ::boost::move_detail::is_class + , ::boost::has_move_emulation_disabled + > + {}; + + template + struct boost_move_conversion_aware_catch_2 + : public ::boost::move_detail::disable_if_or + < RETURN_VALUE + , ::boost::move_detail::is_same + , ::boost::move_detail::is_rv_impl + , ::boost::move_detail::and_ + < ::boost::move_detail::is_rv_impl + , ::boost::move_detail::is_class + > + > + {}; + #define BOOST_MOVE_CONVERSION_AWARE_CATCH_COMMON(PUB_FUNCTION, TYPE, RETURN_VALUE, FWD_FUNCTION)\ RETURN_VALUE PUB_FUNCTION(BOOST_MOVE_CATCH_CONST(TYPE) x)\ { return FWD_FUNCTION(static_cast(x)); }\ @@ -59,26 +84,14 @@ \ template\ RETURN_VALUE PUB_FUNCTION(const BOOST_MOVE_TEMPL_PARAM &u,\ - typename ::boost::move_detail::enable_if_and\ - < ::boost::move_detail::nat \ - , ::boost::move_detail::is_same\ - , ::boost::move_detail::is_class\ - , ::boost::has_move_emulation_disabled\ - >::type* = 0)\ + typename boost_move_conversion_aware_catch_1< ::boost::move_detail::nat, BOOST_MOVE_TEMPL_PARAM, TYPE>::type* = 0)\ { return FWD_FUNCTION(u); }\ \ template\ RETURN_VALUE PUB_FUNCTION(const BOOST_MOVE_TEMPL_PARAM &u,\ - typename ::boost::move_detail::disable_if_or\ - < ::boost::move_detail::nat \ - , ::boost::move_detail::is_same \ - , ::boost::move_detail::and_ \ - < ::boost::move_detail::is_rv \ - , ::boost::move_detail::is_class \ - > \ - >::type* = 0)\ + typename boost_move_conversion_aware_catch_2< ::boost::move_detail::nat, BOOST_MOVE_TEMPL_PARAM, TYPE>::type* = 0)\ {\ - TYPE t(u);\ + TYPE t((u));\ return FWD_FUNCTION(::boost::move(t));\ }\ // @@ -87,27 +100,15 @@ BOOST_MOVE_CONVERSION_AWARE_CATCH_COMMON(PUB_FUNCTION, TYPE, RETURN_VALUE, FWD_FUNCTION)\ \ template\ - typename ::boost::move_detail::enable_if_and\ - < RETURN_VALUE \ - , ::boost::move_detail::is_same\ - , ::boost::move_detail::is_class\ - , ::boost::has_move_emulation_disabled\ - >::type\ + typename boost_move_conversion_aware_catch_1::type\ PUB_FUNCTION(const BOOST_MOVE_TEMPL_PARAM &u)\ { return FWD_FUNCTION(u); }\ \ template\ - typename ::boost::move_detail::disable_if_or\ - < RETURN_VALUE \ - , ::boost::move_detail::is_same \ - , ::boost::move_detail::and_ \ - < ::boost::move_detail::is_rv \ - , ::boost::move_detail::is_class \ - > \ - >::type\ + typename boost_move_conversion_aware_catch_2::type\ PUB_FUNCTION(const BOOST_MOVE_TEMPL_PARAM &u)\ {\ - TYPE t(u);\ + TYPE t((u));\ return FWD_FUNCTION(::boost::move(t));\ }\ // @@ -127,7 +128,7 @@ , RETURN_VALUE >::type\ PUB_FUNCTION(const BOOST_MOVE_TEMPL_PARAM &u)\ {\ - TYPE t(u);\ + TYPE t((u));\ return FWD_FUNCTION(::boost::move(t));\ }\ // @@ -151,6 +152,27 @@ //////////////////////////////////////// #ifdef BOOST_NO_CXX11_RVALUE_REFERENCES + + template + struct boost_move_conversion_aware_catch_1arg_1 + : public ::boost::move_detail::enable_if_and + < RETURN_VALUE + , ::boost::move_detail::not_< ::boost::move_detail::is_same_or_convertible > + , ::boost::move_detail::is_same + , ::boost::has_move_emulation_disabled + > + {}; + + template + struct boost_move_conversion_aware_catch_1arg_2 + : public ::boost::move_detail::disable_if_or + < RETURN_VALUE + , ::boost::move_detail::is_same_or_convertible< BOOST_MOVE_TEMPL_PARAM, UNLESS_CONVERTIBLE_TO> + , ::boost::move_detail::is_rv_impl + , ::boost::move_detail::is_same + > + {}; + #define BOOST_MOVE_CONVERSION_AWARE_CATCH_1ARG_COMMON(PUB_FUNCTION, TYPE, RETURN_VALUE, FWD_FUNCTION, ARG1, UNLESS_CONVERTIBLE_TO)\ RETURN_VALUE PUB_FUNCTION(ARG1 arg1, BOOST_MOVE_CATCH_CONST(TYPE) x)\ { return FWD_FUNCTION(arg1, static_cast(x)); }\ @@ -167,23 +189,14 @@ \ template\ RETURN_VALUE PUB_FUNCTION(ARG1 arg1, const BOOST_MOVE_TEMPL_PARAM &u,\ - typename ::boost::move_detail::enable_if_and\ - < ::boost::move_detail::nat \ - , ::boost::move_detail::is_same\ - , ::boost::has_move_emulation_disabled\ - >::type* = 0)\ + typename boost_move_conversion_aware_catch_1arg_1::type* = 0)\ { return FWD_FUNCTION(arg1, u); }\ \ template\ RETURN_VALUE PUB_FUNCTION(ARG1 arg1, const BOOST_MOVE_TEMPL_PARAM &u,\ - typename ::boost::move_detail::disable_if_or\ - < void \ - , ::boost::move_detail::is_rv\ - , ::boost::move_detail::is_same\ - , ::boost::move_detail::is_convertible\ - >::type* = 0)\ + typename boost_move_conversion_aware_catch_1arg_2::type* = 0)\ {\ - TYPE t(u);\ + TYPE t((u));\ return FWD_FUNCTION(arg1, ::boost::move(t));\ }\ // @@ -192,24 +205,15 @@ BOOST_MOVE_CONVERSION_AWARE_CATCH_1ARG_COMMON(PUB_FUNCTION, TYPE, RETURN_VALUE, FWD_FUNCTION, ARG1, UNLESS_CONVERTIBLE_TO)\ \ template\ - typename ::boost::move_detail::enable_if_and\ - < RETURN_VALUE \ - , ::boost::move_detail::is_same\ - , ::boost::has_move_emulation_disabled\ - >::type\ + typename boost_move_conversion_aware_catch_1arg_1::type\ PUB_FUNCTION(ARG1 arg1, const BOOST_MOVE_TEMPL_PARAM &u)\ { return FWD_FUNCTION(arg1, u); }\ \ template\ - typename ::boost::move_detail::disable_if_or\ - < RETURN_VALUE \ - , ::boost::move_detail::is_rv\ - , ::boost::move_detail::is_same\ - , ::boost::move_detail::is_convertible\ - >::type\ + typename boost_move_conversion_aware_catch_1arg_2::type\ PUB_FUNCTION(ARG1 arg1, const BOOST_MOVE_TEMPL_PARAM &u)\ {\ - TYPE t(u);\ + TYPE t((u));\ return FWD_FUNCTION(arg1, ::boost::move(t));\ }\ // @@ -228,11 +232,11 @@ typename ::boost::move_detail::disable_if_or\ < RETURN_VALUE \ , ::boost::move_detail::is_same \ - , ::boost::move_detail::is_convertible \ + , ::boost::move_detail::is_same_or_convertible \ >::type\ PUB_FUNCTION(ARG1 arg1, const BOOST_MOVE_TEMPL_PARAM &u)\ {\ - TYPE t(u);\ + TYPE t((u));\ return FWD_FUNCTION(arg1, ::boost::move(t));\ }\ // diff --git a/cpp/BoostParts/boost/move/detail/workaround.hpp b/cpp/BoostParts/boost/move/detail/workaround.hpp index b3f81b117f..befe141e96 100644 --- a/cpp/BoostParts/boost/move/detail/workaround.hpp +++ b/cpp/BoostParts/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/cpp/BoostParts/boost/move/iterator.hpp b/cpp/BoostParts/boost/move/iterator.hpp index 1b39e267ec..f36df23c0c 100644 --- a/cpp/BoostParts/boost/move/iterator.hpp +++ b/cpp/BoostParts/boost/move/iterator.hpp @@ -23,6 +23,7 @@ #endif #include +#include //forceinline #include #include @@ -57,22 +58,20 @@ class move_iterator typedef typename boost::movelib::iterator_traits::difference_type difference_type; typedef typename boost::movelib::iterator_traits::iterator_category iterator_category; - move_iterator() + BOOST_MOVE_FORCEINLINE move_iterator() + : m_it() {} - explicit move_iterator(It i) + BOOST_MOVE_FORCEINLINE explicit move_iterator(const It &i) : m_it(i) {} template - move_iterator(const move_iterator& u) - : m_it(u.base()) + BOOST_MOVE_FORCEINLINE move_iterator(const move_iterator& u) + : m_it(u.m_it) {} - iterator_type base() const - { return m_it; } - - reference operator*() const + BOOST_MOVE_FORCEINLINE reference operator*() const { #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || defined(BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES) return *m_it; @@ -81,34 +80,34 @@ class move_iterator #endif } - pointer operator->() const + BOOST_MOVE_FORCEINLINE pointer operator->() const { return m_it; } - move_iterator& operator++() + BOOST_MOVE_FORCEINLINE move_iterator& operator++() { ++m_it; return *this; } - move_iterator operator++(int) + BOOST_MOVE_FORCEINLINE move_iterator operator++(int) { move_iterator tmp(*this); ++(*this); return tmp; } - move_iterator& operator--() + BOOST_MOVE_FORCEINLINE move_iterator& operator--() { --m_it; return *this; } - move_iterator operator--(int) + BOOST_MOVE_FORCEINLINE move_iterator operator--(int) { move_iterator tmp(*this); --(*this); return tmp; } move_iterator operator+ (difference_type n) const { return move_iterator(m_it + n); } - move_iterator& operator+=(difference_type n) + BOOST_MOVE_FORCEINLINE move_iterator& operator+=(difference_type n) { m_it += n; return *this; } - move_iterator operator- (difference_type n) const + BOOST_MOVE_FORCEINLINE move_iterator operator- (difference_type n) const { return move_iterator(m_it - n); } - move_iterator& operator-=(difference_type n) + BOOST_MOVE_FORCEINLINE move_iterator& operator-=(difference_type n) { m_it -= n; return *this; } - reference operator[](difference_type n) const + BOOST_MOVE_FORCEINLINE reference operator[](difference_type n) const { #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || defined(BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES) return m_it[n]; @@ -117,29 +116,29 @@ class move_iterator #endif } - friend bool operator==(const move_iterator& x, const move_iterator& y) - { return x.base() == y.base(); } + BOOST_MOVE_FORCEINLINE friend bool operator==(const move_iterator& x, const move_iterator& y) + { return x.m_it == y.m_it; } - friend bool operator!=(const move_iterator& x, const move_iterator& y) - { return x.base() != y.base(); } + BOOST_MOVE_FORCEINLINE friend bool operator!=(const move_iterator& x, const move_iterator& y) + { return x.m_it != y.m_it; } - friend bool operator< (const move_iterator& x, const move_iterator& y) - { return x.base() < y.base(); } + BOOST_MOVE_FORCEINLINE friend bool operator< (const move_iterator& x, const move_iterator& y) + { return x.m_it < y.m_it; } - friend bool operator<=(const move_iterator& x, const move_iterator& y) - { return x.base() <= y.base(); } + BOOST_MOVE_FORCEINLINE friend bool operator<=(const move_iterator& x, const move_iterator& y) + { return x.m_it <= y.m_it; } - friend bool operator> (const move_iterator& x, const move_iterator& y) - { return x.base() > y.base(); } + BOOST_MOVE_FORCEINLINE friend bool operator> (const move_iterator& x, const move_iterator& y) + { return x.m_it > y.m_it; } - friend bool operator>=(const move_iterator& x, const move_iterator& y) - { return x.base() >= y.base(); } + BOOST_MOVE_FORCEINLINE friend bool operator>=(const move_iterator& x, const move_iterator& y) + { return x.m_it >= y.m_it; } - friend difference_type operator-(const move_iterator& x, const move_iterator& y) - { return x.base() - y.base(); } + BOOST_MOVE_FORCEINLINE friend difference_type operator-(const move_iterator& x, const move_iterator& y) + { return x.m_it - y.m_it; } - friend move_iterator operator+(difference_type n, const move_iterator& x) - { return move_iterator(x.base() + n); } + BOOST_MOVE_FORCEINLINE friend move_iterator operator+(difference_type n, const move_iterator& x) + { return move_iterator(x.m_it + n); } private: It m_it; diff --git a/cpp/BoostParts/boost/move/unique_ptr.hpp b/cpp/BoostParts/boost/move/unique_ptr.hpp index 5b067436af..2d794e8ed5 100644 --- a/cpp/BoostParts/boost/move/unique_ptr.hpp +++ b/cpp/BoostParts/boost/move/unique_ptr.hpp @@ -20,7 +20,7 @@ #endif #include -#include +#include //forceinline #include #include #include @@ -93,25 +93,25 @@ struct unique_ptr_data typedef typename deleter_types::del_ref del_ref; typedef typename deleter_types::del_cref del_cref; - unique_ptr_data() BOOST_NOEXCEPT + BOOST_MOVE_FORCEINLINE unique_ptr_data() BOOST_NOEXCEPT : m_p(), d() {} - explicit unique_ptr_data(P p) BOOST_NOEXCEPT + BOOST_MOVE_FORCEINLINE explicit unique_ptr_data(P p) BOOST_NOEXCEPT : m_p(p), d() {} - unique_ptr_data(P p, deleter_arg_type1 d1) BOOST_NOEXCEPT + BOOST_MOVE_FORCEINLINE unique_ptr_data(P p, deleter_arg_type1 d1) BOOST_NOEXCEPT : m_p(p), d(d1) {} template - unique_ptr_data(P p, BOOST_FWD_REF(U) d1) BOOST_NOEXCEPT + BOOST_MOVE_FORCEINLINE unique_ptr_data(P p, BOOST_FWD_REF(U) d1) BOOST_NOEXCEPT : m_p(p), d(::boost::forward(d1)) {} - del_ref deleter() { return d; } - del_cref deleter() const{ return d; } + BOOST_MOVE_FORCEINLINE del_ref deleter() { return d; } + BOOST_MOVE_FORCEINLINE del_cref deleter() const{ return d; } P m_p; D d; @@ -129,25 +129,25 @@ struct unique_ptr_data typedef typename deleter_types::del_ref del_ref; typedef typename deleter_types::del_cref del_cref; - unique_ptr_data() BOOST_NOEXCEPT + BOOST_MOVE_FORCEINLINE unique_ptr_data() BOOST_NOEXCEPT : D(), m_p() {} - explicit unique_ptr_data(P p) BOOST_NOEXCEPT + BOOST_MOVE_FORCEINLINE explicit unique_ptr_data(P p) BOOST_NOEXCEPT : D(), m_p(p) {} - unique_ptr_data(P p, deleter_arg_type1 d1) BOOST_NOEXCEPT + BOOST_MOVE_FORCEINLINE unique_ptr_data(P p, deleter_arg_type1 d1) BOOST_NOEXCEPT : D(d1), m_p(p) {} template - unique_ptr_data(P p, BOOST_FWD_REF(U) d) BOOST_NOEXCEPT + BOOST_MOVE_FORCEINLINE unique_ptr_data(P p, BOOST_FWD_REF(U) d) BOOST_NOEXCEPT : D(::boost::forward(d)), m_p(p) {} - del_ref deleter() BOOST_NOEXCEPT { return static_cast(*this); } - del_cref deleter() const BOOST_NOEXCEPT { return static_cast(*this); } + BOOST_MOVE_FORCEINLINE del_ref deleter() BOOST_NOEXCEPT { return static_cast(*this); } + BOOST_MOVE_FORCEINLINE del_cref deleter() const BOOST_NOEXCEPT { return static_cast(*this); } P m_p; @@ -389,7 +389,7 @@ class unique_ptr //! //! Remarks: If this constructor is instantiated with a pointer type or reference type //! for the template argument D, the program is ill-formed. - BOOST_CONSTEXPR unique_ptr() BOOST_NOEXCEPT + BOOST_MOVE_FORCEINLINE BOOST_CONSTEXPR unique_ptr() BOOST_NOEXCEPT : m_data() { //If this constructor is instantiated with a pointer type or reference type @@ -400,7 +400,7 @@ class unique_ptr //! Effects: Same as unique_ptr() (default constructor). //! - BOOST_CONSTEXPR unique_ptr(BOOST_MOVE_DOC0PTR(bmupd::nullptr_type)) BOOST_NOEXCEPT + BOOST_MOVE_FORCEINLINE BOOST_CONSTEXPR unique_ptr(BOOST_MOVE_DOC0PTR(bmupd::nullptr_type)) BOOST_NOEXCEPT : m_data() { //If this constructor is instantiated with a pointer type or reference type @@ -423,7 +423,7 @@ class unique_ptr //! - If T is not an array type and Pointer is implicitly convertible to pointer. //! - If T is an array type and Pointer is a more CV qualified pointer to element_type. template - explicit unique_ptr(Pointer p + BOOST_MOVE_FORCEINLINE explicit unique_ptr(Pointer p BOOST_MOVE_DOCIGN(BOOST_MOVE_I typename bmupd::enable_up_ptr::type* =0) ) BOOST_NOEXCEPT : m_data(p) @@ -461,7 +461,7 @@ class unique_ptr //! - If T is not an array type and Pointer is implicitly convertible to pointer. //! - If T is an array type and Pointer is a more CV qualified pointer to element_type. template - unique_ptr(Pointer p, BOOST_MOVE_SEEDOC(deleter_arg_type1) d1 + BOOST_MOVE_FORCEINLINE unique_ptr(Pointer p, BOOST_MOVE_SEEDOC(deleter_arg_type1) d1 BOOST_MOVE_DOCIGN(BOOST_MOVE_I typename bmupd::enable_up_ptr::type* =0) ) BOOST_NOEXCEPT : m_data(p, d1) @@ -474,7 +474,7 @@ class unique_ptr //! Effects: Same effects as template unique_ptr(Pointer p, deleter_arg_type1 d1) //! and additionally get() == nullptr - unique_ptr(BOOST_MOVE_DOC0PTR(bmupd::nullptr_type), BOOST_MOVE_SEEDOC(deleter_arg_type1) d1) BOOST_NOEXCEPT + BOOST_MOVE_FORCEINLINE unique_ptr(BOOST_MOVE_DOC0PTR(bmupd::nullptr_type), BOOST_MOVE_SEEDOC(deleter_arg_type1) d1) BOOST_NOEXCEPT : m_data(pointer(), d1) {} @@ -499,7 +499,7 @@ class unique_ptr //! - If T is not an array type and Pointer is implicitly convertible to pointer. //! - If T is an array type and Pointer is a more CV qualified pointer to element_type. template - unique_ptr(Pointer p, BOOST_MOVE_SEEDOC(deleter_arg_type2) d2 + BOOST_MOVE_FORCEINLINE unique_ptr(Pointer p, BOOST_MOVE_SEEDOC(deleter_arg_type2) d2 BOOST_MOVE_DOCIGN(BOOST_MOVE_I typename bmupd::enable_up_ptr::type* =0) ) BOOST_NOEXCEPT : m_data(p, ::boost::move(d2)) @@ -512,7 +512,7 @@ class unique_ptr //! Effects: Same effects as template unique_ptr(Pointer p, deleter_arg_type2 d2) //! and additionally get() == nullptr - unique_ptr(BOOST_MOVE_DOC0PTR(bmupd::nullptr_type), BOOST_MOVE_SEEDOC(deleter_arg_type2) d2) BOOST_NOEXCEPT + BOOST_MOVE_FORCEINLINE unique_ptr(BOOST_MOVE_DOC0PTR(bmupd::nullptr_type), BOOST_MOVE_SEEDOC(deleter_arg_type2) d2) BOOST_NOEXCEPT : m_data(pointer(), ::boost::move(d2)) {} @@ -526,7 +526,7 @@ class unique_ptr //! Postconditions: get() yields the value u.get() yielded before the construction. get_deleter() //! returns a reference to the stored deleter that was constructed from u.get_deleter(). If D is a //! reference type then get_deleter() and u.get_deleter() both reference the same lvalue deleter. - unique_ptr(BOOST_RV_REF(unique_ptr) u) BOOST_NOEXCEPT + BOOST_MOVE_FORCEINLINE unique_ptr(BOOST_RV_REF(unique_ptr) u) BOOST_NOEXCEPT : m_data(u.release(), ::boost::move_if_not_lvalue_reference(u.get_deleter())) {} @@ -546,7 +546,7 @@ class unique_ptr //! Postconditions: get() yields the value u.get() yielded before the construction. get_deleter() //! returns a reference to the stored deleter that was constructed from u.get_deleter(). template - unique_ptr( BOOST_RV_REF_BEG_IF_CXX11 unique_ptr BOOST_RV_REF_END_IF_CXX11 u + BOOST_MOVE_FORCEINLINE unique_ptr( BOOST_RV_REF_BEG_IF_CXX11 unique_ptr BOOST_RV_REF_END_IF_CXX11 u BOOST_MOVE_DOCIGN(BOOST_MOVE_I typename bmupd::enable_up_moveconv_constr::type* =0) ) BOOST_NOEXCEPT : m_data(u.release(), ::boost::move_if_not_lvalue_reference(u.get_deleter())) @@ -629,7 +629,7 @@ class unique_ptr //! Returns: get()[i]. //! //! Remarks::type) + BOOST_MOVE_FORCEINLINE BOOST_MOVE_DOC1ST(element_type&, typename bmupmu::add_lvalue_reference::type) operator[](std::size_t i) const BOOST_NOEXCEPT { BOOST_ASSERT( bmupmu::extent::value == 0 || i < bmupmu::extent::value ); @@ -644,7 +644,7 @@ class unique_ptr //! Note: use typically requires that T be a complete type. //! //! Remarks() const BOOST_NOEXCEPT + BOOST_MOVE_FORCEINLINE pointer operator->() const BOOST_NOEXCEPT { BOOST_STATIC_ASSERT((!bmupmu::is_array::value)); BOOST_ASSERT(m_data.m_p); @@ -653,27 +653,27 @@ class unique_ptr //! Returns: The stored pointer. //! - pointer get() const BOOST_NOEXCEPT + BOOST_MOVE_FORCEINLINE pointer get() const BOOST_NOEXCEPT { return m_data.m_p; } //! Returns: A reference to the stored deleter. //! - BOOST_MOVE_DOC1ST(D&, typename bmupmu::add_lvalue_reference::type) + BOOST_MOVE_FORCEINLINE BOOST_MOVE_DOC1ST(D&, typename bmupmu::add_lvalue_reference::type) get_deleter() BOOST_NOEXCEPT { return m_data.deleter(); } //! Returns: A reference to the stored deleter. //! - BOOST_MOVE_DOC1ST(const D&, typename bmupmu::add_const_lvalue_reference::type) + BOOST_MOVE_FORCEINLINE BOOST_MOVE_DOC1ST(const D&, typename bmupmu::add_const_lvalue_reference::type) get_deleter() const BOOST_NOEXCEPT { return m_data.deleter(); } #ifdef BOOST_MOVE_DOXYGEN_INVOKED //! Returns: Returns: get() != nullptr. //! - explicit operator bool + BOOST_MOVE_FORCEINLINE explicit operator bool #else - operator bmupd::explicit_bool_arg + BOOST_MOVE_FORCEINLINE operator bmupd::explicit_bool_arg #endif ()const BOOST_NOEXCEPT { @@ -685,7 +685,7 @@ class unique_ptr //! Postcondition: get() == nullptr. //! //! Returns: The value get() had at the start of the call to release. - pointer release() BOOST_NOEXCEPT + BOOST_MOVE_FORCEINLINE pointer release() BOOST_NOEXCEPT { const pointer tmp = m_data.m_p; m_data.m_p = pointer(); @@ -748,19 +748,19 @@ class unique_ptr //! Effects: Calls x.swap(y). //! template -inline void swap(unique_ptr &x, unique_ptr &y) BOOST_NOEXCEPT +BOOST_MOVE_FORCEINLINE void swap(unique_ptr &x, unique_ptr &y) BOOST_NOEXCEPT { x.swap(y); } //! Returns: x.get() == y.get(). //! template -inline bool operator==(const unique_ptr &x, const unique_ptr &y) +BOOST_MOVE_FORCEINLINE bool operator==(const unique_ptr &x, const unique_ptr &y) { return x.get() == y.get(); } //! Returns: x.get() != y.get(). //! template -inline bool operator!=(const unique_ptr &x, const unique_ptr &y) +BOOST_MOVE_FORCEINLINE bool operator!=(const unique_ptr &x, const unique_ptr &y) { return x.get() != y.get(); } //! Returns: x.get() < y.get(). @@ -768,99 +768,99 @@ inline bool operator!=(const unique_ptr &x, const unique_ptr &y) //! Remarks: This comparison shall induce a //! strict weak ordering betwen pointers. template -inline bool operator<(const unique_ptr &x, const unique_ptr &y) +BOOST_MOVE_FORCEINLINE bool operator<(const unique_ptr &x, const unique_ptr &y) { return x.get() < y.get(); } //! Returns: !(y < x). //! template -inline bool operator<=(const unique_ptr &x, const unique_ptr &y) +BOOST_MOVE_FORCEINLINE bool operator<=(const unique_ptr &x, const unique_ptr &y) { return !(y < x); } //! Returns: y < x. //! template -inline bool operator>(const unique_ptr &x, const unique_ptr &y) +BOOST_MOVE_FORCEINLINE bool operator>(const unique_ptr &x, const unique_ptr &y) { return y < x; } //! Returns:!(x < y). //! template -inline bool operator>=(const unique_ptr &x, const unique_ptr &y) +BOOST_MOVE_FORCEINLINE bool operator>=(const unique_ptr &x, const unique_ptr &y) { return !(x < y); } //! Returns:!x. //! template -inline bool operator==(const unique_ptr &x, BOOST_MOVE_DOC0PTR(bmupd::nullptr_type)) BOOST_NOEXCEPT +BOOST_MOVE_FORCEINLINE bool operator==(const unique_ptr &x, BOOST_MOVE_DOC0PTR(bmupd::nullptr_type)) BOOST_NOEXCEPT { return !x; } //! Returns:!x. //! template -inline bool operator==(BOOST_MOVE_DOC0PTR(bmupd::nullptr_type), const unique_ptr &x) BOOST_NOEXCEPT +BOOST_MOVE_FORCEINLINE bool operator==(BOOST_MOVE_DOC0PTR(bmupd::nullptr_type), const unique_ptr &x) BOOST_NOEXCEPT { return !x; } //! Returns: (bool)x. //! template -inline bool operator!=(const unique_ptr &x, BOOST_MOVE_DOC0PTR(bmupd::nullptr_type)) BOOST_NOEXCEPT +BOOST_MOVE_FORCEINLINE bool operator!=(const unique_ptr &x, BOOST_MOVE_DOC0PTR(bmupd::nullptr_type)) BOOST_NOEXCEPT { return !!x; } //! Returns: (bool)x. //! template -inline bool operator!=(BOOST_MOVE_DOC0PTR(bmupd::nullptr_type), const unique_ptr &x) BOOST_NOEXCEPT +BOOST_MOVE_FORCEINLINE bool operator!=(BOOST_MOVE_DOC0PTR(bmupd::nullptr_type), const unique_ptr &x) BOOST_NOEXCEPT { return !!x; } //! Requires: operator shall induce a strict weak ordering on unique_ptr::pointer values. //! //! Returns: Returns x.get() < pointer(). template -inline bool operator<(const unique_ptr &x, BOOST_MOVE_DOC0PTR(bmupd::nullptr_type)) +BOOST_MOVE_FORCEINLINE bool operator<(const unique_ptr &x, BOOST_MOVE_DOC0PTR(bmupd::nullptr_type)) { return x.get() < typename unique_ptr::pointer(); } //! Requires: operator shall induce a strict weak ordering on unique_ptr::pointer values. //! //! Returns: Returns pointer() < x.get(). template -inline bool operator<(BOOST_MOVE_DOC0PTR(bmupd::nullptr_type), const unique_ptr &x) +BOOST_MOVE_FORCEINLINE bool operator<(BOOST_MOVE_DOC0PTR(bmupd::nullptr_type), const unique_ptr &x) { return typename unique_ptr::pointer() < x.get(); } //! Returns: nullptr < x. //! template -inline bool operator>(const unique_ptr &x, BOOST_MOVE_DOC0PTR(bmupd::nullptr_type)) +BOOST_MOVE_FORCEINLINE bool operator>(const unique_ptr &x, BOOST_MOVE_DOC0PTR(bmupd::nullptr_type)) { return x.get() > typename unique_ptr::pointer(); } //! Returns: x < nullptr. //! template -inline bool operator>(BOOST_MOVE_DOC0PTR(bmupd::nullptr_type), const unique_ptr &x) +BOOST_MOVE_FORCEINLINE bool operator>(BOOST_MOVE_DOC0PTR(bmupd::nullptr_type), const unique_ptr &x) { return typename unique_ptr::pointer() > x.get(); } //! Returns: !(nullptr < x). //! template -inline bool operator<=(const unique_ptr &x, BOOST_MOVE_DOC0PTR(bmupd::nullptr_type)) +BOOST_MOVE_FORCEINLINE bool operator<=(const unique_ptr &x, BOOST_MOVE_DOC0PTR(bmupd::nullptr_type)) { return !(bmupd::nullptr_type() < x); } //! Returns: !(x < nullptr). //! template -inline bool operator<=(BOOST_MOVE_DOC0PTR(bmupd::nullptr_type), const unique_ptr &x) +BOOST_MOVE_FORCEINLINE bool operator<=(BOOST_MOVE_DOC0PTR(bmupd::nullptr_type), const unique_ptr &x) { return !(x < bmupd::nullptr_type()); } //! Returns: !(x < nullptr). //! template -inline bool operator>=(const unique_ptr &x, BOOST_MOVE_DOC0PTR(bmupd::nullptr_type)) +BOOST_MOVE_FORCEINLINE bool operator>=(const unique_ptr &x, BOOST_MOVE_DOC0PTR(bmupd::nullptr_type)) { return !(x < bmupd::nullptr_type()); } //! Returns: !(nullptr < x). //! template -inline bool operator>=(BOOST_MOVE_DOC0PTR(bmupd::nullptr_type), const unique_ptr &x) +BOOST_MOVE_FORCEINLINE bool operator>=(BOOST_MOVE_DOC0PTR(bmupd::nullptr_type), const unique_ptr &x) { return !(bmupd::nullptr_type() < x); } } //namespace movelib { diff --git a/cpp/BoostParts/boost/move/utility.hpp b/cpp/BoostParts/boost/move/utility.hpp index 8f9c20b65f..28de7935c8 100644 --- a/cpp/BoostParts/boost/move/utility.hpp +++ b/cpp/BoostParts/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/cpp/BoostParts/boost/move/utility_core.hpp b/cpp/BoostParts/boost/move/utility_core.hpp index 7fd1ea1443..55042a9bb1 100644 --- a/cpp/BoostParts/boost/move/utility_core.hpp +++ b/cpp/BoostParts/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/cpp/BoostParts/boost/mpi/communicator.hpp b/cpp/BoostParts/boost/mpi/communicator.hpp index fcef0866a9..46f7375d6f 100644 --- a/cpp/BoostParts/boost/mpi/communicator.hpp +++ b/cpp/BoostParts/boost/mpi/communicator.hpp @@ -1257,7 +1257,7 @@ communicator::array_recv_impl(int source, int tag, T* values, int n, ia >> count; // Deserialize the data in the message - boost::serialization::array arr(values, count > n? n : count); + boost::serialization::array_wrapper arr(values, count > n? n : count); ia >> arr; if (count > n) { @@ -1459,7 +1459,7 @@ namespace detail { ia >> count; // Deserialize the data in the message - boost::serialization::array arr(values, count > n? n : count); + boost::serialization::array_wrapper arr(values, count > n? n : count); ia >> arr; if (count > n) { diff --git a/cpp/BoostParts/boost/mpi/detail/binary_buffer_iprimitive.hpp b/cpp/BoostParts/boost/mpi/detail/binary_buffer_iprimitive.hpp index f499d0d5a8..388cd44c14 100644 --- a/cpp/BoostParts/boost/mpi/detail/binary_buffer_iprimitive.hpp +++ b/cpp/BoostParts/boost/mpi/detail/binary_buffer_iprimitive.hpp @@ -66,7 +66,7 @@ class BOOST_MPI_DECL binary_buffer_iprimitive // fast saving of arrays of fundamental types template - void load_array(serialization::array const& x, unsigned int /* file_version */) + void load_array(serialization::array_wrapper const& x, unsigned int /* file_version */) { BOOST_MPL_ASSERT((serialization::is_bitwise_serializable::type>)); if (x.count()) @@ -76,7 +76,7 @@ class BOOST_MPI_DECL binary_buffer_iprimitive typedef serialization::is_bitwise_serializable use_array_optimization; template - void load(serialization::array const& x) + void load(serialization::array_wrapper const& x) { load_array(x,0u); } diff --git a/cpp/BoostParts/boost/mpi/detail/binary_buffer_oprimitive.hpp b/cpp/BoostParts/boost/mpi/detail/binary_buffer_oprimitive.hpp index facf36067b..1de441d26b 100644 --- a/cpp/BoostParts/boost/mpi/detail/binary_buffer_oprimitive.hpp +++ b/cpp/BoostParts/boost/mpi/detail/binary_buffer_oprimitive.hpp @@ -55,7 +55,7 @@ class BOOST_MPI_DECL binary_buffer_oprimitive // fast saving of arrays template - void save_array(serialization::array const& x, unsigned int /* file_version */) + void save_array(serialization::array_wrapper const& x, unsigned int /* file_version */) { BOOST_MPL_ASSERT((serialization::is_bitwise_serializable::type>)); @@ -64,7 +64,7 @@ class BOOST_MPI_DECL binary_buffer_oprimitive } template - void save(serialization::array const& x) + void save(serialization::array_wrapper const& x) { save_array(x,0u); } diff --git a/cpp/BoostParts/boost/mpi/detail/ignore_iprimitive.hpp b/cpp/BoostParts/boost/mpi/detail/ignore_iprimitive.hpp index eb3d2b78fb..151ed0b348 100644 --- a/cpp/BoostParts/boost/mpi/detail/ignore_iprimitive.hpp +++ b/cpp/BoostParts/boost/mpi/detail/ignore_iprimitive.hpp @@ -37,7 +37,7 @@ class ignore_iprimitive /// don't do anything when loading arrays template - void load_array(serialization::array &, unsigned int ) + void load_array(serialization::array_wrapper &, unsigned int ) {} typedef is_mpi_datatype use_array_optimization; diff --git a/cpp/BoostParts/boost/mpi/detail/ignore_oprimitive.hpp b/cpp/BoostParts/boost/mpi/detail/ignore_oprimitive.hpp index 23375cad7b..4f2994bfc7 100644 --- a/cpp/BoostParts/boost/mpi/detail/ignore_oprimitive.hpp +++ b/cpp/BoostParts/boost/mpi/detail/ignore_oprimitive.hpp @@ -36,7 +36,7 @@ class ignore_oprimitive /// don't do anything when saving arrays template - void save_array(serialization::array const&, unsigned int ) + void save_array(serialization::array_wrapper const&, unsigned int ) { } diff --git a/cpp/BoostParts/boost/mpi/detail/mpi_datatype_primitive.hpp b/cpp/BoostParts/boost/mpi/detail/mpi_datatype_primitive.hpp index 0a6078548f..c230055ab5 100644 --- a/cpp/BoostParts/boost/mpi/detail/mpi_datatype_primitive.hpp +++ b/cpp/BoostParts/boost/mpi/detail/mpi_datatype_primitive.hpp @@ -63,7 +63,7 @@ class mpi_datatype_primitive // fast saving of arrays of MPI types template - void save_array(serialization::array const& x, unsigned int /* version */) + void save_array(serialization::array_wrapper const& x, unsigned int /* version */) { if (x.count()) save_impl(x.address(), boost::mpi::get_mpi_datatype(*x.address()), x.count()); diff --git a/cpp/BoostParts/boost/mpi/detail/packed_iprimitive.hpp b/cpp/BoostParts/boost/mpi/detail/packed_iprimitive.hpp index bb471a7c66..7080cbf53b 100644 --- a/cpp/BoostParts/boost/mpi/detail/packed_iprimitive.hpp +++ b/cpp/BoostParts/boost/mpi/detail/packed_iprimitive.hpp @@ -64,7 +64,7 @@ class BOOST_MPI_DECL packed_iprimitive // fast saving of arrays of fundamental types template - void load_array(serialization::array const& x, unsigned int /* file_version */) + void load_array(serialization::array_wrapper const& x, unsigned int /* file_version */) { if (x.count()) load_impl(x.address(), get_mpi_datatype(*x.address()), x.count()); @@ -72,7 +72,7 @@ class BOOST_MPI_DECL packed_iprimitive /* template - void load(serialization::array const& x) + void load(serialization::array_wrapper const& x) { load_array(x,0u); } diff --git a/cpp/BoostParts/boost/mpi/detail/packed_oprimitive.hpp b/cpp/BoostParts/boost/mpi/detail/packed_oprimitive.hpp index 5ac6835e15..5b6b3b2708 100644 --- a/cpp/BoostParts/boost/mpi/detail/packed_oprimitive.hpp +++ b/cpp/BoostParts/boost/mpi/detail/packed_oprimitive.hpp @@ -54,7 +54,7 @@ class BOOST_MPI_DECL packed_oprimitive // fast saving of arrays template - void save_array(serialization::array const& x, unsigned int /* file_version */) + void save_array(serialization::array_wrapper const& x, unsigned int /* file_version */) { if (x.count()) save_impl(x.address(), get_mpi_datatype(*x.address()), x.count()); diff --git a/cpp/BoostParts/boost/none.hpp b/cpp/BoostParts/boost/none.hpp index db744e58ac..a37c45c514 100644 --- a/cpp/BoostParts/boost/none.hpp +++ b/cpp/BoostParts/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/cpp/BoostParts/boost/none_t.hpp b/cpp/BoostParts/boost/none_t.hpp index 608cb0c354..008f369d1c 100644 --- a/cpp/BoostParts/boost/none_t.hpp +++ b/cpp/BoostParts/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/cpp/BoostParts/boost/operators.hpp b/cpp/BoostParts/boost/operators.hpp index ab203304c7..3fc08d5e8d 100644 --- a/cpp/BoostParts/boost/operators.hpp +++ b/cpp/BoostParts/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 @@ struct incrementable : B typedef T incrementable_type; }; -template > +template > struct decrementable : B { friend T operator--(T& x, int) @@ -291,16 +295,16 @@ struct decrementable : B // 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/cpp/BoostParts/boost/optional/detail/old_optional_implementation.hpp b/cpp/BoostParts/boost/optional/detail/old_optional_implementation.hpp new file mode 100644 index 0000000000..f2e6718402 --- /dev/null +++ b/cpp/BoostParts/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/cpp/BoostParts/boost/optional/detail/optional_aligned_storage.hpp b/cpp/BoostParts/boost/optional/detail/optional_aligned_storage.hpp new file mode 100644 index 0000000000..6c7d58148e --- /dev/null +++ b/cpp/BoostParts/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/cpp/BoostParts/boost/optional/detail/optional_config.hpp b/cpp/BoostParts/boost/optional/detail/optional_config.hpp new file mode 100644 index 0000000000..648744edbe --- /dev/null +++ b/cpp/BoostParts/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/cpp/BoostParts/boost/optional/detail/optional_factory_support.hpp b/cpp/BoostParts/boost/optional/detail/optional_factory_support.hpp new file mode 100644 index 0000000000..efff92a503 --- /dev/null +++ b/cpp/BoostParts/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/cpp/BoostParts/boost/optional/detail/optional_reference_spec.hpp b/cpp/BoostParts/boost/optional/detail/optional_reference_spec.hpp new file mode 100644 index 0000000000..ba3951af7b --- /dev/null +++ b/cpp/BoostParts/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/cpp/BoostParts/boost/optional/detail/optional_relops.hpp b/cpp/BoostParts/boost/optional/detail/optional_relops.hpp new file mode 100644 index 0000000000..3f961179d7 --- /dev/null +++ b/cpp/BoostParts/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/cpp/BoostParts/boost/optional/detail/optional_swap.hpp b/cpp/BoostParts/boost/optional/detail/optional_swap.hpp new file mode 100644 index 0000000000..2a7059e701 --- /dev/null +++ b/cpp/BoostParts/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/cpp/BoostParts/boost/optional/optional.hpp b/cpp/BoostParts/boost/optional/optional.hpp index 9def94ede8..ff1a16ca48 100644 --- a/cpp/BoostParts/boost/optional/optional.hpp +++ b/cpp/BoostParts/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/cpp/BoostParts/boost/optional/optional_fwd.hpp b/cpp/BoostParts/boost/optional/optional_fwd.hpp index fb59682df6..c41a34d398 100644 --- a/cpp/BoostParts/boost/optional/optional_fwd.hpp +++ b/cpp/BoostParts/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/cpp/BoostParts/boost/predef/hardware/simd.h b/cpp/BoostParts/boost/predef/hardware/simd.h index 4de1e70cd3..ac5c9da2ca 100644 --- a/cpp/BoostParts/boost/predef/hardware/simd.h +++ b/cpp/BoostParts/boost/predef/hardware/simd.h @@ -77,12 +77,24 @@ Distributed under the Boost Software License, Version 1.0. # 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/cpp/BoostParts/boost/predef/hardware/simd/x86.h b/cpp/BoostParts/boost/predef/hardware/simd/x86.h index 0874bc4ea7..88bd81e362 100644 --- a/cpp/BoostParts/boost/predef/hardware/simd/x86.h +++ b/cpp/BoostParts/boost/predef/hardware/simd/x86.h @@ -67,7 +67,7 @@ Distributed under the Boost Software License, Version 1.0. [[`__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 @@ Distributed under the Boost Software License, Version 1.0. #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/cpp/BoostParts/boost/predef/hardware/simd/x86_amd.h b/cpp/BoostParts/boost/predef/hardware/simd/x86_amd.h index 60fd4485ec..c80d1ce2b7 100644 --- a/cpp/BoostParts/boost/predef/hardware/simd/x86_amd.h +++ b/cpp/BoostParts/boost/predef/hardware/simd/x86_amd.h @@ -33,13 +33,13 @@ Distributed under the Boost Software License, Version 1.0. [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/cpp/BoostParts/boost/predef/hardware/simd/x86_amd/versions.h b/cpp/BoostParts/boost/predef/hardware/simd/x86_amd/versions.h index a0a9e918bb..11157167c6 100644 --- a/cpp/BoostParts/boost/predef/hardware/simd/x86_amd/versions.h +++ b/cpp/BoostParts/boost/predef/hardware/simd/x86_amd/versions.h @@ -30,9 +30,9 @@ Distributed under the Boost Software License, Version 1.0. #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_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*. */ diff --git a/cpp/BoostParts/boost/predef/os/cygwin.h b/cpp/BoostParts/boost/predef/os/cygwin.h index 1985c97edc..9d36f0f317 100644 --- a/cpp/BoostParts/boost/predef/os/cygwin.h +++ b/cpp/BoostParts/boost/predef/os/cygwin.h @@ -29,7 +29,7 @@ Distributed under the Boost Software License, Version 1.0. 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/cpp/BoostParts/boost/predef/version.h b/cpp/BoostParts/boost/predef/version.h index 2fcdefa694..8745c94976 100644 --- a/cpp/BoostParts/boost/predef/version.h +++ b/cpp/BoostParts/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 @@ Distributed under the Boost Software License, Version 1.0. #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/cpp/BoostParts/boost/preprocessor/config/config.hpp b/cpp/BoostParts/boost/preprocessor/config/config.hpp index 835b283b7e..8be0e47545 100644 --- a/cpp/BoostParts/boost/preprocessor/config/config.hpp +++ b/cpp/BoostParts/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/cpp/BoostParts/boost/python/converter/registered.hpp b/cpp/BoostParts/boost/python/converter/registered.hpp index 68bb3c4a70..ad9a00b313 100644 --- a/cpp/BoostParts/boost/python/converter/registered.hpp +++ b/cpp/BoostParts/boost/python/converter/registered.hpp @@ -14,6 +14,11 @@ # include # include +#if defined(BOOST_PYTHON_TRACE_REGISTRY) \ + || defined(BOOST_PYTHON_CONVERTER_REGISTRY_APPLE_MACH_WORKAROUND) +# include +#endif + namespace boost { // You'll see shared_ptr mentioned in this header because we need to diff --git a/cpp/BoostParts/boost/python/detail/def_helper.hpp b/cpp/BoostParts/boost/python/detail/def_helper.hpp index e68ca0cd7b..92db09ed7b 100644 --- a/cpp/BoostParts/boost/python/detail/def_helper.hpp +++ b/cpp/BoostParts/boost/python/detail/def_helper.hpp @@ -6,7 +6,6 @@ # define DEF_HELPER_DWA200287_HPP # include -# include # include # include # include diff --git a/cpp/BoostParts/boost/python/detail/wrap_python.hpp b/cpp/BoostParts/boost/python/detail/wrap_python.hpp index eaef7841d5..9fdb222c68 100644 --- a/cpp/BoostParts/boost/python/detail/wrap_python.hpp +++ b/cpp/BoostParts/boost/python/detail/wrap_python.hpp @@ -85,13 +85,22 @@ #if defined(_WIN32) || defined(__CYGWIN__) # if defined(__GNUC__) && defined(__CYGWIN__) -# define SIZEOF_LONG 4 +# if defined(__LP64__) +# define SIZEOF_LONG 8 +# else +# define SIZEOF_LONG 4 +# endif + # if PY_MAJOR_VERSION < 2 || PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION <= 2 typedef int pid_t; -# define WORD_BIT 32 +# if defined(__LP64__) +# define WORD_BIT 64 +# else +# define WORD_BIT 32 +# endif # define hypot _hypot # include diff --git a/cpp/BoostParts/boost/python/object/class_metadata.hpp b/cpp/BoostParts/boost/python/object/class_metadata.hpp index c71cf67c4e..5009c176e8 100644 --- a/cpp/BoostParts/boost/python/object/class_metadata.hpp +++ b/cpp/BoostParts/boost/python/object/class_metadata.hpp @@ -164,7 +164,7 @@ struct class_metadata >::type held_type; // Determine if the object will be held by value - typedef is_convertible use_value_holder; + typedef mpl::bool_::value> use_value_holder; // Compute the "wrapped type", that is, if held_type is a smart // pointer, we're talking about the pointee. @@ -175,10 +175,12 @@ struct class_metadata >::type wrapped; // Determine whether to use a "back-reference holder" - typedef mpl::or_< - has_back_reference - , is_same - , is_base_and_derived + typedef mpl::bool_< + mpl::or_< + has_back_reference + , is_same + , is_base_and_derived + >::value > use_back_reference; // Select the holder. diff --git a/cpp/BoostParts/boost/range/const_iterator.hpp b/cpp/BoostParts/boost/range/const_iterator.hpp index 3413e59195..727fdad058 100644 --- a/cpp/BoostParts/boost/range/const_iterator.hpp +++ b/cpp/BoostParts/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/cpp/BoostParts/boost/regex/config.hpp b/cpp/BoostParts/boost/regex/config.hpp index 4fd1fd94a8..9dc48dc8ab 100644 --- a/cpp/BoostParts/boost/regex/config.hpp +++ b/cpp/BoostParts/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/cpp/BoostParts/boost/regex/v4/basic_regex_parser.hpp b/cpp/BoostParts/boost/regex/v4/basic_regex_parser.hpp index 4a80ab9c32..d097eed959 100644 --- a/cpp/BoostParts/boost/regex/v4/basic_regex_parser.hpp +++ b/cpp/BoostParts/boost/regex/v4/basic_regex_parser.hpp @@ -2650,7 +2650,7 @@ bool basic_regex_parser::parse_perl_extension() // // 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/cpp/BoostParts/boost/regex/v4/fileiter.hpp b/cpp/BoostParts/boost/regex/v4/fileiter.hpp index 4873a0a85e..256a7e4606 100644 --- a/cpp/BoostParts/boost/regex/v4/fileiter.hpp +++ b/cpp/BoostParts/boost/regex/v4/fileiter.hpp @@ -225,11 +225,11 @@ class BOOST_REGEX_DECL mapfile_iterator 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/cpp/BoostParts/boost/regex/v4/match_flags.hpp b/cpp/BoostParts/boost/regex/v4/match_flags.hpp index e21de6cf6a..1c0046b75f 100644 --- a/cpp/BoostParts/boost/regex/v4/match_flags.hpp +++ b/cpp/BoostParts/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/cpp/BoostParts/boost/regex/v4/mem_block_cache.hpp b/cpp/BoostParts/boost/regex/v4/mem_block_cache.hpp index dc54915062..50af421ea2 100644 --- a/cpp/BoostParts/boost/regex/v4/mem_block_cache.hpp +++ b/cpp/BoostParts/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/cpp/BoostParts/boost/serialization/array.hpp b/cpp/BoostParts/boost/serialization/array.hpp index 97ac0c2501..2cd023aca9 100644 --- a/cpp/BoostParts/boost/serialization/array.hpp +++ b/cpp/BoostParts/boost/serialization/array.hpp @@ -6,13 +6,9 @@ // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#include // msvc 6.0 needs this for warning suppression +//#include -#include -#include // std::size_t -#ifndef BOOST_NO_CXX11_HDR_ARRAY -#include -#endif +#include // msvc 6.0 needs this for warning suppression #if defined(BOOST_NO_STDC_NAMESPACE) namespace std{ @@ -23,11 +19,13 @@ namespace std{ #include #include #include +#include #include #include -#include +#include #include -#include +#include +#include namespace boost { namespace serialization { @@ -37,24 +35,27 @@ template struct use_array_optimization : boost::mpl::always {}; template -class array : - public wrapper_traits > +class array_wrapper : + public wrapper_traits > { -public: - typedef T value_type; - - array(value_type* t, std::size_t s) : - m_t(t), - m_element_count(s) - {} - array(const array & rhs) : +private: + array_wrapper & operator=(const array_wrapper & rhs); +public: + // note: I would like to make the copy constructor private but this breaks + // make_array. So I try to make make_array a friend - but that doesn't + // build. Need a C++ guru to explain this! + template + friend const boost::serialization::array_wrapper make_array( T* t, S s); + + array_wrapper(const array_wrapper & rhs) : m_t(rhs.m_t), m_element_count(rhs.m_element_count) {} - array & operator=(const array & rhs){ - m_t = rhs.m_t; - m_element_count = rhs.m_element_count; - } +public: + array_wrapper(T * t, std::size_t s) : + m_t(t), + m_element_count(s) + {} // default implementation template @@ -62,7 +63,7 @@ class array : { // default implemention does the loop std::size_t c = count(); - value_type * t = address(); + T * t = address(); while(0 < c--) ar & boost::serialization::make_nvp("item", *t++); } @@ -99,7 +100,7 @@ class array : serialize_optimized(ar,version,use_optimized()); } - value_type* address() const + T * address() const { return m_t; } @@ -108,26 +109,32 @@ class array : { return m_element_count; } - + private: - value_type* m_t; - std::size_t m_element_count; + T * const m_t; + const std::size_t m_element_count; }; -template +template inline -const array< T > make_array( T* t, std::size_t s){ - return array< T >(t, s); +const array_wrapper< T > make_array( T* t, S s){ + const array_wrapper< T > a(t, s); + return a; } -// implement serialization for boost::array -template -void serialize(Archive& ar, boost::array& a, const unsigned int /* version */) -{ - ar & boost::serialization::make_nvp("elems", a.elems); -} +} } // end namespace boost::serialization + +// I can't figure out why BOOST_NO_CXX11_HDR_ARRAY +// has been set for clang-11. So just make sure +// it's reset now. Needs further research!!! + +#if defined(_LIBCPP_VERSION) +#undef BOOST_NO_CXX11_HDR_ARRAY +#endif #ifndef BOOST_NO_CXX11_HDR_ARRAY +#include +namespace boost { namespace serialization { // implement serialization for std::array template void serialize(Archive& ar, std::array& a, const unsigned int /* version */) @@ -138,8 +145,19 @@ void serialize(Archive& ar, std::array& a, const unsigned int /* version */ ); } +} } // end namespace boost::serialization #endif +#include + +namespace boost { namespace serialization { +// implement serialization for boost::array +template +void serialize(Archive& ar, boost::array& a, const unsigned int /* version */) +{ + ar & boost::serialization::make_nvp("elems", a.elems); +} + } } // end namespace boost::serialization #define BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION(Archive) \ diff --git a/cpp/BoostParts/boost/serialization/assume_abstract.hpp b/cpp/BoostParts/boost/serialization/assume_abstract.hpp index a5cb2f55a4..632f9312f5 100644 --- a/cpp/BoostParts/boost/serialization/assume_abstract.hpp +++ b/cpp/BoostParts/boost/serialization/assume_abstract.hpp @@ -19,6 +19,7 @@ // this is useful for compilers which don't support the boost::is_abstract #include +#include #ifndef BOOST_NO_IS_ABSTRACT diff --git a/cpp/BoostParts/boost/serialization/base_object.hpp b/cpp/BoostParts/boost/serialization/base_object.hpp index 7ede6473e0..1a82cecd4b 100644 --- a/cpp/BoostParts/boost/serialization/base_object.hpp +++ b/cpp/BoostParts/boost/serialization/base_object.hpp @@ -25,7 +25,6 @@ #include #include -#include #include #include diff --git a/cpp/BoostParts/boost/serialization/collection_traits.hpp b/cpp/BoostParts/boost/serialization/collection_traits.hpp index b3fe843426..3ec9401eff 100644 --- a/cpp/BoostParts/boost/serialization/collection_traits.hpp +++ b/cpp/BoostParts/boost/serialization/collection_traits.hpp @@ -23,7 +23,7 @@ // exists for archives to be non-portable if class information for primitive // types is included. This is addressed by the following macros. #include -#include +//#include #include #include diff --git a/cpp/BoostParts/boost/serialization/detail/stack_constructor.hpp b/cpp/BoostParts/boost/serialization/detail/stack_constructor.hpp index 9027717a92..806b8877d7 100644 --- a/cpp/BoostParts/boost/serialization/detail/stack_constructor.hpp +++ b/cpp/BoostParts/boost/serialization/detail/stack_constructor.hpp @@ -17,6 +17,7 @@ // See http://www.boost.org for updates, documentation, and revision history. #include +#include namespace boost{ namespace serialization { diff --git a/cpp/BoostParts/boost/serialization/is_bitwise_serializable.hpp b/cpp/BoostParts/boost/serialization/is_bitwise_serializable.hpp index dac597ec2c..7e24a2cb6d 100644 --- a/cpp/BoostParts/boost/serialization/is_bitwise_serializable.hpp +++ b/cpp/BoostParts/boost/serialization/is_bitwise_serializable.hpp @@ -21,7 +21,7 @@ # pragma once #endif -#include +#include #include namespace boost { diff --git a/cpp/BoostParts/boost/serialization/nvp.hpp b/cpp/BoostParts/boost/serialization/nvp.hpp index 6a1eb82656..4e2297b3cc 100644 --- a/cpp/BoostParts/boost/serialization/nvp.hpp +++ b/cpp/BoostParts/boost/serialization/nvp.hpp @@ -21,9 +21,6 @@ #include #include -#include -#include - #include #include #include @@ -39,14 +36,14 @@ struct nvp : public std::pair, public wrapper_traits > { +//private: + nvp(const nvp & rhs) : + std::pair(rhs.first, rhs.second) + {} +public: explicit nvp(const char * name_, T & t) : - // note: redundant cast works around borland issue // note: added _ to suppress useless gcc warning - std::pair(name_, (T*)(& t)) - {} - nvp(const nvp & rhs) : - // note: redundant cast works around borland issue - std::pair(rhs.first, (T*)rhs.second) + std::pair(name_, & t) {} const char * name() const { @@ -60,26 +57,18 @@ struct nvp : return *(this->second); } - // True64 compiler complains with a warning about the use of - // the name "Archive" hiding some higher level usage. I'm sure this - // is an error but I want to accomodated as it generates a long warning - // listing and might be related to a lot of test failures. - // default treatment for name-value pairs. The name is - // just discarded and only the value is serialized. - template + template void save( - Archivex & ar, + Archive & ar, const unsigned int /* file_version */ ) const { - // CodeWarrior 8.x can't seem to resolve the << op for a rhs of "const T *" ar.operator<<(const_value()); } - template + template void load( - Archivex & ar, + Archive & ar, const unsigned int /* file_version */ ){ - // CodeWarrior 8.x can't seem to resolve the >> op for a rhs of "const T *" ar.operator>>(value()); } BOOST_SERIALIZATION_SPLIT_MEMBER() @@ -115,7 +104,6 @@ struct tracking_level > BOOST_STATIC_CONSTANT(int, value = tracking_level::type::value); }; - } // seralization } // boost diff --git a/cpp/BoostParts/boost/serialization/singleton.hpp b/cpp/BoostParts/boost/serialization/singleton.hpp index db32395ce2..fcb79c3694 100644 --- a/cpp/BoostParts/boost/serialization/singleton.hpp +++ b/cpp/BoostParts/boost/serialization/singleton.hpp @@ -39,6 +39,10 @@ #include #include +#include +#include +#include // must be the last header + #ifdef BOOST_MSVC # pragma warning(push) # pragma warning(disable : 4511 4512) @@ -81,25 +85,15 @@ class BOOST_SYMBOL_VISIBLE singleton_module : public boost::noncopyable { private: - static bool & get_lock(){ - static bool lock = false; - return lock; - } + static bool & get_lock(); public: -// static const void * get_module_handle(){ -// return static_cast(get_module_handle); -// } - static void lock(){ - get_lock() = true; - } - static void unlock(){ - get_lock() = false; - } - static bool is_locked() { - return get_lock(); - } + BOOST_SERIALIZATION_DECL static void lock(); + BOOST_SERIALIZATION_DECL static void unlock(); + BOOST_SERIALIZATION_DECL static bool is_locked(); }; +#include // pops abi_suffix.hpp pragmas + namespace detail { template diff --git a/cpp/BoostParts/boost/serialization/static_warning.hpp b/cpp/BoostParts/boost/serialization/static_warning.hpp index 2d49de1c2d..1d9238fc4d 100644 --- a/cpp/BoostParts/boost/serialization/static_warning.hpp +++ b/cpp/BoostParts/boost/serialization/static_warning.hpp @@ -66,6 +66,7 @@ #include #include #include +#include #include namespace boost { diff --git a/cpp/BoostParts/boost/serialization/traits.hpp b/cpp/BoostParts/boost/serialization/traits.hpp index d338b1b123..9e114fdd3d 100644 --- a/cpp/BoostParts/boost/serialization/traits.hpp +++ b/cpp/BoostParts/boost/serialization/traits.hpp @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include diff --git a/cpp/BoostParts/boost/serialization/vector.hpp b/cpp/BoostParts/boost/serialization/vector.hpp index 6e49bff38a..a1737548ef 100644 --- a/cpp/BoostParts/boost/serialization/vector.hpp +++ b/cpp/BoostParts/boost/serialization/vector.hpp @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include // default is being compatible with version 1.34.1 files, not 1.35 files @@ -103,7 +103,7 @@ inline void save( const collection_size_type count(t.size()); ar << BOOST_SERIALIZATION_NVP(count); if (!t.empty()) - ar << make_array(detail::get_data(t),t.size()); + ar << boost::serialization::make_array(detail::get_data(t),t.size()); } template @@ -121,7 +121,7 @@ inline void load( ar >> BOOST_SERIALIZATION_NVP(item_version); } if (!t.empty()) - ar >> make_array(detail::get_data(t),t.size()); + ar >> boost::serialization::make_array(detail::get_data(t),t.size()); } // dispatch to either default or optimized versions diff --git a/cpp/BoostParts/boost/serialization/wrapper.hpp b/cpp/BoostParts/boost/serialization/wrapper.hpp index 6a2a730dde..60d7910b17 100644 --- a/cpp/BoostParts/boost/serialization/wrapper.hpp +++ b/cpp/BoostParts/boost/serialization/wrapper.hpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include namespace boost { namespace serialization { diff --git a/cpp/BoostParts/boost/smart_ptr/shared_ptr.hpp b/cpp/BoostParts/boost/smart_ptr/shared_ptr.hpp index 47bc33d517..bcefda8897 100644 --- a/cpp/BoostParts/boost/smart_ptr/shared_ptr.hpp +++ b/cpp/BoostParts/boost/smart_ptr/shared_ptr.hpp @@ -1065,7 +1065,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/cpp/BoostParts/boost/spirit/home/classic/core/non_terminal/impl/rule.ipp b/cpp/BoostParts/boost/spirit/home/classic/core/non_terminal/impl/rule.ipp index 9f10306f7c..137694ef2f 100644 --- a/cpp/BoostParts/boost/spirit/home/classic/core/non_terminal/impl/rule.ipp +++ b/cpp/BoostParts/boost/spirit/home/classic/core/non_terminal/impl/rule.ipp @@ -24,6 +24,7 @@ #include #include #include +#include /////////////////////////////////////////////////////////////////////////////// namespace boost { namespace spirit { diff --git a/cpp/BoostParts/boost/test/impl/debug.ipp b/cpp/BoostParts/boost/test/impl/debug.ipp index f4ee4971ce..f547052ded 100644 --- a/cpp/BoostParts/boost/test/impl/debug.ipp +++ b/cpp/BoostParts/boost/test/impl/debug.ipp @@ -752,6 +752,29 @@ set_debugger( unit_test::const_string, dbg_starter ) // ************** attach debugger to the current process ************** // // ************************************************************************** // +#if defined(BOOST_WIN32_BASED_DEBUG) + +struct safe_handle_helper +{ + HANDLE& handle; + safe_handle_helper(HANDLE &handle_) : handle(handle_) {} + + void close_handle() + { + if( handle != INVALID_HANDLE_VALUE ) + { + ::CloseHandle( handle ); + handle = INVALID_HANDLE_VALUE; + } + } + + ~safe_handle_helper() + { + close_handle(); + } +}; +#endif + bool attach_debugger( bool break_or_continue ) { @@ -781,6 +804,8 @@ attach_debugger( bool break_or_continue ) if( !dbg_init_done_ev ) return false; + + safe_handle_helper safe_handle_obj( dbg_init_done_ev ); // *************************************************** // // Debugger command line format @@ -797,17 +822,20 @@ attach_debugger( bool break_or_continue ) DWORD format_size = MAX_CMD_LINE; DWORD type = REG_SZ; - if( !s_info.m_reg_query_value || (*s_info.m_reg_query_value)( + bool b_read_key = s_info.m_reg_query_value && + ((*s_info.m_reg_query_value)( reg_key, // handle of open key "Debugger", // name of subkey to query 0, // reserved &type, // value type (LPBYTE)format, // buffer for returned string - &format_size ) != ERROR_SUCCESS ) // in: buffer size; out: actual size of returned string - return false; + &format_size ) == ERROR_SUCCESS ); // in: buffer size; out: actual size of returned string if( !s_info.m_reg_close_key || (*s_info.m_reg_close_key)( reg_key ) != ERROR_SUCCESS ) return false; + + if( !b_read_key ) + return false; // *************************************************** // // Debugger command line @@ -841,12 +869,16 @@ attach_debugger( bool break_or_continue ) &debugger_info // pointer to PROCESS_INFORMATION that will contain the new process identification ); + bool debugger_run_ok = false; if( created ) - ::WaitForSingleObject( dbg_init_done_ev, INFINITE ); + { + DWORD ret_code = ::WaitForSingleObject( dbg_init_done_ev, INFINITE ); + debugger_run_ok = ( ret_code == WAIT_OBJECT_0 ); + } - ::CloseHandle( dbg_init_done_ev ); + safe_handle_obj.close_handle(); - if( !created ) + if( !created || !debugger_run_ok ) return false; if( break_or_continue ) diff --git a/cpp/BoostParts/boost/test/impl/execution_monitor.ipp b/cpp/BoostParts/boost/test/impl/execution_monitor.ipp index b3e873efbe..f7fc8ea4e2 100644 --- a/cpp/BoostParts/boost/test/impl/execution_monitor.ipp +++ b/cpp/BoostParts/boost/test/impl/execution_monitor.ipp @@ -1137,6 +1137,8 @@ execution_monitor::catch_signals( boost::function const& F ) detail::system_signal_exception SSE( this ); int ret_val = 0; + // clang windows workaround: this not available in __finally scope + bool l_catch_system_errors = p_catch_system_errors; __try { __try { @@ -1147,7 +1149,7 @@ execution_monitor::catch_signals( boost::function const& F ) } } __finally { - if( p_catch_system_errors ) { + if( l_catch_system_errors ) { BOOST_TEST_CRT_SET_HOOK( old_crt_hook ); _set_invalid_parameter_handler( old_iph ); @@ -1380,8 +1382,8 @@ enable( unsigned mask ) return ~old_cw & BOOST_FPE_ALL; #elif defined(__GLIBC__) && defined(__USE_GNU) && !defined(BOOST_CLANG) && !defined(BOOST_NO_FENV_H) - ::feclearexcept(BOOST_FPE_ALL); - int res = ::feenableexcept( mask ); + feclearexcept(BOOST_FPE_ALL); + int res = feenableexcept( mask ); return res == -1 ? (unsigned)BOOST_FPE_INV : (unsigned)res; #else /* Not Implemented */ @@ -1417,8 +1419,8 @@ disable( unsigned mask ) return ~old_cw & BOOST_FPE_ALL; #elif defined(__GLIBC__) && defined(__USE_GNU) && !defined(BOOST_CLANG) && !defined(BOOST_NO_FENV_H) - ::feclearexcept(BOOST_FPE_ALL); - int res = ::fedisableexcept( mask ); + feclearexcept(BOOST_FPE_ALL); + int res = fedisableexcept( mask ); return res == -1 ? (unsigned)BOOST_FPE_INV : (unsigned)res; #else /* Not Implemented */ diff --git a/cpp/BoostParts/boost/test/impl/framework.ipp b/cpp/BoostParts/boost/test/impl/framework.ipp index f710828051..78459bac27 100644 --- a/cpp/BoostParts/boost/test/impl/framework.ipp +++ b/cpp/BoostParts/boost/test/impl/framework.ipp @@ -480,6 +480,7 @@ public: BOOST_TEST_FOREACH( test_unit_id, chld_id, ts.m_children ) deduce_siblings_order( chld_id, master_tu_id, tuoi ); + ts.m_ranked_children.clear(); BOOST_TEST_FOREACH( test_unit_id, chld_id, ts.m_children ) { counter_t rank = assign_sibling_rank( chld_id, tuoi ); ts.m_ranked_children.insert( std::make_pair( rank, chld_id ) ); @@ -581,8 +582,17 @@ public: typedef unit_test_monitor_t::error_level execution_result; + // Random generator using the std::rand function (seeded prior to the call) + struct random_generator_helper { + size_t operator()(size_t i) const { + return std::rand() % i; + } + }; + // Executed the test tree with the root at specified test unit - execution_result execute_test_tree( test_unit_id tu_id, unsigned timeout = 0 ) + execution_result execute_test_tree( test_unit_id tu_id, + unsigned timeout = 0, + random_generator_helper const * const p_random_generator = 0) { test_unit const& tu = framework::get( tu_id, TUT_ANY ); @@ -662,12 +672,14 @@ public: it++; } - std::random_shuffle( children_with_the_same_rank.begin(), children_with_the_same_rank.end() ); + const random_generator_helper& rand_gen = p_random_generator ? *p_random_generator : random_generator_helper(); + + std::random_shuffle( children_with_the_same_rank.begin(), children_with_the_same_rank.end(), rand_gen ); BOOST_TEST_FOREACH( test_unit_id, chld, children_with_the_same_rank ) { unsigned chld_timeout = child_timeout( timeout, tu_timer.elapsed() ); - result = (std::min)( result, execute_test_tree( chld, chld_timeout ) ); + result = (std::min)( result, execute_test_tree( chld, chld_timeout, &rand_gen ) ); if( unit_test_monitor.is_critical_error( result ) ) break; @@ -1221,7 +1233,7 @@ run( test_unit_id id, bool continue_test ) case 0: break; case 1: - seed = static_cast( std::time( 0 ) ); + seed = static_cast( std::rand() ^ std::time( 0 ) ); // better init using std::rand() ^ ... default: BOOST_TEST_MESSAGE( "Test cases order is shuffled using seed: " << seed ); std::srand( seed ); diff --git a/cpp/BoostParts/boost/test/impl/xml_report_formatter.ipp b/cpp/BoostParts/boost/test/impl/xml_report_formatter.ipp index 08af9a3427..424ef4ba44 100644 --- a/cpp/BoostParts/boost/test/impl/xml_report_formatter.ipp +++ b/cpp/BoostParts/boost/test/impl/xml_report_formatter.ipp @@ -65,7 +65,7 @@ xml_report_formatter::test_unit_report_start( test_unit const& tu, std::ostream& descr = "failed"; ostr << '<' << ( tu.p_type == TUT_CASE ? "TestCase" : "TestSuite" ) - << " name" << utils::attr_value() << tu.p_name + << " name" << utils::attr_value() << tu.p_name.get() << " result" << utils::attr_value() << descr << " assertions_passed" << utils::attr_value() << tr.p_assertions_passed << " assertions_failed" << utils::attr_value() << tr.p_assertions_failed diff --git a/cpp/BoostParts/boost/test/tools/collection_comparison_op.hpp b/cpp/BoostParts/boost/test/tools/collection_comparison_op.hpp index e5c5ca3bb8..9d5a7d8f7b 100644 --- a/cpp/BoostParts/boost/test/tools/collection_comparison_op.hpp +++ b/cpp/BoostParts/boost/test/tools/collection_comparison_op.hpp @@ -278,7 +278,7 @@ lexicographic_compare( Lhs const& lhs, Rhs const& rhs ) template inline assertion_result -compare_collections( Lhs const& lhs, Rhs const& rhs, boost::type* tp, mpl::true_ ) +compare_collections( Lhs const& lhs, Rhs const& rhs, boost::type*, mpl::true_ ) { return lexicographic_compare( lhs, rhs ); } @@ -287,7 +287,7 @@ compare_collections( Lhs const& lhs, Rhs const& rhs, boost::type* tp, mpl::t template inline assertion_result -compare_collections( Lhs const& lhs, Rhs const& rhs, boost::type >* tp, mpl::false_ ) +compare_collections( Lhs const& lhs, Rhs const& rhs, boost::type >*, mpl::false_ ) { return lhs < rhs; } @@ -296,7 +296,7 @@ compare_collections( Lhs const& lhs, Rhs const& rhs, boost::type >* template inline assertion_result -compare_collections( Lhs const& lhs, Rhs const& rhs, boost::type >* tp, mpl::false_ ) +compare_collections( Lhs const& lhs, Rhs const& rhs, boost::type >*, mpl::false_ ) { return lhs <= rhs; } @@ -305,7 +305,7 @@ compare_collections( Lhs const& lhs, Rhs const& rhs, boost::type >* template inline assertion_result -compare_collections( Lhs const& lhs, Rhs const& rhs, boost::type >* tp, mpl::false_ ) +compare_collections( Lhs const& lhs, Rhs const& rhs, boost::type >*, mpl::false_ ) { return lhs > rhs; } @@ -314,7 +314,7 @@ compare_collections( Lhs const& lhs, Rhs const& rhs, boost::type >* template inline assertion_result -compare_collections( Lhs const& lhs, Rhs const& rhs, boost::type >* tp, mpl::false_ ) +compare_collections( Lhs const& lhs, Rhs const& rhs, boost::type >*, mpl::false_ ) { return lhs >= rhs; } diff --git a/cpp/BoostParts/boost/test/tools/detail/print_helper.hpp b/cpp/BoostParts/boost/test/tools/detail/print_helper.hpp index 77b936c44b..39ab707f36 100644 --- a/cpp/BoostParts/boost/test/tools/detail/print_helper.hpp +++ b/cpp/BoostParts/boost/test/tools/detail/print_helper.hpp @@ -22,9 +22,12 @@ // Boost #include +#include #include #include #include +#include + #include #include @@ -41,6 +44,9 @@ namespace tt_detail { template struct print_log_value { + BOOST_STATIC_ASSERT_MSG( (boost::has_left_shift::value), + "Type has to implement operator<< to be printable"); + void operator()( std::ostream& ostr, T const& t ) { typedef typename mpl::or_,is_function,is_abstract >::type cant_use_nl; diff --git a/cpp/BoostParts/boost/test/tools/interface.hpp b/cpp/BoostParts/boost/test/tools/interface.hpp index 48d5affc4f..5e84f1c6d4 100644 --- a/cpp/BoostParts/boost/test/tools/interface.hpp +++ b/cpp/BoostParts/boost/test/tools/interface.hpp @@ -40,17 +40,9 @@ // ************** BOOST_TEST_ ************** // // ************************************************************************** // -#ifdef BOOST_NO_CXX11_AUTO_DECLARATIONS -#define BOOST_TEST_BUILD_ASSERTION( P ) \ - ::boost::test_tools::tt_detail::expression_holder const& E= \ - ::boost::test_tools::tt_detail::hold_expression( \ - ::boost::test_tools::assertion::seed() ->* P ) \ -/**/ -#else -#define BOOST_TEST_BUILD_ASSERTION( P ) \ - auto const& E = ::boost::test_tools::assertion::seed()->*P \ +#define BOOST_TEST_BUILD_ASSERTION( P ) \ + (::boost::test_tools::assertion::seed()->*P) \ /**/ -#endif //____________________________________________________________________________// @@ -75,10 +67,10 @@ do { \ #define BOOST_TEST_TOOL_ET_IMPL( P, level ) \ do { \ BOOST_TEST_PASSPOINT(); \ - BOOST_TEST_BUILD_ASSERTION( P ); \ + \ ::boost::test_tools::tt_detail:: \ report_assertion( \ - E.evaluate(), \ + BOOST_TEST_BUILD_ASSERTION( P ).evaluate(), \ BOOST_TEST_LAZY_MSG( BOOST_TEST_STRINGIZE( P ) ), \ BOOST_TEST_L(__FILE__), \ static_cast(__LINE__), \ @@ -94,10 +86,11 @@ do { \ #define BOOST_TEST_TOOL_ET_IMPL_EX( P, level, arg ) \ do { \ BOOST_TEST_PASSPOINT(); \ - BOOST_TEST_BUILD_ASSERTION( P ); \ + \ ::boost::test_tools::tt_detail:: \ report_assertion( \ - ::boost::test_tools::tt_detail::assertion_evaluate(E) \ + ::boost::test_tools::tt_detail::assertion_evaluate( \ + BOOST_TEST_BUILD_ASSERTION( P ) ) \ << arg, \ ::boost::test_tools::tt_detail::assertion_text( \ BOOST_TEST_LAZY_MSG( BOOST_TEST_STRINGIZE(P) ), \ diff --git a/cpp/BoostParts/boost/test/utils/named_params.hpp b/cpp/BoostParts/boost/test/utils/named_params.hpp index ebd5a6a751..88b8a883fe 100644 --- a/cpp/BoostParts/boost/test/utils/named_params.hpp +++ b/cpp/BoostParts/boost/test/utils/named_params.hpp @@ -331,7 +331,7 @@ struct typed_keyword template inline typename enable_if_c::value,void>::type -opt_assign( T& target, Params const& p, Keyword k ) +opt_assign( T& /*target*/, Params const& /*p*/, Keyword /*k*/ ) { } diff --git a/cpp/BoostParts/boost/thread/future.hpp b/cpp/BoostParts/boost/thread/future.hpp index 0ec484c2bf..6100c1606b 100644 --- a/cpp/BoostParts/boost/thread/future.hpp +++ b/cpp/BoostParts/boost/thread/future.hpp @@ -1432,6 +1432,10 @@ namespace boost BOOST_THREAD_FUTURE make_future_async_continuation_shared_state(boost::unique_lock &lock, BOOST_THREAD_RV_REF(F) f, BOOST_THREAD_FWD_REF(Fp) c); + template + BOOST_THREAD_FUTURE + make_future_sync_continuation_shared_state(boost::unique_lock &lock, BOOST_THREAD_RV_REF(F) f, BOOST_THREAD_FWD_REF(Fp) c); + template BOOST_THREAD_FUTURE make_future_deferred_continuation_shared_state(boost::unique_lock &lock, BOOST_THREAD_RV_REF(F) f, BOOST_THREAD_FWD_REF(Fp) c); @@ -1444,6 +1448,11 @@ namespace boost BOOST_THREAD_FUTURE make_shared_future_async_continuation_shared_state(boost::unique_lock &lock, F f, BOOST_THREAD_FWD_REF(Fp) c); + template + BOOST_THREAD_FUTURE + make_shared_future_sync_continuation_shared_state(boost::unique_lock &lock, F f, BOOST_THREAD_FWD_REF(Fp) c); + + #ifdef BOOST_THREAD_PROVIDES_EXECUTORS template BOOST_THREAD_FUTURE @@ -1516,6 +1525,10 @@ namespace boost friend BOOST_THREAD_FUTURE detail::make_future_async_continuation_shared_state(boost::unique_lock &lock, BOOST_THREAD_RV_REF(F) f, BOOST_THREAD_FWD_REF(Fp) c); + template + friend BOOST_THREAD_FUTURE + detail::make_future_sync_continuation_shared_state(boost::unique_lock &lock, BOOST_THREAD_RV_REF(F) f, BOOST_THREAD_FWD_REF(Fp) c); + template friend BOOST_THREAD_FUTURE detail::make_future_deferred_continuation_shared_state(boost::unique_lock &lock, BOOST_THREAD_RV_REF(F) f, BOOST_THREAD_FWD_REF(Fp) c); @@ -1528,6 +1541,10 @@ namespace boost friend BOOST_THREAD_FUTURE detail::make_shared_future_async_continuation_shared_state(boost::unique_lock &lock, F f, BOOST_THREAD_FWD_REF(Fp) c); + template + friend BOOST_THREAD_FUTURE + detail::make_shared_future_sync_continuation_shared_state(boost::unique_lock &lock, F f, BOOST_THREAD_FWD_REF(Fp) c); + #ifdef BOOST_THREAD_PROVIDES_EXECUTORS template friend BOOST_THREAD_FUTURE @@ -1772,6 +1789,10 @@ namespace boost friend BOOST_THREAD_FUTURE detail::make_future_async_continuation_shared_state(boost::unique_lock &lock, BOOST_THREAD_RV_REF(F) f, BOOST_THREAD_FWD_REF(Fp) c); + template + friend BOOST_THREAD_FUTURE + detail::make_future_sync_continuation_shared_state(boost::unique_lock &lock, BOOST_THREAD_RV_REF(F) f, BOOST_THREAD_FWD_REF(Fp) c); + template friend BOOST_THREAD_FUTURE detail::make_future_deferred_continuation_shared_state(boost::unique_lock &lock, BOOST_THREAD_RV_REF(F) f, BOOST_THREAD_FWD_REF(Fp) c); @@ -1784,6 +1805,10 @@ namespace boost friend BOOST_THREAD_FUTURE detail::make_shared_future_async_continuation_shared_state(boost::unique_lock &lock, F f, BOOST_THREAD_FWD_REF(Fp) c); + template + friend BOOST_THREAD_FUTURE + detail::make_shared_future_sync_continuation_shared_state(boost::unique_lock &lock, F f, BOOST_THREAD_FWD_REF(Fp) c); + #ifdef BOOST_THREAD_PROVIDES_EXECUTORS template friend BOOST_THREAD_FUTURE @@ -2005,6 +2030,10 @@ namespace boost friend BOOST_THREAD_FUTURE detail::make_future_async_continuation_shared_state(boost::unique_lock &lock, BOOST_THREAD_RV_REF(F) f, BOOST_THREAD_FWD_REF(Fp) c); + template + friend BOOST_THREAD_FUTURE + detail::make_future_sync_continuation_shared_state(boost::unique_lock &lock, BOOST_THREAD_RV_REF(F) f, BOOST_THREAD_FWD_REF(Fp) c); + template friend BOOST_THREAD_FUTURE detail::make_future_deferred_continuation_shared_state(boost::unique_lock &lock, BOOST_THREAD_RV_REF(F) f, BOOST_THREAD_FWD_REF(Fp) c); @@ -4210,12 +4239,6 @@ namespace detail { //////////////////////////////// #if defined BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION -#if defined BOOST_THREAD_CONTINUATION_SYNC -#define continuation_shared_state_base shared_state -#else -#define continuation_shared_state_base future_async_shared_state_base -#endif - namespace detail { ////////////////////// @@ -4345,26 +4368,43 @@ namespace detail ///////////////////////// template - struct future_async_continuation_shared_state: continuation_shared_state > + struct future_async_continuation_shared_state: continuation_shared_state > { - typedef continuation_shared_state > base_type; + typedef continuation_shared_state > base_type; public: future_async_continuation_shared_state(BOOST_THREAD_RV_REF(F) f, BOOST_THREAD_FWD_REF(Fp) c) : base_type(boost::move(f), boost::forward(c)) { } void launch_continuation() { -#if defined BOOST_THREAD_CONTINUATION_SYNC - this->call(); -#elif defined BOOST_THREAD_FUTURE_BLOCKING +#if defined BOOST_THREAD_FUTURE_BLOCKING boost::lock_guard lk(this->mutex); this->thr_ = thread(&future_async_continuation_shared_state::run, static_shared_from_this(this)); #else - thread(&future_async_continuation_shared_state::run, static_shared_from_this(this)).detach(); + thread(&base_type::run, static_shared_from_this(this)).detach(); #endif } }; + ///////////////////////// + /// future_sync_continuation_shared_state + ///////////////////////// + + template + struct future_sync_continuation_shared_state: continuation_shared_state > + { + typedef continuation_shared_state > base_type; + public: + future_sync_continuation_shared_state(BOOST_THREAD_RV_REF(F) f, BOOST_THREAD_FWD_REF(Fp) c) + : base_type(boost::move(f), boost::forward(c)) + { } + + void launch_continuation() { + this->call(); + } + }; + + ///////////////////////// /// future_executor_continuation_shared_state ///////////////////////// @@ -4445,9 +4485,9 @@ namespace detail { ///////////////////////// template - struct shared_future_async_continuation_shared_state: continuation_shared_state > + struct shared_future_async_continuation_shared_state: continuation_shared_state > { - typedef continuation_shared_state > base_type; + typedef continuation_shared_state > base_type; public: shared_future_async_continuation_shared_state(F f, BOOST_THREAD_FWD_REF(Fp) c) @@ -4456,19 +4496,36 @@ namespace detail { } void launch_continuation() { -#if defined BOOST_THREAD_CONTINUATION_SYNC - this->call(); -#elif defined BOOST_THREAD_FUTURE_BLOCKING +#if defined BOOST_THREAD_FUTURE_BLOCKING boost::lock_guard lk(this->mutex); - this->thr_ = thread(&shared_future_async_continuation_shared_state::run, static_shared_from_this(this)); + this->thr_ = thread(&base_type::run, static_shared_from_this(this)); #else - thread(&shared_future_async_continuation_shared_state::run, static_shared_from_this(this)).detach(); + thread(&base_type::run, static_shared_from_this(this)).detach(); #endif } + }; - ~shared_future_async_continuation_shared_state() {} + ///////////////////////// + /// shared_future_async_continuation_shared_state + ///////////////////////// + + template + struct shared_future_sync_continuation_shared_state: continuation_shared_state > + { + typedef continuation_shared_state > base_type; + + public: + shared_future_sync_continuation_shared_state(F f, BOOST_THREAD_FWD_REF(Fp) c) + : base_type(boost::move(f), boost::forward(c)) + { + } + + void launch_continuation() { + this->call(); + } }; + ///////////////////////// /// shared_future_executor_continuation_shared_state ///////////////////////// @@ -4577,6 +4634,21 @@ namespace detail { return BOOST_THREAD_FUTURE(h); } + //////////////////////////////// + // make_future_sync_continuation_shared_state + //////////////////////////////// + template + BOOST_THREAD_FUTURE + make_future_sync_continuation_shared_state( + boost::unique_lock &lock, BOOST_THREAD_RV_REF(F) f, + BOOST_THREAD_FWD_REF(Fp) c) { + typedef typename decay::type Cont; + shared_ptr > + h(new future_sync_continuation_shared_state(boost::move(f), boost::forward(c))); + h->init(lock); + + return BOOST_THREAD_FUTURE(h); + } //////////////////////////////// // make_future_executor_continuation_shared_state @@ -4628,6 +4700,21 @@ namespace detail { return BOOST_THREAD_FUTURE(h); } //////////////////////////////// + // make_shared_future_sync_continuation_shared_state + //////////////////////////////// + template + BOOST_THREAD_FUTURE + make_shared_future_sync_continuation_shared_state( + boost::unique_lock &lock, F f, + BOOST_THREAD_FWD_REF(Fp) c) { + typedef typename decay::type Cont; + shared_ptr > + h(new shared_future_sync_continuation_shared_state(f, boost::forward(c))); + h->init(lock); + + return BOOST_THREAD_FUTURE(h); + } + //////////////////////////////// // make_shared_future_executor_continuation_shared_state //////////////////////////////// #ifdef BOOST_THREAD_PROVIDES_EXECUTORS @@ -4787,6 +4874,10 @@ namespace detail { return BOOST_THREAD_MAKE_RV_REF((boost::detail::make_future_deferred_continuation_shared_state, future_type>( lock, boost::move(*this), boost::forward(func) ))); + } else if (underlying_cast(policy) & int(launch::sync)) { + return BOOST_THREAD_MAKE_RV_REF((boost::detail::make_future_sync_continuation_shared_state, future_type>( + lock, boost::move(*this), boost::forward(func) + ))); #ifdef BOOST_THREAD_PROVIDES_EXECUTORS } else if (underlying_cast(policy) & int(launch::executor)) { assert(this->future_->get_executor()); @@ -4807,6 +4898,10 @@ namespace detail { return BOOST_THREAD_MAKE_RV_REF((boost::detail::make_future_deferred_continuation_shared_state, future_type>( lock, boost::move(*this), boost::forward(func) ))); + } else if (underlying_cast(policy) & int(launch::sync)) { + return BOOST_THREAD_MAKE_RV_REF((boost::detail::make_future_sync_continuation_shared_state, future_type>( + lock, boost::move(*this), boost::forward(func) + ))); #ifdef BOOST_THREAD_PROVIDES_EXECUTORS } else if (underlying_cast(policy) & int(launch::executor)) { assert(this->future_->get_executor()); @@ -4878,7 +4973,7 @@ namespace detail { lock, boost::move(*this), boost::forward(func) ))); } else { - return BOOST_THREAD_MAKE_RV_REF((boost::detail::make_future_async_continuation_shared_state, future_type>( + return BOOST_THREAD_MAKE_RV_REF((boost::detail::make_future_sync_continuation_shared_state, future_type>( lock, boost::move(*this), boost::forward(func) ))); } @@ -4906,6 +5001,10 @@ namespace detail { return BOOST_THREAD_MAKE_RV_REF((boost::detail::make_shared_future_deferred_continuation_shared_state, future_type>( lock, *this, boost::forward(func) ))); + } else if (underlying_cast(policy) & int(launch::sync)) { + return BOOST_THREAD_MAKE_RV_REF((boost::detail::make_shared_future_sync_continuation_shared_state, future_type>( + lock, *this, boost::forward(func) + ))); #ifdef BOOST_THREAD_PROVIDES_EXECUTORS } else if (underlying_cast(policy) & int(launch::executor)) { typedef executor Ex; @@ -4925,6 +5024,10 @@ namespace detail { return BOOST_THREAD_MAKE_RV_REF((boost::detail::make_shared_future_deferred_continuation_shared_state, future_type>( lock, *this, boost::forward(func) ))); + } else if (underlying_cast(policy) & int(launch::sync)) { + return BOOST_THREAD_MAKE_RV_REF((boost::detail::make_shared_future_sync_continuation_shared_state, future_type>( + lock, *this, boost::forward(func) + ))); #ifdef BOOST_THREAD_PROVIDES_EXECUTORS } else if (underlying_cast(policy) & int(launch::executor)) { typedef executor Ex; @@ -4986,7 +5089,7 @@ namespace detail { lock, *this, boost::forward(func) ))); } else { - return BOOST_THREAD_MAKE_RV_REF((boost::detail::make_shared_future_async_continuation_shared_state, future_type>( + return BOOST_THREAD_MAKE_RV_REF((boost::detail::make_shared_future_sync_continuation_shared_state, future_type>( lock, *this, boost::forward(func) ))); } diff --git a/cpp/BoostParts/boost/thread/futures/launch.hpp b/cpp/BoostParts/boost/thread/futures/launch.hpp index 8eed42cf4d..329f40d8f3 100644 --- a/cpp/BoostParts/boost/thread/futures/launch.hpp +++ b/cpp/BoostParts/boost/thread/futures/launch.hpp @@ -23,6 +23,7 @@ namespace boost executor = 4, #endif inherit = 8, + sync = 16, any = async | deferred } BOOST_SCOPED_ENUM_DECLARE_END(launch) diff --git a/cpp/BoostParts/boost/thread/pthread/condition_variable.hpp b/cpp/BoostParts/boost/thread/pthread/condition_variable.hpp index a603351591..e8378c7d3e 100644 --- a/cpp/BoostParts/boost/thread/pthread/condition_variable.hpp +++ b/cpp/BoostParts/boost/thread/pthread/condition_variable.hpp @@ -336,14 +336,15 @@ namespace boost cv_status::timeout; } + template inline cv_status wait_until( - unique_lock& lk, + lock_type& lock, chrono::time_point tp) { using namespace chrono; nanoseconds d = tp.time_since_epoch(); timespec ts = boost::detail::to_timespec(d); - if (do_wait_until(lk, ts)) return cv_status::no_timeout; + if (do_wait_until(lock, ts)) return cv_status::no_timeout; else return cv_status::timeout; } @@ -391,7 +392,7 @@ namespace boost private: // used by boost::thread::try_join_until template - inline bool do_wait_until( + bool do_wait_until( lock_type& m, struct timespec const &timeout) { diff --git a/cpp/BoostParts/boost/thread/win32/thread_primitives.hpp b/cpp/BoostParts/boost/thread/win32/thread_primitives.hpp index b63503ad52..6d2ca7c2cf 100644 --- a/cpp/BoostParts/boost/thread/win32/thread_primitives.hpp +++ b/cpp/BoostParts/boost/thread/win32/thread_primitives.hpp @@ -156,7 +156,7 @@ namespace boost { struct _SECURITY_ATTRIBUTES; # ifdef BOOST_NO_ANSI_APIS -# if BOOST_USE_WINAPI_VERSION < BOOST_WINAPI_VERSION_VISTA +# if defined(BOOST_USE_WINAPI_VERSION) && ( BOOST_USE_WINAPI_VERSION < BOOST_WINAPI_VERSION_VISTA ) __declspec(dllimport) void* __stdcall CreateMutexW(_SECURITY_ATTRIBUTES*,int,wchar_t const*); __declspec(dllimport) void* __stdcall CreateSemaphoreW(_SECURITY_ATTRIBUTES*,long,long,wchar_t const*); __declspec(dllimport) void* __stdcall CreateEventW(_SECURITY_ATTRIBUTES*,int,int,wchar_t const*); @@ -339,7 +339,7 @@ namespace boost { #if !defined(BOOST_NO_ANSI_APIS) handle const res = win32::CreateEventA(0, type, state, mutex_name); -#elif BOOST_USE_WINAPI_VERSION < BOOST_WINAPI_VERSION_VISTA +#elif defined(BOOST_USE_WINAPI_VERSION) && ( BOOST_USE_WINAPI_VERSION < BOOST_WINAPI_VERSION_VISTA ) handle const res = win32::CreateEventW(0, type, state, mutex_name); #else handle const res = win32::CreateEventExW( @@ -366,7 +366,7 @@ namespace boost #if !defined(BOOST_NO_ANSI_APIS) handle const res=win32::CreateSemaphoreA(0,initial_count,max_count,0); #else -#if BOOST_USE_WINAPI_VERSION < BOOST_WINAPI_VERSION_VISTA +#if defined(BOOST_USE_WINAPI_VERSION) && ( BOOST_USE_WINAPI_VERSION < BOOST_WINAPI_VERSION_VISTA ) handle const res=win32::CreateSemaphoreEx(0,initial_count,max_count,0,0); #else handle const res=win32::CreateSemaphoreExW(0,initial_count,max_count,0,0,semaphore_all_access); diff --git a/cpp/BoostParts/boost/timer/config.hpp b/cpp/BoostParts/boost/timer/config.hpp new file mode 100644 index 0000000000..adf223d3e4 --- /dev/null +++ b/cpp/BoostParts/boost/timer/config.hpp @@ -0,0 +1,53 @@ +// boost/timer/config.hpp -----------------------------------------------------------// + +// Copyright Beman Dawes 2003, 2006, 2011 + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + +// See http://www.boost.org/libs/timer for documentation. + +#ifndef BOOST_TIMER_CONFIG_HPP +#define BOOST_TIMER_CONFIG_HPP + +#include + +#include + +// This header implements separate compilation features as described in +// http://www.boost.org/more/separate_compilation.html + +// enable dynamic or static linking as requested --------------------------------------// + +#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_TIMER_DYN_LINK) +# if defined(BOOST_TIMER_SOURCE) +# define BOOST_TIMER_DECL BOOST_SYMBOL_EXPORT +# else +# define BOOST_TIMER_DECL BOOST_SYMBOL_IMPORT +# endif +#else +# define BOOST_TIMER_DECL +#endif + +// enable automatic library variant selection ----------------------------------------// + +#if !defined(BOOST_TIMER_SOURCE) && !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_TIMER_NO_LIB) +// +// Set the name of our library, this will get undef'ed by auto_link.hpp +// once it's done with it: +// +#define BOOST_LIB_NAME boost_timer +// +// If we're importing code from a dll, then tell auto_link.hpp about it: +// +#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_TIMER_DYN_LINK) +# define BOOST_DYN_LINK +#endif +// +// And include the header that does the work: +// +#include +#endif // auto-linking disabled + +#endif // BOOST_TIMER_CONFIG_HPP + diff --git a/cpp/BoostParts/boost/timer/timer.hpp b/cpp/BoostParts/boost/timer/timer.hpp new file mode 100644 index 0000000000..7801cb11ac --- /dev/null +++ b/cpp/BoostParts/boost/timer/timer.hpp @@ -0,0 +1,132 @@ +// boost/timer/timer.hpp -------------------------------------------------------------// + +// Copyright Beman Dawes 1994-2007, 2011 + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + +#ifndef BOOST_TIMER_TIMER_HPP +#define BOOST_TIMER_TIMER_HPP + +#include + +#include +//#include +#include +#include +#include +#include + +#include // must be the last #include + +# if defined(_MSC_VER) +# pragma warning(push) // Save warning settings +# pragma warning(disable : 4251) // disable warning: class 'std::basic_string<_Elem,_Traits,_Ax>' +# endif // needs to have dll-interface... + +//--------------------------------------------------------------------------------------// + +namespace boost +{ +namespace timer +{ + class cpu_timer; + class auto_cpu_timer; + + typedef boost::int_least64_t nanosecond_type; + + struct cpu_times + { + nanosecond_type wall; + nanosecond_type user; + nanosecond_type system; + + void clear() { wall = user = system = 0LL; } + }; + + const short default_places = 6; + + BOOST_TIMER_DECL + std::string format(const cpu_times& times, short places, const std::string& format); + + BOOST_TIMER_DECL + std::string format(const cpu_times& times, short places = default_places); + +// cpu_timer -------------------------------------------------------------------------// + + class BOOST_TIMER_DECL cpu_timer + { + public: + + // constructor + cpu_timer() BOOST_NOEXCEPT { start(); } + + // observers + bool is_stopped() const BOOST_NOEXCEPT { return m_is_stopped; } + cpu_times elapsed() const BOOST_NOEXCEPT; // does not stop() + std::string format(short places, const std::string& format) const + { return ::boost::timer::format(elapsed(), places, format); } + std::string format(short places = default_places) const + { return ::boost::timer::format(elapsed(), places); } + // actions + void start() BOOST_NOEXCEPT; + void stop() BOOST_NOEXCEPT; + void resume() BOOST_NOEXCEPT; + + private: + cpu_times m_times; + bool m_is_stopped; + }; + +// auto_cpu_timer --------------------------------------------------------------------// + + class BOOST_TIMER_DECL auto_cpu_timer : public cpu_timer + { + public: + + // Explicit defaults for os are not provided to avoid including , which has + // high costs even when the standard streams are not actually used. Explicit defaults + // for format are not provided to avoid order-of-dynamic-initialization issues with a + // std::string. + + explicit auto_cpu_timer(short places = default_places); // #1 + auto_cpu_timer(short places, const std::string& format); // #2 + explicit auto_cpu_timer(const std::string& format); // #3 + auto_cpu_timer(std::ostream& os, short places, + const std::string& format) // #4 + : m_places(places), m_os(&os), m_format(format) + { start(); } + explicit auto_cpu_timer(std::ostream& os, short places = default_places); // #5 + auto_cpu_timer(std::ostream& os, const std::string& format) // #6 + : m_places(default_places), m_os(&os), m_format(format) + { start(); } + + ~auto_cpu_timer(); + + // observers + // not particularly useful to users, but allow testing of constructor + // postconditions and ease specification of other functionality without resorting + // to "for exposition only" private members. + std::ostream& ostream() const { return *m_os; } + short places() const { return m_places; } + const std::string& format_string() const { return m_format; } + + // actions + void report(); + + private: + short m_places; + std::ostream* m_os; // stored as ptr so compiler can generate operator= + std::string m_format; + }; + +} // namespace timer +} // namespace boost + +# if defined(_MSC_VER) +# pragma warning(pop) // restore warning settings. +# endif + +#include // pops abi_prefix.hpp pragmas + +#endif // BOOST_TIMER_TIMER_HPP diff --git a/cpp/BoostParts/boost/type_traits.hpp b/cpp/BoostParts/boost/type_traits.hpp index 57680f89f6..7d651ce28d 100644 --- a/cpp/BoostParts/boost/type_traits.hpp +++ b/cpp/BoostParts/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/cpp/BoostParts/boost/type_traits/add_reference.hpp b/cpp/BoostParts/boost/type_traits/add_reference.hpp index 526f259c87..3c914154ee 100644 --- a/cpp/BoostParts/boost/type_traits/add_reference.hpp +++ b/cpp/BoostParts/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/cpp/BoostParts/boost/type_traits/aligned_storage.hpp b/cpp/BoostParts/boost/type_traits/aligned_storage.hpp index 09f0c6b885..171f5d450b 100644 --- a/cpp/BoostParts/boost/type_traits/aligned_storage.hpp +++ b/cpp/BoostParts/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/cpp/BoostParts/boost/type_traits/common_type.hpp b/cpp/BoostParts/boost/type_traits/common_type.hpp index 5c4303b9ec..c887a897f8 100644 --- a/cpp/BoostParts/boost/type_traits/common_type.hpp +++ b/cpp/BoostParts/boost/type_traits/common_type.hpp @@ -12,6 +12,7 @@ #include #include #include +#include #if defined(BOOST_NO_CXX11_DECLTYPE) #include diff --git a/cpp/BoostParts/boost/type_traits/detail/common_arithmetic_type.hpp b/cpp/BoostParts/boost/type_traits/detail/common_arithmetic_type.hpp index 7211002218..8c091583c5 100644 --- a/cpp/BoostParts/boost/type_traits/detail/common_arithmetic_type.hpp +++ b/cpp/BoostParts/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 @@ template class common_arithmetic_type 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/cpp/BoostParts/boost/type_traits/detail/ice_and.hpp b/cpp/BoostParts/boost/type_traits/detail/ice_and.hpp deleted file mode 100644 index 3ccb03e850..0000000000 --- a/cpp/BoostParts/boost/type_traits/detail/ice_and.hpp +++ /dev/null @@ -1,42 +0,0 @@ -// (C) Copyright John Maddock and Steve Cleary 2000. -// -// Use, modification and distribution are subject to the Boost Software License, -// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt). -// -// See http://www.boost.org/libs/type_traits for most recent version including documentation. - -#ifndef BOOST_TT_DETAIL_ICE_AND_HPP_INCLUDED -#define BOOST_TT_DETAIL_ICE_AND_HPP_INCLUDED - -#include - -// -// This header is deprecated and no longer used by type_traits: -// -#if defined(__GNUC__) || defined(_MSC_VER) -# pragma message("NOTE: Use of this header (ice_and.hpp) is deprecated") -#endif - -namespace boost { -namespace type_traits { - -template -struct ice_and; - -template -struct ice_and -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; - -template <> -struct ice_and -{ - BOOST_STATIC_CONSTANT(bool, value = true); -}; - -} // namespace type_traits -} // namespace boost - -#endif // BOOST_TT_DETAIL_ICE_AND_HPP_INCLUDED diff --git a/cpp/BoostParts/boost/type_traits/detail/ice_eq.hpp b/cpp/BoostParts/boost/type_traits/detail/ice_eq.hpp deleted file mode 100644 index 5908f81512..0000000000 --- a/cpp/BoostParts/boost/type_traits/detail/ice_eq.hpp +++ /dev/null @@ -1,43 +0,0 @@ -// (C) Copyright John Maddock and Steve Cleary 2000. -// Use, modification and distribution are subject to the Boost Software License, -// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt). -// -// See http://www.boost.org/libs/type_traits for most recent version including documentation. - -#ifndef BOOST_TT_DETAIL_ICE_EQ_HPP_INCLUDED -#define BOOST_TT_DETAIL_ICE_EQ_HPP_INCLUDED - -#include - -// -// This header is deprecated and no longer used by type_traits: -// -#if defined(__GNUC__) || defined(_MSC_VER) -# pragma message("NOTE: Use of this header (ice_eq.hpp) is deprecated") -#endif - -namespace boost { -namespace type_traits { - -template -struct ice_eq -{ - BOOST_STATIC_CONSTANT(bool, value = (b1 == b2)); -}; - -template -struct ice_ne -{ - BOOST_STATIC_CONSTANT(bool, value = (b1 != b2)); -}; - -#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION -template bool const ice_eq::value; -template bool const ice_ne::value; -#endif - -} // namespace type_traits -} // namespace boost - -#endif // BOOST_TT_DETAIL_ICE_EQ_HPP_INCLUDED diff --git a/cpp/BoostParts/boost/type_traits/detail/ice_not.hpp b/cpp/BoostParts/boost/type_traits/detail/ice_not.hpp deleted file mode 100644 index e095be9cc1..0000000000 --- a/cpp/BoostParts/boost/type_traits/detail/ice_not.hpp +++ /dev/null @@ -1,38 +0,0 @@ -// (C) Copyright John Maddock and Steve Cleary 2000. -// Use, modification and distribution are subject to the Boost Software License, -// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt). -// -// See http://www.boost.org/libs/type_traits for most recent version including documentation. - -#ifndef BOOST_TT_DETAIL_ICE_NOT_HPP_INCLUDED -#define BOOST_TT_DETAIL_ICE_NOT_HPP_INCLUDED - -#include - -// -// This header is deprecated and no longer used by type_traits: -// -#if defined(__GNUC__) || defined(_MSC_VER) -# pragma message("NOTE: Use of this header (ice_not.hpp) is deprecated") -#endif - -namespace boost { -namespace type_traits { - -template -struct ice_not -{ - BOOST_STATIC_CONSTANT(bool, value = true); -}; - -template <> -struct ice_not -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; - -} // namespace type_traits -} // namespace boost - -#endif // BOOST_TT_DETAIL_ICE_NOT_HPP_INCLUDED diff --git a/cpp/BoostParts/boost/type_traits/detail/ice_or.hpp b/cpp/BoostParts/boost/type_traits/detail/ice_or.hpp deleted file mode 100644 index ea523c808a..0000000000 --- a/cpp/BoostParts/boost/type_traits/detail/ice_or.hpp +++ /dev/null @@ -1,41 +0,0 @@ -// (C) Copyright John Maddock and Steve Cleary 2000. -// Use, modification and distribution are subject to the Boost Software License, -// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt). -// -// See http://www.boost.org/libs/type_traits for most recent version including documentation. - -#ifndef BOOST_TT_DETAIL_ICE_OR_HPP_INCLUDED -#define BOOST_TT_DETAIL_ICE_OR_HPP_INCLUDED - -#include - -// -// This header is deprecated and no longer used by type_traits: -// -#if defined(__GNUC__) || defined(_MSC_VER) -# pragma message("NOTE: Use of this header (ice_or.hpp) is deprecated") -#endif - -namespace boost { -namespace type_traits { - -template -struct ice_or; - -template -struct ice_or -{ - BOOST_STATIC_CONSTANT(bool, value = true); -}; - -template <> -struct ice_or -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; - -} // namespace type_traits -} // namespace boost - -#endif // BOOST_TT_DETAIL_ICE_OR_HPP_INCLUDED diff --git a/cpp/BoostParts/boost/type_traits/detail/mp_defer.hpp b/cpp/BoostParts/boost/type_traits/detail/mp_defer.hpp index 7910e545e1..f3beeb21bb 100644 --- a/cpp/BoostParts/boost/type_traits/detail/mp_defer.hpp +++ b/cpp/BoostParts/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/cpp/BoostParts/boost/type_traits/has_nothrow_assign.hpp b/cpp/BoostParts/boost/type_traits/has_nothrow_assign.hpp index a7312a19e9..65fbeefc39 100644 --- a/cpp/BoostParts/boost/type_traits/has_nothrow_assign.hpp +++ b/cpp/BoostParts/boost/type_traits/has_nothrow_assign.hpp @@ -24,7 +24,7 @@ #include #endif #endif -#if defined(__GNUC__) || defined(__SUNPRO_CC) +#if defined(__GNUC__) || defined(__SUNPRO_CC) || defined(__clang__) #include #include #include diff --git a/cpp/BoostParts/boost/type_traits/has_nothrow_constructor.hpp b/cpp/BoostParts/boost/type_traits/has_nothrow_constructor.hpp index e5af89fe59..a71d42e6e4 100644 --- a/cpp/BoostParts/boost/type_traits/has_nothrow_constructor.hpp +++ b/cpp/BoostParts/boost/type_traits/has_nothrow_constructor.hpp @@ -17,7 +17,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/cpp/BoostParts/boost/type_traits/has_trivial_assign.hpp b/cpp/BoostParts/boost/type_traits/has_trivial_assign.hpp index a5e625d1ae..a434dae726 100644 --- a/cpp/BoostParts/boost/type_traits/has_trivial_assign.hpp +++ b/cpp/BoostParts/boost/type_traits/has_trivial_assign.hpp @@ -13,7 +13,7 @@ #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/cpp/BoostParts/boost/type_traits/has_trivial_destructor.hpp b/cpp/BoostParts/boost/type_traits/has_trivial_destructor.hpp index 763283d78c..9a3a61ff97 100644 --- a/cpp/BoostParts/boost/type_traits/has_trivial_destructor.hpp +++ b/cpp/BoostParts/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/cpp/BoostParts/boost/type_traits/ice.hpp b/cpp/BoostParts/boost/type_traits/ice.hpp deleted file mode 100644 index 134bc4bb76..0000000000 --- a/cpp/BoostParts/boost/type_traits/ice.hpp +++ /dev/null @@ -1,20 +0,0 @@ - -// (C) Copyright John Maddock and Steve Cleary 2000. -// Use, modification and distribution are subject to the Boost Software License, -// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt). -// -// See http://www.boost.org/libs/type_traits for most recent version including documentation. -// -// macros and helpers for working with integral-constant-expressions. - -#ifndef BOOST_TT_ICE_HPP_INCLUDED -#define BOOST_TT_ICE_HPP_INCLUDED - -#include -#include -#include -#include -#include - -#endif // BOOST_TT_ICE_HPP_INCLUDED diff --git a/cpp/BoostParts/boost/type_traits/is_default_constructible.hpp b/cpp/BoostParts/boost/type_traits/is_default_constructible.hpp index 7fd63f8969..0b7d960e7d 100644 --- a/cpp/BoostParts/boost/type_traits/is_default_constructible.hpp +++ b/cpp/BoostParts/boost/type_traits/is_default_constructible.hpp @@ -12,6 +12,10 @@ #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 +32,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/cpp/BoostParts/boost/type_traits/is_nothrow_move_assignable.hpp b/cpp/BoostParts/boost/type_traits/is_nothrow_move_assignable.hpp index 9755430ecf..4fb5bd8a6d 100644 --- a/cpp/BoostParts/boost/type_traits/is_nothrow_move_assignable.hpp +++ b/cpp/BoostParts/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/cpp/BoostParts/boost/type_traits/is_nothrow_move_constructible.hpp b/cpp/BoostParts/boost/type_traits/is_nothrow_move_constructible.hpp index 8f4cee2cf9..4c8f734726 100644 --- a/cpp/BoostParts/boost/type_traits/is_nothrow_move_constructible.hpp +++ b/cpp/BoostParts/boost/type_traits/is_nothrow_move_constructible.hpp @@ -26,7 +26,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/cpp/BoostParts/boost/version.hpp b/cpp/BoostParts/boost/version.hpp index fce02ec7ba..ce6f79f840 100644 --- a/cpp/BoostParts/boost/version.hpp +++ b/cpp/BoostParts/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 106100 // // 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_61" #endif diff --git a/cpp/BoostParts/libs/regex/src/posix_api.cpp b/cpp/BoostParts/libs/regex/src/posix_api.cpp index 3711a9a09c..1531d948a0 100644 --- a/cpp/BoostParts/libs/regex/src/posix_api.cpp +++ b/cpp/BoostParts/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/cpp/BoostParts/libs/regex/src/regex.cpp b/cpp/BoostParts/libs/regex/src/regex.cpp index 03057aac9c..e9e9762748 100644 --- a/cpp/BoostParts/libs/regex/src/regex.cpp +++ b/cpp/BoostParts/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/cpp/BoostParts/libs/serialization/src/archive_exception.cpp b/cpp/BoostParts/libs/serialization/src/archive_exception.cpp index 5ff4b5f374..8fcc6eeb08 100644 --- a/cpp/BoostParts/libs/serialization/src/archive_exception.cpp +++ b/cpp/BoostParts/libs/serialization/src/archive_exception.cpp @@ -17,6 +17,7 @@ #include #define BOOST_ARCHIVE_SOURCE +#include #include namespace boost { diff --git a/cpp/BoostParts/libs/serialization/src/basic_archive.cpp b/cpp/BoostParts/libs/serialization/src/basic_archive.cpp index 52566fa66f..5391021a50 100644 --- a/cpp/BoostParts/libs/serialization/src/basic_archive.cpp +++ b/cpp/BoostParts/libs/serialization/src/basic_archive.cpp @@ -32,6 +32,7 @@ // * required only for pointers - optional for objects #define BOOST_ARCHIVE_SOURCE +#include #include namespace boost { diff --git a/cpp/BoostParts/libs/serialization/src/basic_iarchive.cpp b/cpp/BoostParts/libs/serialization/src/basic_iarchive.cpp index 197cf67690..841fefdd5e 100644 --- a/cpp/BoostParts/libs/serialization/src/basic_iarchive.cpp +++ b/cpp/BoostParts/libs/serialization/src/basic_iarchive.cpp @@ -24,17 +24,18 @@ namespace std{ #endif #include -#include -#include -#include #define BOOST_ARCHIVE_SOURCE // include this to prevent linker errors when the // same modules are marked export and import. #define BOOST_SERIALIZATION_SOURCE +#include -#include +#include +#include +#include +#include #include #include #include diff --git a/cpp/BoostParts/libs/serialization/src/basic_iserializer.cpp b/cpp/BoostParts/libs/serialization/src/basic_iserializer.cpp index 2b273927c2..3898a6a723 100644 --- a/cpp/BoostParts/libs/serialization/src/basic_iserializer.cpp +++ b/cpp/BoostParts/libs/serialization/src/basic_iserializer.cpp @@ -11,6 +11,7 @@ #include // NULL #define BOOST_ARCHIVE_SOURCE +#include #include namespace boost { diff --git a/cpp/BoostParts/libs/serialization/src/basic_oarchive.cpp b/cpp/BoostParts/libs/serialization/src/basic_oarchive.cpp index 18522afa4e..538be310a0 100644 --- a/cpp/BoostParts/libs/serialization/src/basic_oarchive.cpp +++ b/cpp/BoostParts/libs/serialization/src/basic_oarchive.cpp @@ -15,8 +15,6 @@ #include // NULL #include -#include -#include // including this here to work around an ICC in intel 7.0 // normally this would be part of basic_oarchive.hpp below. @@ -24,6 +22,10 @@ // include this to prevent linker errors when the // same modules are marked export and import. #define BOOST_SERIALIZATION_SOURCE +#include +#include +#include +#include #include #include @@ -31,7 +33,6 @@ #include #include #include -#include #ifdef BOOST_MSVC # pragma warning(push) diff --git a/cpp/BoostParts/libs/serialization/src/basic_oserializer.cpp b/cpp/BoostParts/libs/serialization/src/basic_oserializer.cpp index 70b1106b3e..afe08c4bb8 100644 --- a/cpp/BoostParts/libs/serialization/src/basic_oserializer.cpp +++ b/cpp/BoostParts/libs/serialization/src/basic_oserializer.cpp @@ -11,6 +11,7 @@ #include // NULL #define BOOST_ARCHIVE_SOURCE +#include #include namespace boost { diff --git a/cpp/BoostParts/libs/serialization/src/basic_pointer_iserializer.cpp b/cpp/BoostParts/libs/serialization/src/basic_pointer_iserializer.cpp index 6edf4510ce..7cf63f306e 100644 --- a/cpp/BoostParts/libs/serialization/src/basic_pointer_iserializer.cpp +++ b/cpp/BoostParts/libs/serialization/src/basic_pointer_iserializer.cpp @@ -9,6 +9,7 @@ // See http://www.boost.org for updates, documentation, and revision history. #define BOOST_ARCHIVE_SOURCE +#include #include namespace boost { diff --git a/cpp/BoostParts/libs/serialization/src/basic_pointer_oserializer.cpp b/cpp/BoostParts/libs/serialization/src/basic_pointer_oserializer.cpp index a5fc65c1b2..e86f7b78ed 100644 --- a/cpp/BoostParts/libs/serialization/src/basic_pointer_oserializer.cpp +++ b/cpp/BoostParts/libs/serialization/src/basic_pointer_oserializer.cpp @@ -9,6 +9,7 @@ // See http://www.boost.org for updates, documentation, and revision history. #define BOOST_ARCHIVE_SOURCE +#include #include namespace boost { diff --git a/cpp/BoostParts/libs/serialization/src/basic_serializer_map.cpp b/cpp/BoostParts/libs/serialization/src/basic_serializer_map.cpp index fea50a6d30..5b79107728 100644 --- a/cpp/BoostParts/libs/serialization/src/basic_serializer_map.cpp +++ b/cpp/BoostParts/libs/serialization/src/basic_serializer_map.cpp @@ -19,10 +19,10 @@ // include this to prevent linker errors when the // same modules are marked export and import. #define BOOST_SERIALIZATION_SOURCE - -#include +#include #include +#include #include #include diff --git a/cpp/BoostParts/libs/serialization/src/basic_text_iprimitive.cpp b/cpp/BoostParts/libs/serialization/src/basic_text_iprimitive.cpp index c67a9420ba..c0b7f76682 100644 --- a/cpp/BoostParts/libs/serialization/src/basic_text_iprimitive.cpp +++ b/cpp/BoostParts/libs/serialization/src/basic_text_iprimitive.cpp @@ -15,6 +15,7 @@ #include #define BOOST_ARCHIVE_SOURCE +#include #include #include diff --git a/cpp/BoostParts/libs/serialization/src/basic_text_oprimitive.cpp b/cpp/BoostParts/libs/serialization/src/basic_text_oprimitive.cpp index d8d98d6977..601662294e 100644 --- a/cpp/BoostParts/libs/serialization/src/basic_text_oprimitive.cpp +++ b/cpp/BoostParts/libs/serialization/src/basic_text_oprimitive.cpp @@ -15,6 +15,7 @@ #include #define BOOST_ARCHIVE_SOURCE +#include #include #include diff --git a/cpp/BoostParts/libs/serialization/src/basic_text_wiprimitive.cpp b/cpp/BoostParts/libs/serialization/src/basic_text_wiprimitive.cpp index 4797485b0d..28250007bd 100644 --- a/cpp/BoostParts/libs/serialization/src/basic_text_wiprimitive.cpp +++ b/cpp/BoostParts/libs/serialization/src/basic_text_wiprimitive.cpp @@ -8,6 +8,8 @@ // See http://www.boost.org for updates, documentation, and revision history. +#include + #include #ifdef BOOST_NO_STD_WSTREAMBUF @@ -18,9 +20,8 @@ # pragma warning (disable : 4786) // too long name, harmless warning #endif -#include - #define BOOST_WARCHIVE_SOURCE +#include #include #include diff --git a/cpp/BoostParts/libs/serialization/src/basic_text_woprimitive.cpp b/cpp/BoostParts/libs/serialization/src/basic_text_woprimitive.cpp index e13294e70c..6c0caa9793 100644 --- a/cpp/BoostParts/libs/serialization/src/basic_text_woprimitive.cpp +++ b/cpp/BoostParts/libs/serialization/src/basic_text_woprimitive.cpp @@ -8,6 +8,8 @@ // See http://www.boost.org for updates, documentation, and revision history. +#include + #include #ifdef BOOST_NO_STD_WSTREAMBUF @@ -18,9 +20,8 @@ # pragma warning (disable : 4786) // too long name, harmless warning #endif -#include - #define BOOST_WARCHIVE_SOURCE +#include #include #include diff --git a/cpp/BoostParts/libs/serialization/src/basic_xml_archive.cpp b/cpp/BoostParts/libs/serialization/src/basic_xml_archive.cpp index 3d846633c5..23ab1819d1 100644 --- a/cpp/BoostParts/libs/serialization/src/basic_xml_archive.cpp +++ b/cpp/BoostParts/libs/serialization/src/basic_xml_archive.cpp @@ -9,6 +9,7 @@ // See http://www.boost.org for updates, documentation, and revision history. #define BOOST_ARCHIVE_SOURCE +#include #include namespace boost { diff --git a/cpp/BoostParts/libs/serialization/src/basic_xml_grammar.ipp b/cpp/BoostParts/libs/serialization/src/basic_xml_grammar.ipp index c7b500a1ef..6dc6b58cd5 100644 --- a/cpp/BoostParts/libs/serialization/src/basic_xml_grammar.ipp +++ b/cpp/BoostParts/libs/serialization/src/basic_xml_grammar.ipp @@ -179,9 +179,7 @@ bool basic_xml_grammar::my_parse( CharType delimiter ) const { if(is.fail()){ - boost::serialization::throw_exception( - archive_exception(archive_exception::input_stream_error) - ); + return false; } boost::io::ios_flags_saver ifs(is); @@ -455,12 +453,8 @@ void basic_xml_grammar::init(IStream & is){ } template -void basic_xml_grammar::windup(IStream & is){ - if(is.fail() || is.eof()) - return; - // uh-oh - don't throw exception from code called by a destructor ! - // so just ignore any failure. - my_parse(is, ETag); +bool basic_xml_grammar::windup(IStream & is) { + return my_parse(is, ETag); } } // namespace archive diff --git a/cpp/BoostParts/libs/serialization/src/binary_iarchive.cpp b/cpp/BoostParts/libs/serialization/src/binary_iarchive.cpp index c1117e9ee1..41aad8413e 100644 --- a/cpp/BoostParts/libs/serialization/src/binary_iarchive.cpp +++ b/cpp/BoostParts/libs/serialization/src/binary_iarchive.cpp @@ -11,6 +11,7 @@ #include #define BOOST_ARCHIVE_SOURCE +#include #include #include diff --git a/cpp/BoostParts/libs/serialization/src/binary_oarchive.cpp b/cpp/BoostParts/libs/serialization/src/binary_oarchive.cpp index e7ab9040ef..8b86d2cb38 100644 --- a/cpp/BoostParts/libs/serialization/src/binary_oarchive.cpp +++ b/cpp/BoostParts/libs/serialization/src/binary_oarchive.cpp @@ -11,6 +11,7 @@ #include #define BOOST_ARCHIVE_SOURCE +#include #include #include diff --git a/cpp/BoostParts/libs/serialization/src/codecvt_null.cpp b/cpp/BoostParts/libs/serialization/src/codecvt_null.cpp index 86ece4ad94..2f0115bf25 100644 --- a/cpp/BoostParts/libs/serialization/src/codecvt_null.cpp +++ b/cpp/BoostParts/libs/serialization/src/codecvt_null.cpp @@ -8,6 +8,7 @@ // http://www.boost.org/LICENSE_1_0.txt) #define BOOST_WARCHIVE_SOURCE +#include #include // codecvt implementation for passing wchar_t objects to char output diff --git a/cpp/BoostParts/libs/serialization/src/extended_type_info.cpp b/cpp/BoostParts/libs/serialization/src/extended_type_info.cpp index 1c6aa31719..13a60c3e77 100644 --- a/cpp/BoostParts/libs/serialization/src/extended_type_info.cpp +++ b/cpp/BoostParts/libs/serialization/src/extended_type_info.cpp @@ -18,18 +18,22 @@ #include #include // NULL -#include // msvc needs this to suppress warning - #include #if defined(BOOST_NO_STDC_NAMESPACE) namespace std{ using ::strcmp; } #endif +#include // msvc needs this to suppress warning + #include -#include -#include +// it marks our code with proper attributes as being exported when +// we're compiling it while marking it import when just the headers +// is being included. #define BOOST_SERIALIZATION_SOURCE +#include +#include +#include #include #ifdef BOOST_MSVC diff --git a/cpp/BoostParts/libs/serialization/src/extended_type_info_no_rtti.cpp b/cpp/BoostParts/libs/serialization/src/extended_type_info_no_rtti.cpp index 32d0437eea..0a8d2a078c 100644 --- a/cpp/BoostParts/libs/serialization/src/extended_type_info_no_rtti.cpp +++ b/cpp/BoostParts/libs/serialization/src/extended_type_info_no_rtti.cpp @@ -18,7 +18,11 @@ namespace std{ using ::strcmp; } #endif +// it marks our code with proper attributes as being exported when +// we're compiling it while marking it import when just the headers +// is being included. #define BOOST_SERIALIZATION_SOURCE +#include #include #define EXTENDED_TYPE_INFO_NO_RTTI_KEY 2 diff --git a/cpp/BoostParts/libs/serialization/src/extended_type_info_typeid.cpp b/cpp/BoostParts/libs/serialization/src/extended_type_info_typeid.cpp index 36be277bd5..5669dfa772 100644 --- a/cpp/BoostParts/libs/serialization/src/extended_type_info_typeid.cpp +++ b/cpp/BoostParts/libs/serialization/src/extended_type_info_typeid.cpp @@ -17,9 +17,12 @@ #include -#include - +// it marks our code with proper attributes as being exported when +// we're compiling it while marking it import when just the headers +// is being included. #define BOOST_SERIALIZATION_SOURCE +#include +#include #include namespace boost { diff --git a/cpp/BoostParts/libs/serialization/src/polymorphic_iarchive.cpp b/cpp/BoostParts/libs/serialization/src/polymorphic_iarchive.cpp index 5e8c986783..249363b8ea 100644 --- a/cpp/BoostParts/libs/serialization/src/polymorphic_iarchive.cpp +++ b/cpp/BoostParts/libs/serialization/src/polymorphic_iarchive.cpp @@ -13,6 +13,7 @@ #endif #define BOOST_ARCHIVE_SOURCE +#include #include #include diff --git a/cpp/BoostParts/libs/serialization/src/polymorphic_oarchive.cpp b/cpp/BoostParts/libs/serialization/src/polymorphic_oarchive.cpp index b85895e260..f63296be5b 100644 --- a/cpp/BoostParts/libs/serialization/src/polymorphic_oarchive.cpp +++ b/cpp/BoostParts/libs/serialization/src/polymorphic_oarchive.cpp @@ -13,6 +13,7 @@ #endif #define BOOST_ARCHIVE_SOURCE +#include #include #include diff --git a/cpp/BoostParts/libs/serialization/src/singleton.cpp b/cpp/BoostParts/libs/serialization/src/singleton.cpp new file mode 100644 index 0000000000..b8078c1bec --- /dev/null +++ b/cpp/BoostParts/libs/serialization/src/singleton.cpp @@ -0,0 +1,36 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// singleton.cpp +// +// Copyright (c) 201 5 Robert Ramey, Indiana University (garcia@osl.iu.edu) +// 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) +// + +// it marks our code with proper attributes as being exported when +// we're compiling it while marking it import when just the headers +// is being included. +#define BOOST_SERIALIZATION_SOURCE +#include +#include + +namespace boost { +namespace serialization { + +bool & singleton_module::get_lock(){ + static bool lock = false; + return lock; +} + +BOOST_SERIALIZATION_DECL void singleton_module::lock(){ + get_lock() = true; +} +BOOST_SERIALIZATION_DECL void singleton_module::unlock(){ + get_lock() = false; +} +BOOST_SERIALIZATION_DECL bool singleton_module::is_locked() { + return get_lock(); +} + +} // namespace serialization +} // namespace boost diff --git a/cpp/BoostParts/libs/serialization/src/text_iarchive.cpp b/cpp/BoostParts/libs/serialization/src/text_iarchive.cpp index 9520ca2598..dfcff4e149 100644 --- a/cpp/BoostParts/libs/serialization/src/text_iarchive.cpp +++ b/cpp/BoostParts/libs/serialization/src/text_iarchive.cpp @@ -13,6 +13,7 @@ #endif #define BOOST_ARCHIVE_SOURCE +#include #include #include diff --git a/cpp/BoostParts/libs/serialization/src/text_oarchive.cpp b/cpp/BoostParts/libs/serialization/src/text_oarchive.cpp index 19165d62de..ae24a0bf74 100644 --- a/cpp/BoostParts/libs/serialization/src/text_oarchive.cpp +++ b/cpp/BoostParts/libs/serialization/src/text_oarchive.cpp @@ -13,6 +13,7 @@ #endif #define BOOST_ARCHIVE_SOURCE +#include #include #include diff --git a/cpp/BoostParts/libs/serialization/src/text_wiarchive.cpp b/cpp/BoostParts/libs/serialization/src/text_wiarchive.cpp index a0c68a8e3d..6b6e592f74 100644 --- a/cpp/BoostParts/libs/serialization/src/text_wiarchive.cpp +++ b/cpp/BoostParts/libs/serialization/src/text_wiarchive.cpp @@ -15,6 +15,7 @@ #else #define BOOST_WARCHIVE_SOURCE +#include #include #include diff --git a/cpp/BoostParts/libs/serialization/src/text_woarchive.cpp b/cpp/BoostParts/libs/serialization/src/text_woarchive.cpp index 54b4a0df58..46441694ef 100644 --- a/cpp/BoostParts/libs/serialization/src/text_woarchive.cpp +++ b/cpp/BoostParts/libs/serialization/src/text_woarchive.cpp @@ -14,6 +14,7 @@ #else #define BOOST_WARCHIVE_SOURCE +#include #include #include diff --git a/cpp/BoostParts/libs/serialization/src/utf8_codecvt_facet.cpp b/cpp/BoostParts/libs/serialization/src/utf8_codecvt_facet.cpp index 07deada139..c0a64f2912 100644 --- a/cpp/BoostParts/libs/serialization/src/utf8_codecvt_facet.cpp +++ b/cpp/BoostParts/libs/serialization/src/utf8_codecvt_facet.cpp @@ -7,10 +7,13 @@ #ifdef BOOST_NO_STD_WSTREAMBUF #error "wide char i/o not supported on this platform" #else - #ifdef BOOST_NO_CXX11_HDR_CODECVT +// #ifdef BOOST_NO_CXX11_HDR_CODECVT + #if 1 + # define BOOST_ARCHIVE_SOURCE + #include #define BOOST_UTF8_BEGIN_NAMESPACE \ namespace boost { namespace archive { namespace detail { - #define BOOST_UTF8_DECL + #define BOOST_UTF8_DECL BOOST_ARCHIVE_DECL #define BOOST_UTF8_END_NAMESPACE }}} #include #undef BOOST_UTF8_END_NAMESPACE diff --git a/cpp/BoostParts/libs/serialization/src/void_cast.cpp b/cpp/BoostParts/libs/serialization/src/void_cast.cpp index 8ea5595e48..9009993326 100644 --- a/cpp/BoostParts/libs/serialization/src/void_cast.cpp +++ b/cpp/BoostParts/libs/serialization/src/void_cast.cpp @@ -13,21 +13,24 @@ # pragma warning (disable : 4786) // too long name, harmless warning #endif -#include +// STL +#include +#include +#include #include // NULL #ifdef BOOST_SERIALIZATION_LOG #include #endif -// STL -#include -#include -#include +// BOOST +#include #include -// BOOST #define BOOST_SERIALIZATION_SOURCE #include +// it marks our code with proper attributes as being exported when +// we're compiling it while marking it import when just the headers +// is being included. #include #include #include diff --git a/cpp/BoostParts/libs/serialization/src/xml_archive_exception.cpp b/cpp/BoostParts/libs/serialization/src/xml_archive_exception.cpp index f4bf8960b1..f4ca98c086 100644 --- a/cpp/BoostParts/libs/serialization/src/xml_archive_exception.cpp +++ b/cpp/BoostParts/libs/serialization/src/xml_archive_exception.cpp @@ -14,10 +14,12 @@ #include -#include #include +#include + #define BOOST_ARCHIVE_SOURCE +#include #include namespace boost { @@ -35,13 +37,15 @@ xml_archive_exception::xml_archive_exception( case xml_archive_parsing_error: archive_exception::append(0, "unrecognized XML syntax"); break; - case xml_archive_tag_mismatch: - archive_exception::append(0, "XML start/end tag mismatch"); + case xml_archive_tag_mismatch:{ + unsigned int l; + l = archive_exception::append(0, "XML start/end tag mismatch"); if(NULL != e1){ - archive_exception::append(0, " - "); - archive_exception::append(0, e1); + l = archive_exception::append(l, " - "); + archive_exception::append(l, e1); } break; + } case xml_archive_tag_name_error: archive_exception::append(0, "Invalid XML tag name"); break; diff --git a/cpp/BoostParts/libs/serialization/src/xml_grammar.cpp b/cpp/BoostParts/libs/serialization/src/xml_grammar.cpp index 05904f42f3..ae48f70dec 100644 --- a/cpp/BoostParts/libs/serialization/src/xml_grammar.cpp +++ b/cpp/BoostParts/libs/serialization/src/xml_grammar.cpp @@ -12,13 +12,14 @@ # pragma warning (disable : 4786) // too long name, harmless warning #endif +#include + #define BOOST_ARCHIVE_SOURCE +#include #include using namespace boost::spirit::classic; -#include - // fixup for borland // The following code will be put into Boost.Config in a later revision #if ! defined(__SGI_STL_PORT) \ diff --git a/cpp/BoostParts/libs/serialization/src/xml_iarchive.cpp b/cpp/BoostParts/libs/serialization/src/xml_iarchive.cpp index 4fe65bad08..0a19a8e8e6 100644 --- a/cpp/BoostParts/libs/serialization/src/xml_iarchive.cpp +++ b/cpp/BoostParts/libs/serialization/src/xml_iarchive.cpp @@ -13,10 +13,7 @@ #endif #define BOOST_ARCHIVE_SOURCE - -#include -#include - +#include #include #include diff --git a/cpp/BoostParts/libs/serialization/src/xml_oarchive.cpp b/cpp/BoostParts/libs/serialization/src/xml_oarchive.cpp index 88bcdd652b..c238845d63 100644 --- a/cpp/BoostParts/libs/serialization/src/xml_oarchive.cpp +++ b/cpp/BoostParts/libs/serialization/src/xml_oarchive.cpp @@ -13,6 +13,7 @@ #endif #define BOOST_ARCHIVE_SOURCE +#include #include #include diff --git a/cpp/BoostParts/libs/serialization/src/xml_wgrammar.cpp b/cpp/BoostParts/libs/serialization/src/xml_wgrammar.cpp index d3dd844d53..7c053e8098 100644 --- a/cpp/BoostParts/libs/serialization/src/xml_wgrammar.cpp +++ b/cpp/BoostParts/libs/serialization/src/xml_wgrammar.cpp @@ -15,12 +15,12 @@ #else #define BOOST_WARCHIVE_SOURCE +#include #include using namespace boost::spirit::classic; // fixup for RogueWave -#include #if ! defined(__SGI_STL_PORT) \ && defined(BOOST_RWSTD_VER) && BOOST_RWSTD_VER<=0x020101 #include diff --git a/cpp/BoostParts/libs/serialization/src/xml_wiarchive.cpp b/cpp/BoostParts/libs/serialization/src/xml_wiarchive.cpp index 704ddb0750..8c60abf733 100644 --- a/cpp/BoostParts/libs/serialization/src/xml_wiarchive.cpp +++ b/cpp/BoostParts/libs/serialization/src/xml_wiarchive.cpp @@ -8,19 +8,17 @@ // See http://www.boost.org for updates, documentation, and revision history. +#if (defined _MSC_VER) && (_MSC_VER == 1200) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + #include #ifdef BOOST_NO_STD_WSTREAMBUF #error "wide char i/o not supported on this platform" #else -#include - -#if (defined _MSC_VER) && (_MSC_VER == 1200) -# pragma warning (disable : 4786) // too long name, harmless warning -#endif - #define BOOST_WARCHIVE_SOURCE - +#include #include #include diff --git a/cpp/BoostParts/libs/serialization/src/xml_woarchive.cpp b/cpp/BoostParts/libs/serialization/src/xml_woarchive.cpp deleted file mode 100644 index e71daaf6fd..0000000000 --- a/cpp/BoostParts/libs/serialization/src/xml_woarchive.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 -// xml_woarchive.cpp: - -// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . -// 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 for updates, documentation, and revision history. - -#include -#ifdef BOOST_NO_STD_WSTREAMBUF -#error "wide char i/o not supported on this platform" -#else - -#define BOOST_WARCHIVE_SOURCE -#include -#include - -// explicitly instantiate for this type of text stream -#include -#include -#include - -namespace boost { -namespace archive { - -template class detail::archive_serializer_map; -template class basic_xml_oarchive ; -template class xml_woarchive_impl ; - -} // namespace archive -} // namespace boost - -#endif // BOOST_NO_STD_WSTREAMBUF diff --git a/cpp/BoostParts/libs/thread/src/pthread/once.cpp b/cpp/BoostParts/libs/thread/src/pthread/once.cpp index 5292adfecb..d73acb7056 100644 --- a/cpp/BoostParts/libs/thread/src/pthread/once.cpp +++ b/cpp/BoostParts/libs/thread/src/pthread/once.cpp @@ -42,6 +42,7 @@ namespace boost } } +#if defined BOOST_THREAD_PATCH const pthread_once_t pthread_once_init_value=PTHREAD_ONCE_INIT; struct BOOST_THREAD_DECL delete_epoch_tss_key_on_dlclose_t { @@ -52,11 +53,15 @@ namespace boost { if(memcmp(&epoch_tss_key_flag, &pthread_once_init_value, sizeof(pthread_once_t))) { + void* data = (void*)pthread_getspecific(epoch_tss_key); + if (data) + delete_epoch_tss_data(data); pthread_key_delete(epoch_tss_key); } } }; delete_epoch_tss_key_on_dlclose_t delete_epoch_tss_key_on_dlclose; +#endif } uintmax_atomic_t& get_once_per_thread_epoch() diff --git a/cpp/BoostParts/libs/thread/src/pthread/thread.cpp b/cpp/BoostParts/libs/thread/src/pthread/thread.cpp index 969e58cc5d..989cd064d1 100644 --- a/cpp/BoostParts/libs/thread/src/pthread/thread.cpp +++ b/cpp/BoostParts/libs/thread/src/pthread/thread.cpp @@ -115,6 +115,7 @@ namespace boost } } +#if defined BOOST_THREAD_PATCH struct delete_current_thread_tls_key_on_dlclose_t { delete_current_thread_tls_key_on_dlclose_t() @@ -125,12 +126,15 @@ namespace boost const boost::once_flag uninitialized = BOOST_ONCE_INIT; if (memcmp(¤t_thread_tls_init_flag, &uninitialized, sizeof(boost::once_flag))) { + void* data = pthread_getspecific(current_thread_tls_key); + if (data) + tls_destructor(data); pthread_key_delete(current_thread_tls_key); } } }; delete_current_thread_tls_key_on_dlclose_t delete_current_thread_tls_key_on_dlclose; - +#endif void create_current_thread_tls_key() { BOOST_VERIFY(!pthread_key_create(¤t_thread_tls_key,&tls_destructor)); diff --git a/cpp/BoostParts/libs/thread/src/win32/thread.cpp b/cpp/BoostParts/libs/thread/src/win32/thread.cpp index 972b73105f..886e5d170e 100644 --- a/cpp/BoostParts/libs/thread/src/win32/thread.cpp +++ b/cpp/BoostParts/libs/thread/src/win32/thread.cpp @@ -24,6 +24,7 @@ #include #if defined BOOST_THREAD_USES_DATETIME #include +#include #endif #include #include @@ -467,7 +468,7 @@ namespace boost #if defined BOOST_THREAD_USES_DATETIME bool thread::timed_join(boost::system_time const& wait_until) { - return do_try_join_until(get_milliseconds_until(wait_until)); + return do_try_join_until(boost::detail::get_milliseconds_until(wait_until)); } #endif bool thread::do_try_join_until_noexcept(uintmax_t milli, bool& res) @@ -529,7 +530,7 @@ namespace boost { // a bit too strict: Windows XP with SP3 would be sufficient #if BOOST_PLAT_WINDOWS_RUNTIME \ - || ( BOOST_USE_WINAPI_VERSION <= BOOST_WINAPI_VERSION_WINXP ) \ + || ( defined(BOOST_USE_WINAPI_VERSION) && ( BOOST_USE_WINAPI_VERSION <= BOOST_WINAPI_VERSION_WINXP ) ) \ || ( ( defined(__MINGW32__) && !defined(__MINGW64__) ) && _WIN32_WINNT < 0x0600) return 0; #else diff --git a/cpp/BoostParts/libs/timer/src/auto_timers_construction.cpp b/cpp/BoostParts/libs/timer/src/auto_timers_construction.cpp new file mode 100644 index 0000000000..b23b54674f --- /dev/null +++ b/cpp/BoostParts/libs/timer/src/auto_timers_construction.cpp @@ -0,0 +1,46 @@ +// boost auto_timers_construction.cpp ------------------------------------------------// + +// Copyright Beman Dawes 2007, 2011 + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt) + +// See http://www.boost.org/libs/timer for documentation. + +//--------------------------------------------------------------------------------------// + +// These constructors are in a separate file so that this translation unit will +// not be linked in except when one of the constructors is actually used. This +// is important since header is required, and it incurs the cost of +// the standard stream objects even if they are not used. + +//--------------------------------------------------------------------------------------// + +// define BOOST_TIMER_SOURCE so that knows +// the library is being built (possibly exporting rather than importing code) +#define BOOST_TIMER_SOURCE + +#include +#include + +namespace +{ + // CAUTION: must be identical to same constant in cpu_timer.cpp + const std::string default_fmt(" %ws wall, %us user + %ss system = %ts CPU (%p%)\n"); +} + +namespace boost +{ + namespace timer + { + auto_cpu_timer::auto_cpu_timer(short places) // #1 + : m_places(places), m_os(&std::cout), m_format(default_fmt) { start(); } + + auto_cpu_timer::auto_cpu_timer(short places, const std::string& format) // #2 + : m_places(places), m_os(&std::cout), m_format(format) { start(); } + + auto_cpu_timer::auto_cpu_timer(const std::string& format) // #3 + : m_places(default_places), m_os(&std::cout), m_format(format) { start(); } + + } // namespace timer +} // namespace boost diff --git a/cpp/BoostParts/libs/timer/src/cpu_timer.cpp b/cpp/BoostParts/libs/timer/src/cpu_timer.cpp new file mode 100644 index 0000000000..49a61746c0 --- /dev/null +++ b/cpp/BoostParts/libs/timer/src/cpu_timer.cpp @@ -0,0 +1,261 @@ +// boost cpu_timer.cpp ---------------------------------------------------------------// + +// Copyright Beman Dawes 1994-2006, 2011 + +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// See http://www.boost.org/libs/timer for documentation. + +//--------------------------------------------------------------------------------------// + +// define BOOST_TIMER_SOURCE so that knows +// the library is being built (possibly exporting rather than importing code) +#define BOOST_TIMER_SOURCE + +#include +#include +#include +#include +#include +#include +#include +#include + +# if defined(BOOST_WINDOWS_API) +# include +# elif defined(BOOST_POSIX_API) +# include +# include +# else +# error unknown API +# endif + +using boost::timer::nanosecond_type; +using boost::timer::cpu_times; +using boost::system::error_code; + +namespace +{ + + void show_time(const cpu_times& times, + std::ostream& os, const std::string& fmt, short places) + // NOTE WELL: Will truncate least-significant digits to LDBL_DIG, which may + // be as low as 10, although will be 15 for many common platforms. + { + if (places > 9) + places = 9; + else if (places < 0) + places = boost::timer::default_places; + + boost::io::ios_flags_saver ifs(os); + boost::io::ios_precision_saver ips(os); + os.setf(std::ios_base::fixed, std::ios_base::floatfield); + os.precision(places); + + const double sec = 1000000000.0L; + nanosecond_type total = times.system + times.user; + double wall_sec = static_cast(times.wall) / sec; + double total_sec = static_cast(total) / sec; + + for (const char* format = fmt.c_str(); *format; ++format) + { + if (*format != '%' || !*(format+1) || !std::strchr("wustp", *(format+1))) + os << *format; // anything except % followed by a valid format character + // gets sent to the output stream + else + { + ++format; + switch (*format) + { + case 'w': + os << wall_sec; + break; + case 'u': + os << static_cast(times.user) / sec; + break; + case 's': + os << static_cast(times.system) / sec; + break; + case 't': + os << total_sec; + break; + case 'p': + os.precision(1); + if (wall_sec > 0.001L && total_sec > 0.001L) + os << (total_sec/wall_sec) * 100.0; + else + os << "n/a"; + os.precision(places); + break; + } + } + } + } + +# if defined(BOOST_POSIX_API) + boost::int_least64_t tick_factor() // multiplier to convert ticks + // to nanoseconds; -1 if unknown + { + static boost::int_least64_t tick_factor = 0; + if (!tick_factor) + { + if ((tick_factor = ::sysconf(_SC_CLK_TCK)) <= 0) + tick_factor = -1; + else + { + assert(tick_factor <= 1000000000LL); // logic doesn't handle large ticks + tick_factor = 1000000000LL / tick_factor; // compute factor + if (!tick_factor) + tick_factor = -1; + } + } + return tick_factor; + } +# endif + + void get_cpu_times(boost::timer::cpu_times& current) + { + boost::chrono::duration + x (boost::chrono::high_resolution_clock::now().time_since_epoch()); + current.wall = x.count(); + +# if defined(BOOST_WINDOWS_API) + + FILETIME creation, exit; + if (::GetProcessTimes(::GetCurrentProcess(), &creation, &exit, + (LPFILETIME)¤t.system, (LPFILETIME)¤t.user)) + { + current.user *= 100; // Windows uses 100 nanosecond ticks + current.system *= 100; + } + else + { + current.system = current.user = boost::timer::nanosecond_type(-1); + } +# else + tms tm; + clock_t c = ::times(&tm); + if (c == static_cast(-1)) // error + { + current.system = current.user = boost::timer::nanosecond_type(-1); + } + else + { + current.system = boost::timer::nanosecond_type(tm.tms_stime + tm.tms_cstime); + current.user = boost::timer::nanosecond_type(tm.tms_utime + tm.tms_cutime); + boost::int_least64_t factor; + if ((factor = tick_factor()) != -1) + { + current.user *= factor; + current.system *= factor; + } + else + { + current.user = current.system = boost::timer::nanosecond_type(-1); + } + } +# endif + } + + // CAUTION: must be identical to same constant in auto_timers_construction.cpp + const std::string default_fmt(" %ws wall, %us user + %ss system = %ts CPU (%p%)\n"); + +} // unnamed namespace + +namespace boost +{ + namespace timer + { + // format ------------------------------------------------------------------------// + + BOOST_TIMER_DECL + std::string format(const cpu_times& times, short places, const std::string& fmt) + { + std::stringstream ss; + ss.exceptions(std::ios_base::badbit | std::ios_base::failbit); + show_time(times, ss, fmt, places); + return ss.str(); + } + + BOOST_TIMER_DECL + std::string format(const cpu_times& times, short places) + { + return format(times, places, default_fmt); + } + + // cpu_timer ---------------------------------------------------------------------// + + void cpu_timer::start() BOOST_NOEXCEPT + { + m_is_stopped = false; + get_cpu_times(m_times); + } + + void cpu_timer::stop() BOOST_NOEXCEPT + { + if (is_stopped()) + return; + m_is_stopped = true; + + cpu_times current; + get_cpu_times(current); + m_times.wall = (current.wall - m_times.wall); + m_times.user = (current.user - m_times.user); + m_times.system = (current.system - m_times.system); + } + + cpu_times cpu_timer::elapsed() const BOOST_NOEXCEPT + { + if (is_stopped()) + return m_times; + cpu_times current; + get_cpu_times(current); + current.wall -= m_times.wall; + current.user -= m_times.user; + current.system -= m_times.system; + return current; + } + + void cpu_timer::resume() BOOST_NOEXCEPT + { + if (is_stopped()) + { + cpu_times current (m_times); + start(); + m_times.wall -= current.wall; + m_times.user -= current.user; + m_times.system -= current.system; + } + } + + // auto_cpu_timer ----------------------------------------------------------------// + + auto_cpu_timer::auto_cpu_timer(std::ostream& os, short places) // #5 + : m_places(places), m_os(&os), m_format(default_fmt) + { + start(); + } + + void auto_cpu_timer::report() + { + show_time(elapsed(), ostream(), format_string(), places()); + } + + auto_cpu_timer::~auto_cpu_timer() + { + if (!is_stopped()) + { + stop(); // the sooner we stop(), the better + try + { + report(); + } + catch (...) // eat any exceptions + { + } + } + } + + } // namespace timer +} // namespace boost