diff options
| author | Tobias Markmann <tm@ayena.de> | 2014-10-19 20:22:58 (GMT) |
|---|---|---|
| committer | Tobias Markmann <tm@ayena.de> | 2014-10-20 13:49:33 (GMT) |
| commit | 6b22dfcf59474dd016a0355a3102a1dd3692d92c (patch) | |
| tree | 2b1fd33be433a91e81fee84fdc2bf1b52575d934 /3rdParty/Boost/src/boost/variant | |
| parent | 38b0cb785fea8eae5e48fae56440695fdfd10ee1 (diff) | |
| download | swift-contrib-6b22dfcf59474dd016a0355a3102a1dd3692d92c.zip swift-contrib-6b22dfcf59474dd016a0355a3102a1dd3692d92c.tar.bz2 | |
Update Boost in 3rdParty to version 1.56.0.
This updates Boost in our 3rdParty directory to version 1.56.0.
Updated our update.sh script to stop on error.
Changed error reporting in SwiftTools/CrashReporter.cpp to SWIFT_LOG due to
missing include of <iostream> with newer Boost.
Change-Id: I4b35c77de951333979a524097f35f5f83d325edc
Diffstat (limited to '3rdParty/Boost/src/boost/variant')
30 files changed, 913 insertions, 896 deletions
diff --git a/3rdParty/Boost/src/boost/variant/bad_visit.hpp b/3rdParty/Boost/src/boost/variant/bad_visit.hpp index ca53940..e07657e 100644 --- a/3rdParty/Boost/src/boost/variant/bad_visit.hpp +++ b/3rdParty/Boost/src/boost/variant/bad_visit.hpp @@ -29,5 +29,5 @@ struct bad_visit public: // std::exception interface - virtual const char * what() const throw() + virtual const char * what() const BOOST_NOEXCEPT_OR_NOTHROW { return "boost::bad_visit: " diff --git a/3rdParty/Boost/src/boost/variant/detail/apply_visitor_binary.hpp b/3rdParty/Boost/src/boost/variant/detail/apply_visitor_binary.hpp index f1c1fb6..5cc9430 100644 --- a/3rdParty/Boost/src/boost/variant/detail/apply_visitor_binary.hpp +++ b/3rdParty/Boost/src/boost/variant/detail/apply_visitor_binary.hpp @@ -53,5 +53,5 @@ private: // representation public: // structors - apply_visitor_binary_invoke(Visitor& visitor, Value1& value1) + apply_visitor_binary_invoke(Visitor& visitor, Value1& value1) BOOST_NOEXCEPT : visitor_(visitor) , value1_(value1) @@ -88,5 +88,5 @@ private: // representation public: // structors - apply_visitor_binary_unwrap(Visitor& visitor, Visitable2& visitable2) + apply_visitor_binary_unwrap(Visitor& visitor, Visitable2& visitable2) BOOST_NOEXCEPT : visitor_(visitor) , visitable2_(visitable2) @@ -157,6 +157,4 @@ apply_visitor( // -#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) - template <typename Visitor, typename Visitable1, typename Visitable2> inline @@ -176,6 +174,4 @@ apply_visitor( } -#endif // MSVC7 and below exclusion - } // namespace boost diff --git a/3rdParty/Boost/src/boost/variant/detail/apply_visitor_delayed.hpp b/3rdParty/Boost/src/boost/variant/detail/apply_visitor_delayed.hpp index 5f5642b..034b39b 100644 --- a/3rdParty/Boost/src/boost/variant/detail/apply_visitor_delayed.hpp +++ b/3rdParty/Boost/src/boost/variant/detail/apply_visitor_delayed.hpp @@ -50,5 +50,5 @@ private: // representation public: // structors - explicit apply_visitor_delayed_t(Visitor& visitor) + explicit apply_visitor_delayed_t(Visitor& visitor) BOOST_NOEXCEPT : visitor_(visitor) { diff --git a/3rdParty/Boost/src/boost/variant/detail/apply_visitor_unary.hpp b/3rdParty/Boost/src/boost/variant/detail/apply_visitor_unary.hpp index 64199d8..5c28d32 100644 --- a/3rdParty/Boost/src/boost/variant/detail/apply_visitor_unary.hpp +++ b/3rdParty/Boost/src/boost/variant/detail/apply_visitor_unary.hpp @@ -67,6 +67,4 @@ apply_visitor(Visitor& visitor, Visitable& visitable) // -#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) - template <typename Visitor, typename Visitable> inline @@ -77,6 +75,4 @@ apply_visitor(const Visitor& visitor, Visitable& visitable) } -#endif // MSVC7 and below exclusion - } // namespace boost diff --git a/3rdParty/Boost/src/boost/variant/detail/backup_holder.hpp b/3rdParty/Boost/src/boost/variant/detail/backup_holder.hpp index ed112b8..1ccf160 100644 --- a/3rdParty/Boost/src/boost/variant/detail/backup_holder.hpp +++ b/3rdParty/Boost/src/boost/variant/detail/backup_holder.hpp @@ -14,4 +14,5 @@ #define BOOST_VARIANT_DETAIL_BACKUP_HOLDER_HPP +#include "boost/config.hpp" #include "boost/assert.hpp" @@ -28,10 +29,10 @@ private: // representation public: // structors - ~backup_holder() + ~backup_holder() BOOST_NOEXCEPT { delete backup_; } - explicit backup_holder(T* backup) + explicit backup_holder(T* backup) BOOST_NOEXCEPT : backup_(backup) { @@ -54,5 +55,5 @@ public: // modifiers } - void swap(backup_holder& rhs) + void swap(backup_holder& rhs) BOOST_NOEXCEPT { T* tmp = rhs.backup_; @@ -63,10 +64,10 @@ public: // modifiers public: // queries - T& get() + T& get() BOOST_NOEXCEPT { return *backup_; } - const T& get() const + const T& get() const BOOST_NOEXCEPT { return *backup_; @@ -84,5 +85,5 @@ backup_holder<T>::backup_holder(const backup_holder&) template <typename T> -void swap(backup_holder<T>& lhs, backup_holder<T>& rhs) +void swap(backup_holder<T>& lhs, backup_holder<T>& rhs) BOOST_NOEXCEPT { lhs.swap(rhs); diff --git a/3rdParty/Boost/src/boost/variant/detail/bool_trait_def.hpp b/3rdParty/Boost/src/boost/variant/detail/bool_trait_def.hpp deleted file mode 100644 index 823a79a..0000000 --- a/3rdParty/Boost/src/boost/variant/detail/bool_trait_def.hpp +++ /dev/null @@ -1,30 +0,0 @@ -//----------------------------------------------------------------------------- -// boost/variant/detail/bool_trait_def.hpp header file -// See http://www.boost.org for updates, documentation, and revision history. -//----------------------------------------------------------------------------- -// -// Copyright (c) 2003 -// Eric Friedman -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -// Needed until move-related traits incorporated into type_traits library. -// no include guards, the header is intended for multiple inclusion! - -// should be the last #include -#include "boost/type_traits/detail/bool_trait_def.hpp" - -#define BOOST_VARIANT_TT_AUX_BOOL_TRAIT_DEF1(trait,T,C) \ -template< typename T > struct trait \ - BOOST_TT_AUX_BOOL_C_BASE(C) \ -{ \ - BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \ - BOOST_MPL_AUX_LAMBDA_SUPPORT(1,trait,(T)) \ -}; \ -/**/ - -#define BOOST_VARIANT_TT_AUX_TRAIT_SUFFIX(arity, name) \ -BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(arity, name) \ -/**/ diff --git a/3rdParty/Boost/src/boost/variant/detail/bool_trait_undef.hpp b/3rdParty/Boost/src/boost/variant/detail/bool_trait_undef.hpp deleted file mode 100644 index 9b8fb54..0000000 --- a/3rdParty/Boost/src/boost/variant/detail/bool_trait_undef.hpp +++ /dev/null @@ -1,21 +0,0 @@ -//----------------------------------------------------------------------------- -// boost/variant/detail/bool_trait_undef.hpp header file -// See http://www.boost.org for updates, documentation, and revision history. -//----------------------------------------------------------------------------- -// -// Copyright (c) 2003 -// Eric Friedman -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -// Needed until move-related traits incorporated into type_traits library. -// no include guards, the header is intended for multiple inclusion! - -// should be the last #include -#include "boost/type_traits/detail/bool_trait_undef.hpp" - - -#undef BOOST_VARIANT_TT_AUX_BOOL_TRAIT_DEF1 -#undef BOOST_VARIANT_TT_AUX_TRAIT_SUFFIX diff --git a/3rdParty/Boost/src/boost/variant/detail/cast_storage.hpp b/3rdParty/Boost/src/boost/variant/detail/cast_storage.hpp index f23f174..24feed6 100644 --- a/3rdParty/Boost/src/boost/variant/detail/cast_storage.hpp +++ b/3rdParty/Boost/src/boost/variant/detail/cast_storage.hpp @@ -26,8 +26,5 @@ namespace detail { namespace variant { template <typename T> -inline T& cast_storage( - void* storage - BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(T) - ) +inline T& cast_storage(void* storage) { return *static_cast<T*>(storage); @@ -35,8 +32,5 @@ inline T& cast_storage( template <typename T> -inline const T& cast_storage( - const void* storage - BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(T) - ) +inline const T& cast_storage(const void* storage) { return *static_cast<const T*>(storage); diff --git a/3rdParty/Boost/src/boost/variant/detail/config.hpp b/3rdParty/Boost/src/boost/variant/detail/config.hpp index eb18201..84564a4 100644 --- a/3rdParty/Boost/src/boost/variant/detail/config.hpp +++ b/3rdParty/Boost/src/boost/variant/detail/config.hpp @@ -22,5 +22,4 @@ #if BOOST_WORKAROUND(__MWERKS__, <= 0x3201) \ || BOOST_WORKAROUND(BOOST_INTEL, <= 700) \ - || BOOST_WORKAROUND(BOOST_MSVC, <= 1300) \ && !defined(BOOST_VARIANT_AUX_BROKEN_CONSTRUCTOR_TEMPLATE_ORDERING) # define BOOST_VARIANT_AUX_BROKEN_CONSTRUCTOR_TEMPLATE_ORDERING diff --git a/3rdParty/Boost/src/boost/variant/detail/enable_recursive.hpp b/3rdParty/Boost/src/boost/variant/detail/enable_recursive.hpp index 76bd7c7..a974b4f 100644 --- a/3rdParty/Boost/src/boost/variant/detail/enable_recursive.hpp +++ b/3rdParty/Boost/src/boost/variant/detail/enable_recursive.hpp @@ -79,5 +79,4 @@ public: // -#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) template <typename T, typename RecursiveVariant, typename NoWrapper> @@ -113,32 +112,4 @@ public: // metafunction result }; -#else // defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) - -template <typename T, typename RecursiveVariant, typename NoWrapper> -struct enable_recursive -{ -private: // helpers, for metafunction result (below) - - typedef typename BOOST_VARIANT_AUX_ENABLE_RECURSIVE_IMPL( - T, RecursiveVariant, ::boost::recursive_variant_ - )::type t_; - -public: // metafunction result - - // [Wrap with recursive_wrapper only if rebind really changed something:] - typedef typename mpl::if_< - mpl::or_< - NoWrapper - , is_same< t_,T > - , is_reference<t_> - , is_pointer<t_> - > - , t_ - , boost::recursive_wrapper<t_> - >::type type; - -}; - -#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION workaround /////////////////////////////////////////////////////////////////////////////// diff --git a/3rdParty/Boost/src/boost/variant/detail/enable_recursive_fwd.hpp b/3rdParty/Boost/src/boost/variant/detail/enable_recursive_fwd.hpp index 3336c1f..39a6b71 100644 --- a/3rdParty/Boost/src/boost/variant/detail/enable_recursive_fwd.hpp +++ b/3rdParty/Boost/src/boost/variant/detail/enable_recursive_fwd.hpp @@ -18,9 +18,5 @@ #include "boost/mpl/bool_fwd.hpp" -#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) # include "boost/mpl/bool.hpp" -#else -# include "boost/type_traits/is_base_and_derived.hpp" -#endif namespace boost { @@ -33,5 +29,4 @@ namespace detail { namespace variant { // -#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) template <typename T> @@ -41,18 +36,4 @@ struct recursive_flag }; -#else // defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) - -struct recursive_flag_tag -{ -}; - -template <typename T> -struct recursive_flag - : recursive_flag_tag -{ - typedef T type; -}; - -#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION workaround /////////////////////////////////////////////////////////////////////////////// @@ -62,5 +43,4 @@ struct recursive_flag // -#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) template <typename T> @@ -76,13 +56,4 @@ struct is_recursive_flag< recursive_flag<T> > }; -#else // defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) - -template <typename T> -struct is_recursive_flag - : is_base_and_derived< recursive_flag_tag,T > -{ -}; - -#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION workaround /////////////////////////////////////////////////////////////////////////////// diff --git a/3rdParty/Boost/src/boost/variant/detail/forced_return.hpp b/3rdParty/Boost/src/boost/variant/detail/forced_return.hpp index cc1f25b..522b796 100644 --- a/3rdParty/Boost/src/boost/variant/detail/forced_return.hpp +++ b/3rdParty/Boost/src/boost/variant/detail/forced_return.hpp @@ -18,8 +18,4 @@ #include "boost/assert.hpp" -#if !defined(BOOST_MSVC) && !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) -# include "boost/type_traits/remove_reference.hpp" -#endif - namespace boost { namespace detail { namespace variant { @@ -33,5 +29,4 @@ namespace detail { namespace variant { #if !defined(BOOST_MSVC) \ - && !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ && !defined(BOOST_NO_VOID_RETURNS) @@ -39,16 +34,15 @@ namespace detail { namespace variant { template <typename T> -inline T forced_return( BOOST_EXPLICIT_TEMPLATE_TYPE(T) ) +inline T forced_return() { // logical error: should never be here! (see above) BOOST_ASSERT(false); - typedef typename boost::remove_reference<T>::type basic_type; - basic_type* dummy = 0; - return *static_cast< basic_type* >(dummy); + T (*dummy_function_ptr)() = 0; + return dummy_function_ptr(); } template <> -inline void forced_return<void>( BOOST_EXPLICIT_TEMPLATE_TYPE_SPEC(void) ) +inline void forced_return<void>() { // logical error: should never be here! (see above) @@ -67,5 +61,5 @@ template <typename T> inline BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(T) -forced_return( BOOST_EXPLICIT_TEMPLATE_TYPE(T) ) +forced_return() { // logical error: should never be here! (see above) @@ -78,4 +72,6 @@ forced_return( BOOST_EXPLICIT_TEMPLATE_TYPE(T) ) #else // defined(BOOST_MSVC) +# pragma warning( push ) +# pragma warning( disable : 4702 ) // unreachable code // msvc-specific implementation // @@ -89,5 +85,5 @@ template <typename T> inline BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(T) -forced_return( BOOST_EXPLICIT_TEMPLATE_TYPE(T) ) +forced_return() { // logical error: should never be here! (see above) @@ -97,4 +93,6 @@ forced_return( BOOST_EXPLICIT_TEMPLATE_TYPE(T) ) } +# pragma warning( pop ) + #endif // BOOST_MSVC optimization diff --git a/3rdParty/Boost/src/boost/variant/detail/has_nothrow_move.hpp b/3rdParty/Boost/src/boost/variant/detail/has_nothrow_move.hpp deleted file mode 100644 index 51ca095..0000000 --- a/3rdParty/Boost/src/boost/variant/detail/has_nothrow_move.hpp +++ /dev/null @@ -1,106 +0,0 @@ - -// (C) Copyright Eric Friedman 2002-2003. -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// See http://www.boost.org for most recent version including documentation. - -#ifndef BOOST_VARIANT_DETAIL_HAS_NOTHROW_MOVE_HPP_INCLUDED -#define BOOST_VARIANT_DETAIL_HAS_NOTHROW_MOVE_HPP_INCLUDED - -#include "boost/config.hpp" // for STATIC_CONSTANT -#include "boost/variant/detail/has_trivial_move.hpp" -#include "boost/type_traits/has_nothrow_copy.hpp" -#include "boost/type_traits/has_nothrow_assign.hpp" - -#include "boost/mpl/and.hpp" -#include "boost/mpl/or.hpp" - -// should be the last #include -#include "boost/variant/detail/bool_trait_def.hpp" - -namespace boost { -namespace detail { namespace variant { - -// TRAIT: has_nothrow_move - -template <typename T> -struct has_nothrow_move_impl -{ - BOOST_STATIC_CONSTANT( - bool, value = ( - ::boost::mpl::or_< - has_trivial_move<T> - , ::boost::mpl::and_< - has_nothrow_copy<T> - , has_nothrow_assign<T> - > - >::type::value - ) - ); -}; - -BOOST_VARIANT_TT_AUX_BOOL_TRAIT_DEF1( - has_nothrow_move - , T - , (::boost::detail::variant::has_nothrow_move_impl<T>::value) - ) - - -// TRAIT: has_nothrow_move_constructor - -template <typename T> -struct has_nothrow_move_constructor_impl -{ - BOOST_STATIC_CONSTANT( - bool, value = ( - ::boost::mpl::or_< - has_nothrow_move<T> - , has_trivial_move_constructor<T> - , has_nothrow_copy<T> - >::type::value - ) - ); -}; - -BOOST_VARIANT_TT_AUX_BOOL_TRAIT_DEF1( - has_nothrow_move_constructor - , T - , (::boost::detail::variant::has_nothrow_move_constructor_impl<T>::value) - ) - - -// TRAIT: has_nothrow_move_assign - -template <typename T> -struct has_nothrow_move_assign_impl -{ - BOOST_STATIC_CONSTANT( - bool, value = ( - ::boost::mpl::or_< - has_nothrow_move<T> - , has_trivial_move_assign<T> - , has_nothrow_assign<T> - >::type::value - ) - ); -}; - -BOOST_VARIANT_TT_AUX_BOOL_TRAIT_DEF1( - has_nothrow_move_assign - , T - , (::boost::detail::variant::has_nothrow_move_assign_impl<T>::value) - ) - -}} // namespace detail::variant - -BOOST_VARIANT_TT_AUX_TRAIT_SUFFIX(1,::boost::detail::variant::has_nothrow_move) -BOOST_VARIANT_TT_AUX_TRAIT_SUFFIX(1,::boost::detail::variant::has_nothrow_move_constructor) -BOOST_VARIANT_TT_AUX_TRAIT_SUFFIX(1,::boost::detail::variant::has_nothrow_move_assign) - -} // namespace boost - -#include "boost/variant/detail/bool_trait_undef.hpp" - -#endif // BOOST_VARIANT_DETAIL_HAS_NOTHROW_MOVE_HPP_INCLUDED diff --git a/3rdParty/Boost/src/boost/variant/detail/has_trivial_move.hpp b/3rdParty/Boost/src/boost/variant/detail/has_trivial_move.hpp deleted file mode 100644 index 5293366..0000000 --- a/3rdParty/Boost/src/boost/variant/detail/has_trivial_move.hpp +++ /dev/null @@ -1,100 +0,0 @@ - -// (C) Copyright Eric Friedman 2002-2003. -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// See http://www.boost.org for most recent version including documentation. - -#ifndef BOOST_VARIANT_DETAIL_HAS_TRIVIAL_MOVE_HPP_INCLUDED -#define BOOST_VARIANT_DETAIL_HAS_TRIVIAL_MOVE_HPP_INCLUDED - -#include "boost/config.hpp" // for STATIC_CONSTANT -#include "boost/type_traits/has_trivial_copy.hpp" -#include "boost/type_traits/has_trivial_assign.hpp" - -#include "boost/mpl/and.hpp" -#include "boost/mpl/or.hpp" - -// should be the last #include -#include "boost/variant/detail/bool_trait_def.hpp" - -namespace boost { -namespace detail { namespace variant { - -// TRAIT: has_trivial_move - -template <typename T> -struct has_trivial_move_impl -{ - BOOST_STATIC_CONSTANT( - bool, value = ( - ::boost::mpl::and_< - has_trivial_copy<T> - , has_trivial_assign<T> - >::type::value - ) - ); -}; - -BOOST_VARIANT_TT_AUX_BOOL_TRAIT_DEF1( - has_trivial_move - , T - , (::boost::detail::variant::has_trivial_move_impl<T>::value) - ) - - -// TRAIT: has_trivial_move_constructor - -template <typename T> -struct has_trivial_move_constructor_impl -{ - BOOST_STATIC_CONSTANT( - bool, value = ( - ::boost::mpl::or_< - has_trivial_move<T> - , has_trivial_copy<T> - >::type::value - ) - ); -}; - -BOOST_VARIANT_TT_AUX_BOOL_TRAIT_DEF1( - has_trivial_move_constructor - , T - , (::boost::detail::variant::has_trivial_move_constructor_impl<T>::value) - ) - - -// TRAIT: has_trivial_move_assign - -template <typename T> -struct has_trivial_move_assign_impl -{ - BOOST_STATIC_CONSTANT( - bool, value = ( - ::boost::mpl::or_< - has_trivial_move<T> - , has_trivial_assign<T> - >::type::value - ) - ); -}; - -BOOST_VARIANT_TT_AUX_BOOL_TRAIT_DEF1( - has_trivial_move_assign - , T - , (::boost::detail::variant::has_trivial_move_assign_impl<T>::value) - ) - -}} // namespace detail::variant - -BOOST_VARIANT_TT_AUX_TRAIT_SUFFIX(1,::boost::detail::variant::has_trivial_move) -BOOST_VARIANT_TT_AUX_TRAIT_SUFFIX(1,::boost::detail::variant::has_trivial_move_constructor) -BOOST_VARIANT_TT_AUX_TRAIT_SUFFIX(1,::boost::detail::variant::has_trivial_move_assign) - -} // namespace boost - -#include "boost/variant/detail/bool_trait_undef.hpp" - -#endif // BOOST_VARIANT_DETAIL_HAS_TRIVIAL_MOVE_HPP_INCLUDED diff --git a/3rdParty/Boost/src/boost/variant/detail/hash_variant.hpp b/3rdParty/Boost/src/boost/variant/detail/hash_variant.hpp index 3da669e..958662e 100644 --- a/3rdParty/Boost/src/boost/variant/detail/hash_variant.hpp +++ b/3rdParty/Boost/src/boost/variant/detail/hash_variant.hpp @@ -15,5 +15,5 @@ #define BOOST_HASH_VARIANT_FUNCTION_HPP -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -30,6 +30,5 @@ namespace boost { template <class T> std::size_t operator()(T const& val) const { - using namespace boost; - hash<T> hasher; + boost::hash<T> hasher; return hasher(val); } diff --git a/3rdParty/Boost/src/boost/variant/detail/initializer.hpp b/3rdParty/Boost/src/boost/variant/detail/initializer.hpp index b14d6c8..f6f425e 100644 --- a/3rdParty/Boost/src/boost/variant/detail/initializer.hpp +++ b/3rdParty/Boost/src/boost/variant/detail/initializer.hpp @@ -21,4 +21,5 @@ #include "boost/detail/reference_content.hpp" #include "boost/variant/recursive_wrapper_fwd.hpp" +#include "boost/variant/detail/move.hpp" #if !defined(BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE) @@ -80,6 +81,20 @@ struct make_initializer_node typedef typename unwrap_recursive<recursive_enabled_T>::type public_T; + +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + typedef boost::is_reference<public_T> + is_reference_content_t; + + typedef typename boost::mpl::if_<is_reference_content_t, public_T, const public_T& >::type + param_T; + + template <class T> struct disable_overload{}; + + typedef typename boost::mpl::if_<is_reference_content_t, disable_overload<public_T>, public_T&& >::type + param2_T; +#else typedef typename call_traits<public_T>::param_type param_T; +#endif public: // static functions @@ -97,4 +112,16 @@ struct make_initializer_node } +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + static int initialize(void* dest, param2_T operand) + { + // This assert must newer trigger, because all the reference contents are + // handled by the initilize(void* dest, param_T operand) function above + BOOST_ASSERT(!is_reference_content_t::value); + + typedef typename boost::mpl::if_<is_reference_content_t, param2_T, recursive_enabled_T>::type value_T; + new(dest) value_T( boost::detail::variant::move(operand) ); + return BOOST_MPL_AUX_VALUE_WKND(index)::value; // which + } +#endif }; @@ -126,10 +153,10 @@ public: // static functions #else // defined(BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE) -# if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) - + // Obsolete. Remove. #define BOOST_VARIANT_AUX_PP_INITIALIZER_TEMPLATE_PARAMS \ BOOST_VARIANT_ENUM_PARAMS(typename recursive_enabled_T) \ /**/ + // Obsolete. Remove. #define BOOST_VARIANT_AUX_PP_INITIALIZER_DEFINE_PARAM_T(N) \ typedef typename unwrap_recursive< \ @@ -141,17 +168,5 @@ public: // static functions /**/ -# else // MSVC7 and below - - #define BOOST_VARIANT_AUX_PP_INITIALIZER_TEMPLATE_PARAMS \ - BOOST_VARIANT_ENUM_PARAMS(typename recursive_enabled_T) \ - , BOOST_VARIANT_ENUM_PARAMS(typename param_T) \ - /**/ - - #define BOOST_VARIANT_AUX_PP_INITIALIZER_DEFINE_PARAM_T(N) \ - /**/ - -# endif // MSVC7 and below workaround - -template < BOOST_VARIANT_AUX_PP_INITIALIZER_TEMPLATE_PARAMS > +template < BOOST_VARIANT_ENUM_PARAMS(typename recursive_enabled_T) > struct preprocessor_list_initializer { @@ -159,5 +174,10 @@ public: // static functions #define BOOST_VARIANT_AUX_PP_INITIALIZE_FUNCTION(z,N,_) \ - BOOST_VARIANT_AUX_PP_INITIALIZER_DEFINE_PARAM_T(N) \ + typedef typename unwrap_recursive< \ + BOOST_PP_CAT(recursive_enabled_T,N) \ + >::type BOOST_PP_CAT(public_T,N); \ + typedef typename call_traits< \ + BOOST_PP_CAT(public_T,N) \ + >::param_type BOOST_PP_CAT(param_T,N); \ static int initialize( \ void* dest \ @@ -184,20 +204,4 @@ public: // static functions }; -# if defined(BOOST_MPL_CFG_MSVC_60_ETI_BUG) - -#if !defined(BOOST_VARIANT_AUX_ECHO) -# define BOOST_VARIANT_AUX_ECHO(z,N,token) token -#endif - -template <> -struct preprocessor_list_initializer< - BOOST_PP_ENUM(BOOST_VARIANT_LIMIT_TYPES, BOOST_VARIANT_AUX_ECHO, int) - , BOOST_PP_ENUM(BOOST_VARIANT_LIMIT_TYPES, BOOST_VARIANT_AUX_ECHO, const int) - > -{ -}; - -# endif // BOOST_MPL_CFG_MSVC_60_ETI_BUG workaround - #endif // BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE workaround @@ -230,32 +234,12 @@ struct preprocessor_list_initializer< #else // defined(BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE) -# if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) - + // Obsolete. Remove. #define BOOST_VARIANT_AUX_PP_INITIALIZER_TEMPLATE_ARGS(typename_base) \ BOOST_VARIANT_ENUM_PARAMS(typename_base) \ /**/ -# else // MSVC7 and below - - #define BOOST_VARIANT_AUX_PP_INITIALIZER_ENUM_PARAM_TYPE(z,N,T) \ - ::boost::call_traits< \ - ::boost::unwrap_recursive<BOOST_PP_CAT(T,N)>::type \ - >::param_type \ - /**/ - - #define BOOST_VARIANT_AUX_PP_INITIALIZER_TEMPLATE_ARGS(typename_base) \ - BOOST_VARIANT_ENUM_PARAMS(typename_base) \ - , BOOST_PP_ENUM( \ - BOOST_VARIANT_LIMIT_TYPES \ - , BOOST_VARIANT_AUX_PP_INITIALIZER_ENUM_PARAM_TYPE \ - , typename_base \ - ) \ - /**/ - -# endif // MSVC7 workaround - #define BOOST_VARIANT_AUX_INITIALIZER_T( mpl_seq, typename_base ) \ ::boost::detail::variant::preprocessor_list_initializer< \ - BOOST_VARIANT_AUX_PP_INITIALIZER_TEMPLATE_ARGS(typename_base) \ + BOOST_VARIANT_ENUM_PARAMS(typename_base) \ > \ /**/ diff --git a/3rdParty/Boost/src/boost/variant/detail/make_variant_list.hpp b/3rdParty/Boost/src/boost/variant/detail/make_variant_list.hpp index b2c74ad..37d725c 100644 --- a/3rdParty/Boost/src/boost/variant/detail/make_variant_list.hpp +++ b/3rdParty/Boost/src/boost/variant/detail/make_variant_list.hpp @@ -4,6 +4,6 @@ //----------------------------------------------------------------------------- // -// Copyright (c) 2002-2003 -// Eric Friedman, Itay Maman +// Copyright (c) 2002-2003 Eric Friedman, Itay Maman +// Copyright (c) 2013 Antony Polukhin // // Distributed under the Boost Software License, Version 1.0. (See @@ -32,4 +32,15 @@ namespace detail { namespace variant { // declaration workaround (below). // + +#if !defined(BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES) + +template < typename... T > +struct make_variant_list +{ + typedef typename mpl::list< T... >::type type; +}; + +#else // defined(BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES) + template < BOOST_VARIANT_ENUM_PARAMS(typename T) > struct make_variant_list @@ -55,4 +66,6 @@ public: // metafunction result }; +#endif // BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES workaround + }} // namespace detail::variant } // namespace boost diff --git a/3rdParty/Boost/src/boost/variant/detail/move.hpp b/3rdParty/Boost/src/boost/variant/detail/move.hpp index 572cfbb..24f8310 100644 --- a/3rdParty/Boost/src/boost/variant/detail/move.hpp +++ b/3rdParty/Boost/src/boost/variant/detail/move.hpp @@ -6,4 +6,5 @@ // Copyright (c) 2002-2003 Eric Friedman // Copyright (c) 2002 by Andrei Alexandrescu +// Copyright (c) 2013 Antony Polukhin // // Use, modification and distribution are subject to the @@ -25,90 +26,9 @@ #include "boost/config.hpp" #include "boost/detail/workaround.hpp" -#include "boost/mpl/if.hpp" -#include "boost/type_traits/is_base_and_derived.hpp" +#include "boost/move/move.hpp" -namespace boost { -namespace detail { namespace variant { +namespace boost { namespace detail { namespace variant { -////////////////////////////////////////////////////////////////////////// -// forward declares -// -// NOTE: Incomplete until (if?) Boost.Move becomes part of Boost. -// -template <typename Deriving> class moveable; -template <typename T> class move_source; -template <typename T> class move_return; - -namespace detail { - -// (detail) moveable_tag -// -// Concrete type from which moveable<T> derives. -// -// TODO: Move into moveable_fwd.hpp and define has_move_constructor. -// -template <typename Deriving> -struct moveable_tag -{ -}; - -} // namespace detail - -////////////////////////////////////////////////////////////////////////// -// function template move -// -// Takes a T& and returns, if T derives moveable<T>, a move_source<T> for -// the object; else, returns the T&. -// - -namespace detail { - -// (detail) class template move_type -// -// Metafunction that, given moveable T, provides move_source<T>, else T&. -// -template <typename T> -struct move_type -{ -public: // metafunction result - - typedef typename mpl::if_< - is_base_and_derived<detail::moveable_tag<T>, T> - , move_source<T> - , T& - >::type type; - -}; - -} // namespace detail - -template <typename T> -inline - typename detail::move_type<T>::type -move(T& source) -{ - typedef typename detail::move_type<T>::type - move_t; - - return move_t(source); -} - -////////////////////////////////////////////////////////////////////////// -// class template return_t -// -// Metafunction that, given moveable T, provides move_return<T>, else T. -// -template <typename T> -struct return_t -{ -public: // metafunction result - - typedef typename mpl::if_< - is_base_and_derived<moveable<T>, T> - , move_return<T> - , T - >::type type; - -}; +using boost::move; ////////////////////////////////////////////////////////////////////////// @@ -119,45 +39,28 @@ public: // metafunction result // -#if defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP) \ - || BOOST_WORKAROUND(__GNUC__, BOOST_TESTED_AT(2)) - -// [Indicate that move_swap by overload is disabled...] -#define BOOST_NO_MOVE_SWAP_BY_OVERLOAD +namespace move_swap_fallback { -// [...and provide straight swap-by-move implementation:] -template <typename T> -inline void move_swap(T& lhs, T& rhs) -{ - T tmp( boost::detail::variant::move(lhs) ); - lhs = boost::detail::variant::move(rhs); - rhs = boost::detail::variant::move(tmp); -} - -#else// !workaround - -namespace detail { namespace move_swap { - -template <typename T> -inline void swap(T& lhs, T& rhs) +template <typename T1, typename T2> +inline void swap(T1& lhs, T2& rhs) { - T tmp( boost::detail::variant::move(lhs) ); + T1 tmp( boost::detail::variant::move(lhs) ); lhs = boost::detail::variant::move(rhs); rhs = boost::detail::variant::move(tmp); } -}} // namespace detail::move_swap +} // namespace move_swap_fallback template <typename T> inline void move_swap(T& lhs, T& rhs) { - using detail::move_swap::swap; - +#if defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP) + move_swap_fallback::swap(lhs, rhs); +#else + using move_swap_fallback::swap; swap(lhs, rhs); +#endif } -#endif // workaround - -}} // namespace detail::variant -} // namespace boost +}}} // namespace boost::detail::variant #endif // BOOST_VARIANT_DETAIL_MOVE_HPP diff --git a/3rdParty/Boost/src/boost/variant/detail/over_sequence.hpp b/3rdParty/Boost/src/boost/variant/detail/over_sequence.hpp index bdd69ad..ff20a01 100644 --- a/3rdParty/Boost/src/boost/variant/detail/over_sequence.hpp +++ b/3rdParty/Boost/src/boost/variant/detail/over_sequence.hpp @@ -17,10 +17,4 @@ #include "boost/mpl/aux_/config/ctps.hpp" -#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) -# include "boost/mpl/eval_if.hpp" -# include "boost/mpl/bool.hpp" -# include "boost/mpl/identity.hpp" -# include "boost/type.hpp" -#endif @@ -45,5 +39,4 @@ struct over_sequence // -#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) template <typename T> @@ -59,34 +52,4 @@ struct is_over_sequence< over_sequence<Types> > }; -#else // defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) - -typedef char (&yes_over_sequence_t)[1]; -typedef char (&no_over_sequence_t)[2]; - -no_over_sequence_t is_over_sequence_test(...); - -template<typename T> -yes_over_sequence_t is_over_sequence_test( - type< ::boost::detail::variant::over_sequence<T> > - ); - -template<typename T> -struct is_over_sequence_impl -{ - BOOST_STATIC_CONSTANT(bool, value = ( - sizeof(is_over_sequence_test(type<T>())) - == sizeof(yes_over_sequence_t) - )); -}; - -template <typename T> -struct is_over_sequence - : mpl::bool_< - ::boost::detail::variant::is_over_sequence_impl<T>::value - > -{ -}; - -#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION workaround }} // namespace detail::variant diff --git a/3rdParty/Boost/src/boost/variant/detail/substitute.hpp b/3rdParty/Boost/src/boost/variant/detail/substitute.hpp index 97fe205..56faa89 100644 --- a/3rdParty/Boost/src/boost/variant/detail/substitute.hpp +++ b/3rdParty/Boost/src/boost/variant/detail/substitute.hpp @@ -126,4 +126,25 @@ struct substitute< // +#if !defined(BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES) +template < + template <typename...> class F + , typename... Ts + , typename Dest + , typename Source + BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(typename Arity) + > +struct substitute< + F<Ts...> + , Dest + , Source + BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(Arity) + > +{ + typedef F<typename substitute< + Ts, Dest, Source + >::type...> type; +}; +#endif // !defined(BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES) + #define BOOST_VARIANT_AUX_SUBSTITUTE_TYPEDEF_IMPL(N) \ typedef typename substitute< \ diff --git a/3rdParty/Boost/src/boost/variant/detail/substitute_fwd.hpp b/3rdParty/Boost/src/boost/variant/detail/substitute_fwd.hpp index 1723847..8084cb8 100644 --- a/3rdParty/Boost/src/boost/variant/detail/substitute_fwd.hpp +++ b/3rdParty/Boost/src/boost/variant/detail/substitute_fwd.hpp @@ -29,5 +29,4 @@ #if defined(BOOST_NO_TEMPLATE_TEMPLATE_PARAMETERS) \ - || defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ && !defined(BOOST_VARIANT_DETAIL_NO_SUBSTITUTE) # define BOOST_VARIANT_DETAIL_NO_SUBSTITUTE diff --git a/3rdParty/Boost/src/boost/variant/detail/visitation_impl.hpp b/3rdParty/Boost/src/boost/variant/detail/visitation_impl.hpp index 9cc3015..96bc274 100644 --- a/3rdParty/Boost/src/boost/variant/detail/visitation_impl.hpp +++ b/3rdParty/Boost/src/boost/variant/detail/visitation_impl.hpp @@ -21,5 +21,4 @@ #include "boost/variant/detail/generic_result_type.hpp" -#include "boost/assert.hpp" #include "boost/mpl/eval_if.hpp" #include "boost/mpl/bool.hpp" @@ -34,5 +33,5 @@ #include "boost/type_traits/is_same.hpp" #include "boost/type_traits/has_nothrow_copy.hpp" -#include "boost/variant/detail/has_nothrow_move.hpp" +#include "boost/type_traits/is_nothrow_move_constructible.hpp" #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) @@ -48,8 +47,16 @@ // #if !defined(BOOST_VARIANT_VISITATION_UNROLLING_LIMIT) + +#ifndef BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES +# include "boost/mpl/limits/list.hpp" +# define BOOST_VARIANT_VISITATION_UNROLLING_LIMIT \ + BOOST_MPL_LIMIT_LIST_SIZE +#else # define BOOST_VARIANT_VISITATION_UNROLLING_LIMIT \ BOOST_VARIANT_LIMIT_TYPES #endif +#endif + namespace boost { namespace detail { namespace variant { @@ -68,5 +75,4 @@ struct apply_visitor_unrolled {}; // -#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) template <typename Iter, typename LastIter> @@ -88,27 +94,4 @@ struct visitation_impl_step< LastIter,LastIter > }; -#else // defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) - -template <typename Iter, typename LastIter> -struct visitation_impl_step -{ - typedef typename mpl::eval_if< - is_same<Iter, LastIter> - , mpl::identity<apply_visitor_unrolled> - , Iter - >::type type; - - typedef typename mpl::eval_if< - is_same<type, apply_visitor_unrolled> //is_same<Iter, LastIter> - , mpl::identity<LastIter> - , mpl::next<Iter> - >::type next_iter; - - typedef visitation_impl_step< - next_iter, LastIter - > next; -}; - -#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION workaround /////////////////////////////////////////////////////////////////////////////// @@ -164,5 +147,5 @@ visitation_impl_invoke( typedef typename mpl::or_< NoBackupFlag - , has_nothrow_move_constructor<T> + , is_nothrow_move_constructible<T> , has_nothrow_copy<T> >::type never_uses_backup; @@ -179,6 +162,5 @@ inline visitation_impl_invoke(int, Visitor&, VoidPtrCV, apply_visitor_unrolled*, NBF, long) { - // should never be here at runtime: - BOOST_ASSERT(false); + // should never be here at runtime! typedef typename Visitor::result_type result_type; return ::boost::detail::variant::forced_return< result_type >(); @@ -204,6 +186,5 @@ visitation_impl( ) { - // should never be here at runtime: - BOOST_ASSERT(false); + // should never be here at runtime! typedef typename Visitor::result_type result_type; return ::boost::detail::variant::forced_return< result_type >(); diff --git a/3rdParty/Boost/src/boost/variant/get.hpp b/3rdParty/Boost/src/boost/variant/get.hpp index 99a65f6..e3302c0 100644 --- a/3rdParty/Boost/src/boost/variant/get.hpp +++ b/3rdParty/Boost/src/boost/variant/get.hpp @@ -18,4 +18,5 @@ #include "boost/config.hpp" #include "boost/detail/workaround.hpp" +#include "boost/throw_exception.hpp" #include "boost/utility/addressof.hpp" #include "boost/variant/variant_fwd.hpp" @@ -24,10 +25,4 @@ #include "boost/type_traits/add_pointer.hpp" -#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) -# include "boost/mpl/bool.hpp" -# include "boost/mpl/or.hpp" -# include "boost/type_traits/is_same.hpp" -#endif - namespace boost { @@ -37,10 +32,10 @@ namespace boost { // The exception thrown in the event of a failed get of a value. // -class bad_get +class BOOST_SYMBOL_VISIBLE bad_get : public std::exception { public: // std::exception implementation - virtual const char * what() const throw() + virtual const char * what() const BOOST_NOEXCEPT_OR_NOTHROW { return "boost::bad_get: " @@ -78,22 +73,5 @@ public: // visitor typedefs public: // visitor interfaces -#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300) - - pointer operator()(reference operand) const - { - return boost::addressof(operand); - } - - template <typename U> - pointer operator()(const U&) const - { - return static_cast<pointer>(0); - } - -#else // MSVC6 - -private: // helpers, for visitor interfaces (below) - - pointer execute_impl(reference operand, mpl::true_) const + pointer operator()(reference operand) const BOOST_NOEXCEPT { return boost::addressof(operand); @@ -101,37 +79,19 @@ private: // helpers, for visitor interfaces (below) template <typename U> - pointer execute_impl(const U& operand, mpl::false_) const + pointer operator()(const U&) const BOOST_NOEXCEPT { return static_cast<pointer>(0); } - -public: // visitor interfaces - - template <typename U> - pointer operator()(U& operand) const - { - // MSVC6 finds normal implementation (above) ambiguous, - // so we must explicitly disambiguate - - typedef typename mpl::or_< - is_same<U, T> - , is_same<const U, T> - >::type U_is_T; - - return execute_impl(operand, U_is_T()); - } - -#endif // MSVC6 workaround - }; }} // namespace detail::variant -#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x0551)) -# define BOOST_VARIANT_AUX_GET_EXPLICIT_TEMPLATE_TYPE(t) \ - BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(t) -#else -# define BOOST_VARIANT_AUX_GET_EXPLICIT_TEMPLATE_TYPE(t) \ - , t* = 0 +#ifndef BOOST_VARIANT_AUX_GET_EXPLICIT_TEMPLATE_TYPE +# if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x0551)) +# define BOOST_VARIANT_AUX_GET_EXPLICIT_TEMPLATE_TYPE(t) +# else +# define BOOST_VARIANT_AUX_GET_EXPLICIT_TEMPLATE_TYPE(t) \ + , t* = 0 +# endif #endif @@ -142,5 +102,5 @@ get( boost::variant< BOOST_VARIANT_ENUM_PARAMS(T) >* operand BOOST_VARIANT_AUX_GET_EXPLICIT_TEMPLATE_TYPE(U) - ) + ) BOOST_NOEXCEPT { typedef typename add_pointer<U>::type U_ptr; @@ -157,5 +117,5 @@ get( const boost::variant< BOOST_VARIANT_ENUM_PARAMS(T) >* operand BOOST_VARIANT_AUX_GET_EXPLICIT_TEMPLATE_TYPE(U) - ) + ) BOOST_NOEXCEPT { typedef typename add_pointer<const U>::type U_ptr; @@ -178,5 +138,5 @@ get( if (!result) - throw bad_get(); + boost::throw_exception(bad_get()); return *result; } @@ -194,5 +154,5 @@ get( if (!result) - throw bad_get(); + boost::throw_exception(bad_get()); return *result; } diff --git a/3rdParty/Boost/src/boost/variant/recursive_variant.hpp b/3rdParty/Boost/src/boost/variant/recursive_variant.hpp index 071d0f9..cb5eb4c 100644 --- a/3rdParty/Boost/src/boost/variant/recursive_variant.hpp +++ b/3rdParty/Boost/src/boost/variant/recursive_variant.hpp @@ -4,6 +4,6 @@ //----------------------------------------------------------------------------- // -// Copyright (c) 2003 -// Eric Friedman +// Copyright (c) 2003 Eric Friedman +// Copyright (c) 2013 Antony Polukhin // // Distributed under the Boost Software License, Version 1.0. (See @@ -117,4 +117,21 @@ struct substitute< > { +#if !defined(BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES) + + typedef ::boost::variant< + typename enable_recursive< + T0 + , RecursiveVariant + , mpl::true_ + >::type, + typename enable_recursive< + TN + , RecursiveVariant + , mpl::true_ + >::type... + > type; + +#else // defined(BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES) + private: // helpers, for metafunction result (below) @@ -138,4 +155,5 @@ public: // metafunction result typedef ::boost::variant< BOOST_VARIANT_ENUM_PARAMS(wknd_T) > type; +#endif // BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES workaround }; @@ -177,7 +195,5 @@ struct make_recursive_variant_over private: // precondition assertions -#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) BOOST_STATIC_ASSERT(( ::boost::mpl::is_sequence<Types>::value )); -#endif public: // metafunction result diff --git a/3rdParty/Boost/src/boost/variant/recursive_wrapper.hpp b/3rdParty/Boost/src/boost/variant/recursive_wrapper.hpp index ddc7002..f3b88d8 100644 --- a/3rdParty/Boost/src/boost/variant/recursive_wrapper.hpp +++ b/3rdParty/Boost/src/boost/variant/recursive_wrapper.hpp @@ -15,4 +15,5 @@ #include "boost/variant/recursive_wrapper_fwd.hpp" +#include "boost/variant/detail/move.hpp" #include "boost/checked_delete.hpp" @@ -44,4 +45,9 @@ public: // structors recursive_wrapper(const T& operand); +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + recursive_wrapper(recursive_wrapper&& operand); + recursive_wrapper(T&& operand); +#endif + private: // helpers, for modifiers (below) @@ -62,5 +68,5 @@ public: // modifiers } - void swap(recursive_wrapper& operand) + void swap(recursive_wrapper& operand) BOOST_NOEXCEPT { T* temp = operand.p_; @@ -69,4 +75,19 @@ public: // modifiers } + +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + recursive_wrapper& operator=(recursive_wrapper&& rhs) BOOST_NOEXCEPT + { + swap(rhs); + return *this; + } + + recursive_wrapper& operator=(T&& rhs) + { + get() = detail::variant::move(rhs); + return *this; + } +#endif + public: // queries @@ -103,4 +124,18 @@ recursive_wrapper<T>::recursive_wrapper(const T& operand) } +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES +template <typename T> +recursive_wrapper<T>::recursive_wrapper(recursive_wrapper&& operand) + : p_(new T( detail::variant::move(operand.get()) )) +{ +} + +template <typename T> +recursive_wrapper<T>::recursive_wrapper(T&& operand) + : p_(new T( detail::variant::move(operand) )) +{ +} +#endif + template <typename T> void recursive_wrapper<T>::assign(const T& rhs) @@ -114,5 +149,5 @@ void recursive_wrapper<T>::assign(const T& rhs) // template <typename T> -inline void swap(recursive_wrapper<T>& lhs, recursive_wrapper<T>& rhs) +inline void swap(recursive_wrapper<T>& lhs, recursive_wrapper<T>& rhs) BOOST_NOEXCEPT { lhs.swap(rhs); diff --git a/3rdParty/Boost/src/boost/variant/recursive_wrapper_fwd.hpp b/3rdParty/Boost/src/boost/variant/recursive_wrapper_fwd.hpp index 69a0ec7..cf03959 100644 --- a/3rdParty/Boost/src/boost/variant/recursive_wrapper_fwd.hpp +++ b/3rdParty/Boost/src/boost/variant/recursive_wrapper_fwd.hpp @@ -17,10 +17,4 @@ #include "boost/mpl/aux_/config/ctps.hpp" -#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) -# include "boost/mpl/eval_if.hpp" -# include "boost/mpl/bool.hpp" -# include "boost/mpl/identity.hpp" -# include "boost/type.hpp" -#endif #include "boost/mpl/aux_/lambda_support.hpp" @@ -57,5 +51,4 @@ template <typename T> class recursive_wrapper; namespace detail { -#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) template <typename T> @@ -71,26 +64,4 @@ struct is_recursive_wrapper_impl< recursive_wrapper<T> > }; -#else // defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) - -typedef char (&yes_recursive_wrapper_t)[1]; -typedef char (&no_recursive_wrapper_t)[2]; - -no_recursive_wrapper_t is_recursive_wrapper_test(...); - -template<typename T> -yes_recursive_wrapper_t is_recursive_wrapper_test( - type< ::boost::recursive_wrapper<T> > - ); - -template<typename T> -struct is_recursive_wrapper_impl -{ - BOOST_STATIC_CONSTANT(bool, value = ( - sizeof(is_recursive_wrapper_test(type<T>())) - == sizeof(yes_recursive_wrapper_t) - )); -}; - -#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION workaround } // namespace detail @@ -108,5 +79,4 @@ BOOST_TT_AUX_BOOL_TRAIT_DEF1( // -#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) template <typename T> @@ -126,18 +96,4 @@ struct unwrap_recursive< recursive_wrapper<T> > }; -#else // defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) - -template <typename T> -struct unwrap_recursive - : mpl::eval_if< - is_recursive_wrapper<T> - , T - , mpl::identity< T > - > -{ - BOOST_MPL_AUX_LAMBDA_SUPPORT(1,unwrap_recursive,(T)) -}; - -#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION workaround } // namespace boost diff --git a/3rdParty/Boost/src/boost/variant/static_visitor.hpp b/3rdParty/Boost/src/boost/variant/static_visitor.hpp index b59b6f5..199317c 100644 --- a/3rdParty/Boost/src/boost/variant/static_visitor.hpp +++ b/3rdParty/Boost/src/boost/variant/static_visitor.hpp @@ -20,8 +20,4 @@ #include "boost/type_traits/is_base_and_derived.hpp" -#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) -# include "boost/type_traits/is_same.hpp" -#endif - // should be the last #include #include "boost/type_traits/detail/bool_trait_def.hpp" @@ -53,8 +49,11 @@ public: // typedefs protected: // for use as base class only - - static_visitor() { } - ~static_visitor() { } - +#ifndef BOOST_NO_DEFAULTED_FUNCTIONS + static_visitor() = default; + ~static_visitor() = default; +#else + static_visitor() BOOST_NOEXCEPT { } + ~static_visitor() BOOST_NOEXCEPT { } +#endif }; diff --git a/3rdParty/Boost/src/boost/variant/variant.hpp b/3rdParty/Boost/src/boost/variant/variant.hpp index 6afd190..4ed5ad4 100644 --- a/3rdParty/Boost/src/boost/variant/variant.hpp +++ b/3rdParty/Boost/src/boost/variant/variant.hpp @@ -4,6 +4,6 @@ //----------------------------------------------------------------------------- // -// Copyright (c) 2002-2003 -// Eric Friedman, Itay Maman +// Copyright (c) 2002-2003 Eric Friedman, Itay Maman +// Copyright (c) 2012-2013 Antony Polukhin // // Distributed under the Boost Software License, Version 1.0. (See @@ -11,4 +11,6 @@ // http://www.boost.org/LICENSE_1_0.txt) +// Thanks to Adam Romanek for providing patches for exception-disabled env. + #ifndef BOOST_VARIANT_VARIANT_HPP #define BOOST_VARIANT_VARIANT_HPP @@ -22,5 +24,4 @@ #include "boost/variant/detail/config.hpp" -#include "boost/mpl/aux_/config/eti.hpp" #include "boost/mpl/aux_/value_wknd.hpp" @@ -36,7 +37,7 @@ #include "boost/variant/detail/generic_result_type.hpp" -#include "boost/variant/detail/has_nothrow_move.hpp" #include "boost/variant/detail/move.hpp" +#include "boost/detail/no_exceptions_support.hpp" #include "boost/detail/reference_content.hpp" #include "boost/aligned_storage.hpp" @@ -50,7 +51,10 @@ #include "boost/type_traits/has_nothrow_constructor.hpp" #include "boost/type_traits/has_nothrow_copy.hpp" +#include "boost/type_traits/is_nothrow_move_constructible.hpp" #include "boost/type_traits/is_const.hpp" #include "boost/type_traits/is_same.hpp" +#include "boost/type_traits/is_rvalue_reference.hpp" #include "boost/utility/enable_if.hpp" +#include "boost/utility/declval.hpp" #include "boost/variant/recursive_wrapper_fwd.hpp" #include "boost/variant/static_visitor.hpp" @@ -215,13 +219,39 @@ public: // metafunction result }; -#if defined(BOOST_MPL_CFG_MSVC_60_ETI_BUG) - -template<> -struct find_fallback_type<int> -{ - typedef mpl::pair< no_fallback_type,no_fallback_type > type; +#ifndef BOOST_NO_CXX11_NOEXCEPT +/////////////////////////////////////////////////////////////////////////////// +// (detail) metafunction is_variant_move_noexcept_constructible +// +// Returns true_type if all the types are nothrow move constructible. +// +template <class Types> +struct is_variant_move_noexcept_constructible { + typedef typename boost::mpl::find_if< + Types, mpl::not_<boost::is_nothrow_move_constructible<boost::mpl::_1> > + >::type iterator_t; + + typedef typename boost::mpl::end<Types>::type end_t; + typedef typename boost::is_same< + iterator_t, end_t + >::type type; }; -#endif // BOOST_MPL_CFG_MSVC_60_ETI_BUG workaround +/////////////////////////////////////////////////////////////////////////////// +// (detail) metafunction is_variant_move_noexcept_assignable +// +// Returns true_type if all the types are nothrow move constructible. +// +template <class Types> +struct is_variant_move_noexcept_assignable { + typedef typename boost::mpl::find_if< + Types, mpl::not_<boost::is_nothrow_move_assignable<boost::mpl::_1> > + >::type iterator_t; + + typedef typename boost::mpl::end<Types>::type end_t; + typedef typename boost::is_same< + iterator_t, end_t + >::type type; +}; +#endif // BOOST_NO_CXX11_NOEXCEPT /////////////////////////////////////////////////////////////////////////////// @@ -266,35 +296,10 @@ private: // helpers, for metafunction result (below) public: // metafunction result -#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) - typedef ::boost::aligned_storage< BOOST_MPL_AUX_VALUE_WKND(max_size)::value , BOOST_MPL_AUX_VALUE_WKND(max_alignment)::value > type; - -#else // MSVC7 and below - - BOOST_STATIC_CONSTANT(std::size_t, msvc_max_size_c = max_size::value); - BOOST_STATIC_CONSTANT(std::size_t, msvc_max_alignment_c = max_alignment::value); - - typedef ::boost::aligned_storage< - msvc_max_size_c - , msvc_max_alignment_c - > type; - -#endif // MSVC workaround - }; -#if defined(BOOST_MPL_CFG_MSVC_60_ETI_BUG) - -template<> -struct make_storage<int,int> -{ - typedef int type; -}; - -#endif // BOOST_MPL_CFG_MSVC_60_ETI_BUG workaround - /////////////////////////////////////////////////////////////////////////////// // (detail) class destroyer @@ -309,7 +314,7 @@ public: // visitor interfaces template <typename T> BOOST_VARIANT_AUX_RETURN_VOID_TYPE - internal_visit(T& operand, int) const + internal_visit(T& operand, int) const BOOST_NOEXCEPT { - operand.~T(); + operand.~T(); // must be noexcept #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x0551)) || \ @@ -335,9 +340,7 @@ class known_get { -#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300) - public: // visitor interface - T& operator()(T& operand) const + T& operator()(T& operand) const BOOST_NOEXCEPT { return operand; @@ -348,38 +351,6 @@ public: // visitor interface { // logical error to be here: see precondition above - BOOST_ASSERT(false); return ::boost::detail::variant::forced_return< T& >(); } - -#else // MSVC6 - -private: // helpers, for visitor interface (below) - - T& execute(T& operand, mpl::true_) const - { - return operand; - } - - template <typename U> - T& execute(U& operand, mpl::false_) const - { - // logical error to be here: see precondition above - BOOST_ASSERT(false); - return ::boost::detail::variant::forced_return< T& >(); - } - -public: // visitor interface - - template <typename U> - T& operator()(U& operand) const - { - typedef typename is_same< U,T >::type - U_is_T; - - return execute(operand, U_is_T()); - } - -#endif // MSVC6 workaround - }; @@ -398,5 +369,5 @@ private: // representation public: // structors - explicit copy_into(void* storage) + explicit copy_into(void* storage) BOOST_NOEXCEPT : storage_(storage) { @@ -432,4 +403,44 @@ public: // internal visitor interface /////////////////////////////////////////////////////////////////////////////// +// (detail) class move_into +// +// Internal visitor that moves the value it visits into the given buffer. +// +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES +class move_into + : public static_visitor<> +{ +private: // representation + + void* storage_; + +public: // structors + + explicit move_into(void* storage) BOOST_NOEXCEPT + : storage_(storage) + { + } + +public: // internal visitor interface + + template <typename T> + BOOST_VARIANT_AUX_RETURN_VOID_TYPE + internal_visit(boost::detail::variant::backup_holder<T>& operand, long) const + { + new(storage_) T( ::boost::detail::variant::move(operand.get()) ); + BOOST_VARIANT_AUX_RETURN_VOID; + } + + template <typename T> + BOOST_VARIANT_AUX_RETURN_VOID_TYPE + internal_visit(T& operand, int) const BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(T(boost::declval<T>()))) + { + new(storage_) T(::boost::detail::variant::move(operand)); + BOOST_VARIANT_AUX_RETURN_VOID; + } +}; +#endif + +/////////////////////////////////////////////////////////////////////////////// // (detail) class assign_storage // @@ -446,5 +457,5 @@ private: // representation public: // structors - explicit assign_storage(const void* rhs_storage) + explicit assign_storage(const void* rhs_storage) BOOST_NOEXCEPT : rhs_storage_(rhs_storage) { @@ -489,4 +500,61 @@ public: // internal visitor interfaces /////////////////////////////////////////////////////////////////////////////// +// (detail) class move_storage +// +// Internal visitor that moves the given storage (which must be a +// constructed value of the same type) to the value it visits. +// +struct move_storage + : public static_visitor<> +{ +private: // representation + + void* rhs_storage_; + +public: // structors + + explicit move_storage(void* rhs_storage) BOOST_NOEXCEPT + : rhs_storage_(rhs_storage) + { + } + +public: // internal visitor interfaces + + template <typename T> + BOOST_VARIANT_AUX_RETURN_VOID_TYPE + internal_visit(backup_holder<T>& lhs_content, long) const + { + lhs_content.get() + = ::boost::detail::variant::move(static_cast<backup_holder<T>* >(rhs_storage_)->get()); + BOOST_VARIANT_AUX_RETURN_VOID; + } + + template <typename T> + BOOST_VARIANT_AUX_RETURN_VOID_TYPE + internal_visit(const backup_holder<T>& lhs_content, long) const + { + lhs_content.get() + = ::boost::detail::variant::move(static_cast<backup_holder<T>* >(rhs_storage_)->get()); + BOOST_VARIANT_AUX_RETURN_VOID; + } + + template <typename T> + BOOST_VARIANT_AUX_RETURN_VOID_TYPE + internal_visit(T& lhs_content, int) const + { + // NOTE TO USER : + // Compile error here indicates one of variant's bounded types does + // not meet the requirements of the Assignable concept. Thus, + // variant is not Assignable. + // + // Hint: Are any of the bounded types const-qualified or references? + // + lhs_content = ::boost::detail::variant::move(*static_cast<T* >(rhs_storage_)); + BOOST_VARIANT_AUX_RETURN_VOID; + } + +}; + +/////////////////////////////////////////////////////////////////////////////// // (detail) class direct_assigner // @@ -505,11 +573,9 @@ private: // representation public: // structors - explicit direct_assigner(const T& rhs) + explicit direct_assigner(const T& rhs) BOOST_NOEXCEPT : rhs_(rhs) { } -#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300) - public: // visitor interface @@ -521,43 +587,60 @@ public: // visitor interface template <typename U> - bool operator()(U&) + bool operator()(U&) BOOST_NOEXCEPT { return false; } -#else // MSVC6 +#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600)) +private: + // silence MSVC warning C4512: assignment operator could not be generated + direct_assigner& operator= (direct_assigner const&); +#endif +}; -private: // helpers, for visitor interface (below) +/////////////////////////////////////////////////////////////////////////////// +// (detail) class direct_mover +// +// Generic static visitor that: if and only if the visited value is of the +// specified type, move assigns the given value to the visited value and returns +// true; else returns false. +// +template <typename T> +class direct_mover + : public static_visitor<bool> +{ +private: // representation - bool execute(T& lhs, mpl::true_) - { - lhs = rhs_; - return true; - } + T& rhs_; - template <typename U> - bool execute(U&, mpl::false_) +public: // structors + + explicit direct_mover(T& rhs) BOOST_NOEXCEPT + : rhs_(rhs) { - return false; } public: // visitor interface - template <typename U> - bool operator()(U& lhs) + bool operator()(T& lhs) { - typedef typename is_same<U,T>::type U_is_T; - return execute(lhs, U_is_T()); + lhs = ::boost::detail::variant::move(rhs_); + return true; } -#endif // MSVC6 workaround + template <typename U> + bool operator()(U&) BOOST_NOEXCEPT + { + return false; + } #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600)) private: // silence MSVC warning C4512: assignment operator could not be generated - direct_assigner& operator= (direct_assigner const&); + direct_mover& operator= (direct_mover const&); #endif }; + /////////////////////////////////////////////////////////////////////////////// // (detail) class backup_assigner @@ -602,5 +685,5 @@ private: // helpers, for visitor interface (below) void backup_assign_impl( LhsT& lhs_content - , mpl::true_// has_nothrow_move + , mpl::true_ // is_nothrow_move_constructible ) { @@ -613,10 +696,10 @@ private: // helpers, for visitor interface (below) lhs_content.~LhsT(); // nothrow - try + BOOST_TRY { // ...and attempt to copy rhs content into lhs storage: copy_rhs_content_(lhs_.storage_.address(), rhs_content_); } - catch (...) + BOOST_CATCH (...) { // In case of failure, restore backup content to lhs storage... @@ -627,6 +710,7 @@ private: // helpers, for visitor interface (below) // ...and rethrow: - throw; + BOOST_RETHROW; } + BOOST_CATCH_END // In case of success, indicate new content type: @@ -637,5 +721,5 @@ private: // helpers, for visitor interface (below) void backup_assign_impl( LhsT& lhs_content - , mpl::false_// has_nothrow_move + , mpl::false_ // is_nothrow_move_constructible ) { @@ -646,10 +730,10 @@ private: // helpers, for visitor interface (below) lhs_content.~LhsT(); // nothrow - try + BOOST_TRY { // ...and attempt to copy rhs content into lhs storage: copy_rhs_content_(lhs_.storage_.address(), rhs_content_); } - catch (...) + BOOST_CATCH (...) { // In case of failure, copy backup pointer to lhs storage... @@ -661,6 +745,7 @@ private: // helpers, for visitor interface (below) // ...and rethrow: - throw; + BOOST_RETHROW; } + BOOST_CATCH_END // In case of success, indicate new content type... @@ -677,5 +762,5 @@ public: // visitor interface internal_visit(LhsT& lhs_content, int) { - typedef typename has_nothrow_move_constructor<LhsT>::type + typedef typename is_nothrow_move_constructible<LhsT>::type nothrow_move; @@ -709,5 +794,5 @@ private: // representation public: // structors - explicit swap_with(Variant& toswap) + explicit swap_with(Variant& toswap) BOOST_NOEXCEPT : toswap_(toswap) { @@ -746,5 +831,5 @@ public: // visitor interfaces template <typename T> - const std::type_info& operator()(const T&) const + const std::type_info& operator()(const T&) const BOOST_NOEXCEPT { return typeid(T); @@ -773,5 +858,5 @@ private: // representation public: // structors - explicit comparer(const Variant& lhs) + explicit comparer(const Variant& lhs) BOOST_NOEXCEPT : lhs_(lhs) { @@ -845,5 +930,5 @@ public: // visitor typedefs public: // structors - explicit invoke_visitor(Visitor& visitor) + explicit invoke_visitor(Visitor& visitor) BOOST_NOEXCEPT : visitor_(visitor) { @@ -1132,4 +1217,15 @@ private: // helpers, for representation (below) >::type storage_t; +#ifndef BOOST_NO_CXX11_NOEXCEPT + typedef typename detail::variant::is_variant_move_noexcept_constructible< + internal_types + > variant_move_noexcept_constructible; + + typedef typename detail::variant::is_variant_move_noexcept_assignable< + internal_types + > variant_move_noexcept_assignable; + +#endif + private: // helpers, for representation (below) @@ -1171,10 +1267,10 @@ private: // helpers, for representation (below) storage_t storage_; - void indicate_which(int which_arg) + void indicate_which(int which_arg) BOOST_NOEXCEPT { which_ = static_cast<which_t>( which_arg ); } - void indicate_backup_which(int which_arg) + void indicate_backup_which(int which_arg) BOOST_NOEXCEPT { which_ = static_cast<which_t>( -(which_arg + 1) ); @@ -1183,5 +1279,5 @@ private: // helpers, for representation (below) private: // helpers, for queries (below) - bool using_backup() const + bool using_backup() const BOOST_NOEXCEPT { return which_ < 0; @@ -1190,5 +1286,5 @@ private: // helpers, for queries (below) public: // queries - int which() const + int which() const BOOST_NOEXCEPT { // If using heap backup... @@ -1210,5 +1306,5 @@ private: // helpers, for structors (below) }; - void destroy_content() + void destroy_content() BOOST_NOEXCEPT { detail::variant::destroyer visitor; @@ -1218,11 +1314,16 @@ private: // helpers, for structors (below) public: // structors - ~variant() + ~variant() BOOST_NOEXCEPT { destroy_content(); } - variant() + variant() BOOST_NOEXCEPT_IF(boost::has_nothrow_constructor<internal_T0>::value) { +#ifdef _MSC_VER +#pragma warning( push ) +// behavior change: an object of POD type constructed with an initializer of the form () will be default-initialized +#pragma warning( disable : 4345 ) +#endif // NOTE TO USER : // Compile error from here indicates that the first bound @@ -1232,4 +1333,7 @@ public: // structors new( storage_.address() ) internal_T0(); indicate_which(0); // zero is the index of the first bounded type +#ifdef _MSC_VER +#pragma warning( pop ) +#endif } @@ -1245,5 +1349,5 @@ private: // helpers, for structors, cont. (below) public: // structors - explicit convert_copy_into(void* storage) + explicit convert_copy_into(void* storage) BOOST_NOEXCEPT : storage_(storage) { @@ -1311,4 +1415,72 @@ private: // helpers, for structors, cont. (below) friend class convert_copy_into; +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + class convert_move_into + : public static_visitor<int> + { + private: // representation + + void* storage_; + + public: // structors + + explicit convert_move_into(void* storage) BOOST_NOEXCEPT + : storage_(storage) + { + } + + public: // internal visitor interfaces (below) + + template <typename T> + int internal_visit(T& operand, int) const + { + // NOTE TO USER : + // Compile error here indicates one of the source variant's types + // cannot be unambiguously converted to the destination variant's + // types (or that no conversion exists). + // + return initializer::initialize(storage_, detail::variant::move(operand) ); + } + + template <typename T> + int internal_visit(boost::detail::reference_content<T>& operand, long) const + { + return internal_visit( operand.get(), 1L ); + } + + template <typename T> + int internal_visit(const boost::detail::reference_content<T>& operand, long) const + { + return internal_visit( operand.get(), 1L ); + } + + template <typename T> + int internal_visit(boost::detail::variant::backup_holder<T>& operand, long) const + { + return internal_visit( operand.get(), 1L ); + } + + template <typename T> + int internal_visit(const boost::detail::variant::backup_holder<T>& operand, long) const + { + return internal_visit( operand.get(), 1L ); + } + + template <typename T> + int internal_visit(boost::recursive_wrapper<T>& operand, long) const + { + return internal_visit( operand.get(), 1L ); + } + + template <typename T> + int internal_visit(const boost::recursive_wrapper<T>& operand, long) const + { + return internal_visit( operand.get(), 1L ); + } + }; + + friend class convert_move_into; +#endif + private: // helpers, for structors, below @@ -1333,4 +1505,26 @@ private: // helpers, for structors, below } +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + template <typename T> + typename boost::enable_if<boost::is_rvalue_reference<T&&> >::type convert_construct( + T&& operand + , int + , mpl::false_ = mpl::false_() // is_foreign_variant + ) + { + // NOTE TO USER : + // Compile error here indicates that the given type is not + // unambiguously convertible to one of the variant's types + // (or that no conversion exists). + // + indicate_which( + initializer::initialize( + storage_.address() + , detail::variant::move(operand) + ) + ); + } +#endif + template <typename Variant> void convert_construct( @@ -1346,4 +1540,19 @@ private: // helpers, for structors, below } +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + template <typename Variant> + typename boost::enable_if<boost::is_rvalue_reference<Variant&&> >::type convert_construct( + Variant&& operand + , long + , mpl::true_// is_foreign_variant + ) + { + convert_move_into visitor(storage_.address()); + indicate_which( + operand.internal_apply_visitor(visitor) + ); + } +#endif + template <typename Variant> void convert_construct_variant(Variant& operand) @@ -1373,4 +1582,33 @@ private: // helpers, for structors, below } +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + template <typename Variant> + typename boost::enable_if<boost::is_rvalue_reference<Variant&&> >::type convert_construct_variant(Variant&& operand) + { + // [Determine if the given variant is itself a bounded type, or if its + // content needs to be converted (i.e., it is a 'foreign' variant):] + // + + typedef typename mpl::find_if< + types + , is_same< + add_const<mpl::_1> + , const Variant + > + >::type found_it; + + typedef typename mpl::end<types>::type not_found; + typedef typename is_same< + found_it, not_found + >::type is_foreign_variant; + + // Convert move construct from operand: + convert_construct( + detail::variant::move(operand), 1L + , is_foreign_variant() + ); + } +#endif + template <BOOST_VARIANT_ENUM_PARAMS(typename U)> void convert_construct( @@ -1391,4 +1629,15 @@ private: // helpers, for structors, below } +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + template <BOOST_VARIANT_ENUM_PARAMS(typename U)> + void convert_construct( + boost::variant<BOOST_VARIANT_ENUM_PARAMS(U)>&& operand + , long + ) + { + convert_construct_variant( detail::variant::move(operand) ); + } +#endif + public: // structors, cont. @@ -1440,6 +1689,14 @@ public: // structors, cont. convert_construct(operand, 1L); } - #endif // BOOST_VARIANT_AUX_BROKEN_CONSTRUCTOR_TEMPLATE_ORDERING workarounds + +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + template <class T> + variant(T&& operand, typename boost::enable_if<boost::is_rvalue_reference<T&&> >::type* = 0, + typename boost::disable_if<boost::is_const<T> >::type* = 0) + { + convert_construct( detail::variant::move(operand), 1L); + } +#endif public: // structors, cont. @@ -1455,4 +1712,16 @@ public: // structors, cont. indicate_which(operand.which()); } + +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + variant(variant&& operand) BOOST_NOEXCEPT_IF(variant_move_noexcept_constructible::type::value) + { + // Move the value of operand into *this... + detail::variant::move_into visitor( storage_.address() ); + operand.internal_apply_visitor(visitor); + + // ...and activate the *this's primary storage on success: + indicate_which(operand.which()); + } +#endif private: // helpers, for modifiers (below) @@ -1472,12 +1741,12 @@ private: // helpers, for modifiers (below) : public static_visitor<> { - private: // representation + protected: // representation variant& lhs_; - int rhs_which_; + const int rhs_which_; public: // structors - assigner(variant& lhs, int rhs_which) + assigner(variant& lhs, int rhs_which) BOOST_NOEXCEPT : lhs_(lhs) , rhs_which_(rhs_which) @@ -1485,13 +1754,13 @@ private: // helpers, for modifiers (below) } - private: // helpers, for internal visitor interface (below) + protected: // helpers, for internal visitor interface (below) template <typename RhsT, typename B1, typename B2> void assign_impl( const RhsT& rhs_content - , mpl::true_// has_nothrow_copy - , B1// has_nothrow_move_constructor - , B2// has_fallback_type - ) + , mpl::true_ // has_nothrow_copy + , B1 // is_nothrow_move_constructible + , B2 // has_fallback_type + ) const BOOST_NOEXCEPT { // Destroy lhs's content... @@ -1509,8 +1778,8 @@ private: // helpers, for modifiers (below) void assign_impl( const RhsT& rhs_content - , mpl::false_// has_nothrow_copy - , mpl::true_// has_nothrow_move_constructor - , B// has_fallback_type - ) + , mpl::false_ // has_nothrow_copy + , mpl::true_ // is_nothrow_move_constructible + , B // has_fallback_type + ) const { // Attempt to make a temporary copy (so as to move it below)... @@ -1528,16 +1797,27 @@ private: // helpers, for modifiers (below) } + void construct_fallback() const BOOST_NOEXCEPT { + // In case of failure, default-construct fallback type in lhs's storage... + new (lhs_.storage_.address()) + fallback_type_; // nothrow + + // ...indicate construction of fallback type... + lhs_.indicate_which( + BOOST_MPL_AUX_VALUE_WKND(fallback_type_index_)::value + ); // nothrow + } + template <typename RhsT> void assign_impl( const RhsT& rhs_content - , mpl::false_// has_nothrow_copy - , mpl::false_// has_nothrow_move_constructor - , mpl::true_// has_fallback_type - ) + , mpl::false_ // has_nothrow_copy + , mpl::false_ // is_nothrow_move_constructible + , mpl::true_ // has_fallback_type + ) const { // Destroy lhs's content... lhs_.destroy_content(); // nothrow - try + BOOST_TRY { // ...and attempt to copy rhs's content into lhs's storage: @@ -1545,18 +1825,12 @@ private: // helpers, for modifiers (below) RhsT( rhs_content ); } - catch (...) + BOOST_CATCH (...) { - // In case of failure, default-construct fallback type in lhs's storage... - new (lhs_.storage_.address()) - fallback_type_; // nothrow - - // ...indicate construction of fallback type... - lhs_.indicate_which( - BOOST_MPL_AUX_VALUE_WKND(fallback_type_index_)::value - ); // nothrow + construct_fallback(); // ...and rethrow: - throw; + BOOST_RETHROW; } + BOOST_CATCH_END // In the event of success, indicate new content type: @@ -1567,8 +1841,8 @@ private: // helpers, for modifiers (below) void assign_impl( const RhsT& rhs_content - , mpl::false_// has_nothrow_copy - , mpl::false_// has_nothrow_move_constructor - , mpl::false_// has_fallback_type - ) + , mpl::false_ // has_nothrow_copy + , mpl::false_ // is_nothrow_move_constructible + , mpl::false_ // has_fallback_type + ) const { detail::variant::backup_assigner<wknd_self_t> @@ -1581,5 +1855,5 @@ private: // helpers, for modifiers (below) template <typename RhsT> BOOST_VARIANT_AUX_RETURN_VOID_TYPE - internal_visit(const RhsT& rhs_content, int) + internal_visit(const RhsT& rhs_content, int) const { typedef typename has_nothrow_copy<RhsT>::type @@ -1587,5 +1861,5 @@ private: // helpers, for modifiers (below) typedef typename mpl::or_< // reduces compile-time nothrow_copy - , detail::variant::has_nothrow_move_constructor<RhsT> + , is_nothrow_move_constructible<RhsT> >::type nothrow_move_constructor; @@ -1606,6 +1880,129 @@ private: // helpers, for modifiers (below) #endif }; - + friend class assigner; + +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + // class move_assigner + // + // Internal visitor that "move assigns" the visited value to the given variant + // by appropriate destruction and move-construction. + // + + class move_assigner + : public assigner + { + public: // structors + + move_assigner(variant& lhs, int rhs_which) BOOST_NOEXCEPT + : assigner(lhs, rhs_which) + { + } + + private: // helpers, for internal visitor interface (below) + + template <typename RhsT, typename B2> + void assign_impl( + RhsT& rhs_content + , mpl::true_ // has_nothrow_copy + , mpl::false_ // is_nothrow_move_constructible + , B2 // has_fallback_type + ) const BOOST_NOEXCEPT + { + assigner::assign_impl(rhs_content, mpl::true_(), mpl::false_(), B2()); + } + + template <typename RhsT, typename B, typename B2> + void assign_impl( + RhsT& rhs_content + , B // has_nothrow_copy + , mpl::true_ // is_nothrow_move_constructible + , B2 // has_fallback_type + ) const BOOST_NOEXCEPT + { + // ...destroy lhs's content... + assigner::lhs_.destroy_content(); // nothrow + + // ...move the rhs_content into lhs's storage... + new(assigner::lhs_.storage_.address()) + RhsT( detail::variant::move(rhs_content) ); // nothrow + + // ...and indicate new content type: + assigner::lhs_.indicate_which(assigner::rhs_which_); // nothrow + } + + template <typename RhsT> + void assign_impl( + RhsT& rhs_content + , mpl::false_ // has_nothrow_copy + , mpl::false_ // is_nothrow_move_constructible + , mpl::true_ // has_fallback_type + ) const + { + // Destroy lhs's content... + assigner::lhs_.destroy_content(); // nothrow + + BOOST_TRY + { + // ...and attempt to copy rhs's content into lhs's storage: + new(assigner::lhs_.storage_.address()) + RhsT( detail::variant::move(rhs_content) ); + } + BOOST_CATCH (...) + { + assigner::construct_fallback(); + + // ...and rethrow: + BOOST_RETHROW; + } + BOOST_CATCH_END + + // In the event of success, indicate new content type: + assigner::lhs_.indicate_which(assigner::rhs_which_); // nothrow + } + + template <typename RhsT> + void assign_impl( + RhsT& rhs_content + , mpl::false_ // has_nothrow_copy + , mpl::false_ // is_nothrow_move_constructible + , mpl::false_ // has_fallback_type + ) const + { + assigner::assign_impl(rhs_content, mpl::false_(), mpl::false_(), mpl::false_()); + } + + public: // internal visitor interfaces + + template <typename RhsT> + BOOST_VARIANT_AUX_RETURN_VOID_TYPE + internal_visit(RhsT& rhs_content, int) const + { + typedef typename is_nothrow_move_constructible<RhsT>::type + nothrow_move_constructor; + typedef typename mpl::or_< // reduces compile-time + nothrow_move_constructor + , has_nothrow_copy<RhsT> + >::type nothrow_copy; + + assign_impl( + rhs_content + , nothrow_copy() + , nothrow_move_constructor() + , has_fallback_type_() + ); + + BOOST_VARIANT_AUX_RETURN_VOID; + } + +#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600)) + private: + // silence MSVC warning C4512: assignment operator could not be generated + move_assigner& operator= (move_assigner const&); +#endif + }; + + friend class move_assigner; +#endif // BOOST_NO_CXX11_RVALUE_REFERENCES void variant_assign(const variant& rhs) @@ -1626,4 +2023,23 @@ private: // helpers, for modifiers (below) } +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + void variant_assign(variant&& rhs) + { + // If the contained types are EXACTLY the same... + if (which_ == rhs.which_) + { + // ...then move rhs's storage to lhs's content: + detail::variant::move_storage visitor(rhs.storage_.address()); + this->internal_apply_visitor(visitor); + } + else + { + // Otherwise, perform general (move-based) variant assignment: + move_assigner visitor(*this, rhs.which()); + rhs.internal_apply_visitor(visitor); + } + } +#endif // BOOST_NO_CXX11_RVALUE_REFERENCES + private: // helpers, for modifiers (below) @@ -1646,6 +2062,36 @@ private: // helpers, for modifiers (below) } +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + template <typename T> + void move_assign(T&& rhs) + { + // If direct T-to-T move assignment is not possible... + detail::variant::direct_mover<T> direct_move(rhs); + if (this->apply_visitor(direct_move) == false) + { + // ...then convert rhs to variant and assign: + // + // While potentially inefficient, the following construction of a + // variant allows T as any type convertible to one of the bounded + // types without excessive code redundancy. + // + variant temp( detail::variant::move(rhs) ); + variant_assign( detail::variant::move(temp) ); + } + } +#endif // BOOST_NO_CXX11_RVALUE_REFERENCES + public: // modifiers +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + template <class T> + typename boost::enable_if_c<boost::is_rvalue_reference<T&&>::value && !boost::is_const<T>::value, variant& >::type + operator=(T&& rhs) + { + move_assign( detail::variant::move(rhs) ); + return *this; + } +#endif // BOOST_NO_CXX11_RVALUE_REFERENCES + template <typename T> variant& operator=(const T& rhs) @@ -1662,4 +2108,15 @@ public: // modifiers } +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + variant& operator=(variant&& rhs) +#if !defined(__GNUC__) || (__GNUC__ != 4) || (__GNUC_MINOR__ > 6) + BOOST_NOEXCEPT_IF(variant_move_noexcept_constructible::type::value && variant_move_noexcept_assignable::type::value) +#endif + { + variant_assign( detail::variant::move(rhs) ); + return *this; + } +#endif // BOOST_NO_CXX11_RVALUE_REFERENCES + void swap(variant& rhs) { @@ -1686,5 +2143,5 @@ public: // queries // - bool empty() const + bool empty() const BOOST_NOEXCEPT { return false; @@ -1701,24 +2158,10 @@ public: // queries public: // prevent comparison with foreign types -#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) - +// Obsolete. Remove. # define BOOST_VARIANT_AUX_FAIL_COMPARISON_RETURN_TYPE \ void -#else // MSVC7 - - // - // MSVC7 gives error about return types for above being different than - // the true comparison operator overloads: - // - -# define BOOST_VARIANT_AUX_FAIL_COMPARISON_RETURN_TYPE \ - bool - -#endif // MSVC7 workaround - template <typename U> - BOOST_VARIANT_AUX_FAIL_COMPARISON_RETURN_TYPE - operator==(const U&) const + void operator==(const U&) const { BOOST_STATIC_ASSERT( false && sizeof(U) ); @@ -1726,6 +2169,5 @@ public: // prevent comparison with foreign types template <typename U> - BOOST_VARIANT_AUX_FAIL_COMPARISON_RETURN_TYPE - operator<(const U&) const + void operator<(const U&) const { BOOST_STATIC_ASSERT( false && sizeof(U) ); @@ -1860,7 +2302,5 @@ struct make_variant_over private: // precondition assertions -#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) BOOST_STATIC_ASSERT(( ::boost::mpl::is_sequence<Types>::value )); -#endif public: // metafunction result diff --git a/3rdParty/Boost/src/boost/variant/variant_fwd.hpp b/3rdParty/Boost/src/boost/variant/variant_fwd.hpp index 133f437..a15b0a2 100644 --- a/3rdParty/Boost/src/boost/variant/variant_fwd.hpp +++ b/3rdParty/Boost/src/boost/variant/variant_fwd.hpp @@ -4,6 +4,6 @@ //----------------------------------------------------------------------------- // -// Copyright (c) 2003 -// Eric Friedman, Itay Maman +// Copyright (c) 2003 Eric Friedman, Itay Maman +// Copyright (c) 2013 Antony Polukhin // // Distributed under the Boost Software License, Version 1.0. (See @@ -27,14 +27,4 @@ /////////////////////////////////////////////////////////////////////////////// -// macro BOOST_VARIANT_LIMIT_TYPES -// -// Implementation-defined preprocessor symbol describing the actual -// length of variant's pseudo-variadic template parameter list. -// -#include "boost/mpl/limits/list.hpp" -#define BOOST_VARIANT_LIMIT_TYPES \ - BOOST_MPL_LIMIT_LIST_SIZE - -/////////////////////////////////////////////////////////////////////////////// // macro BOOST_VARIANT_NO_REFERENCE_SUPPORT // @@ -68,8 +58,89 @@ #if defined(BOOST_VARIANT_DETAIL_NO_SUBSTITUTE) \ - && !defined(BOOST_VARIANT_NO_FULL_RECURSIVE_VARIANT_SUPPORT) + && !defined(BOOST_VARIANT_NO_FULL_RECURSIVE_VARIANT_SUPPORT) # define BOOST_VARIANT_NO_FULL_RECURSIVE_VARIANT_SUPPORT #endif + +/////////////////////////////////////////////////////////////////////////////// +// macro BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES +// + +/* + GCC before 4.0 had no variadic tempaltes; + GCC 4.6 has incomplete implementation of variadic templates. + + MSVC2013 has variadic templates, but they have issues. +*/ +#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) \ + || (defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ < 7)) \ + || (defined(_MSC_VER) && (_MSC_VER <= 1800)) \ + || defined(BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE) \ + || defined (BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT) + +#ifndef BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES +# define BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES +#endif + +#endif + +#if !defined(BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES) +#include <boost/preprocessor/seq/size.hpp> + +#define BOOST_VARIANT_CLASS_OR_TYPENAME_TO_SEQ_class class)( +#define BOOST_VARIANT_CLASS_OR_TYPENAME_TO_SEQ_typename typename)( + +#define BOOST_VARIANT_CLASS_OR_TYPENAME_TO_VARIADIC_class class... +#define BOOST_VARIANT_CLASS_OR_TYPENAME_TO_VARIADIC_typename typename... + +#define ARGS_VARIADER_1(x) x ## N... +#define ARGS_VARIADER_2(x) BOOST_VARIANT_CLASS_OR_TYPENAME_TO_VARIADIC_ ## x ## N + +#define BOOST_VARIANT_MAKE_VARIADIC(sequence, x) BOOST_VARIANT_MAKE_VARIADIC_I(BOOST_PP_SEQ_SIZE(sequence), x) +#define BOOST_VARIANT_MAKE_VARIADIC_I(argscount, x) BOOST_VARIANT_MAKE_VARIADIC_II(argscount, x) +#define BOOST_VARIANT_MAKE_VARIADIC_II(argscount, orig) ARGS_VARIADER_ ## argscount(orig) + +/////////////////////////////////////////////////////////////////////////////// +// BOOST_VARIANT_ENUM_PARAMS and BOOST_VARIANT_ENUM_SHIFTED_PARAMS +// +// Convenience macro for enumeration of variant params. +// When variadic templates are available expands: +// BOOST_VARIANT_ENUM_PARAMS(class Something) => class Something0, class... SomethingN +// BOOST_VARIANT_ENUM_PARAMS(typename Something) => typename Something0, typename... SomethingN +// BOOST_VARIANT_ENUM_PARAMS(Something) => Something0, SomethingN... +// BOOST_VARIANT_ENUM_PARAMS(Something) => Something0, SomethingN... +// BOOST_VARIANT_ENUM_SHIFTED_PARAMS(class Something) => class... SomethingN +// BOOST_VARIANT_ENUM_SHIFTED_PARAMS(typename Something) => typename... SomethingN +// BOOST_VARIANT_ENUM_SHIFTED_PARAMS(Something) => SomethingN... +// BOOST_VARIANT_ENUM_SHIFTED_PARAMS(Something) => SomethingN... +// +// Rationale: Cleaner, simpler code for clients of variant library. Minimal +// code modifications to move from C++03 to C++11. +// +// With BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES defined +// will be used BOOST_VARIANT_ENUM_PARAMS and BOOST_VARIANT_ENUM_SHIFTED_PARAMS from below `#else` +// + +#define BOOST_VARIANT_ENUM_PARAMS(x) \ + x ## 0, \ + BOOST_VARIANT_MAKE_VARIADIC( (BOOST_VARIANT_CLASS_OR_TYPENAME_TO_SEQ_ ## x), x) \ + /**/ + +#define BOOST_VARIANT_ENUM_SHIFTED_PARAMS(x) \ + BOOST_VARIANT_MAKE_VARIADIC( (BOOST_VARIANT_CLASS_OR_TYPENAME_TO_SEQ_ ## x), x) \ + /**/ + +#else // defined(BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES) + +/////////////////////////////////////////////////////////////////////////////// +// macro BOOST_VARIANT_LIMIT_TYPES +// +// Implementation-defined preprocessor symbol describing the actual +// length of variant's pseudo-variadic template parameter list. +// +#include "boost/mpl/limits/list.hpp" +#define BOOST_VARIANT_LIMIT_TYPES \ + BOOST_MPL_LIMIT_LIST_SIZE + /////////////////////////////////////////////////////////////////////////////// // macro BOOST_VARIANT_RECURSIVE_VARIANT_MAX_ARITY @@ -101,4 +172,6 @@ BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_VARIANT_LIMIT_TYPES, param) +#endif // BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES workaround + namespace boost { @@ -140,5 +213,4 @@ struct convert_void< void_ > #if defined(BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE) - // (detail) tags voidNN -- NN defined on [0, BOOST_VARIANT_LIMIT_TYPES) // @@ -169,4 +241,8 @@ BOOST_PP_REPEAT( }} // namespace detail::variant +#if !defined(BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES) +# define BOOST_VARIANT_AUX_DECLARE_PARAMS BOOST_VARIANT_ENUM_PARAMS(typename T) +#else // defined(BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES) + /////////////////////////////////////////////////////////////////////////////// // (detail) macro BOOST_VARIANT_AUX_DECLARE_PARAM @@ -197,4 +273,6 @@ BOOST_PP_REPEAT( /**/ +#endif // BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES workaround + /////////////////////////////////////////////////////////////////////////////// // class template variant (concept inspired by Andrei Alexandrescu) diff --git a/3rdParty/Boost/src/boost/variant/visitor_ptr.hpp b/3rdParty/Boost/src/boost/variant/visitor_ptr.hpp index b49a972..4ddb921 100644 --- a/3rdParty/Boost/src/boost/variant/visitor_ptr.hpp +++ b/3rdParty/Boost/src/boost/variant/visitor_ptr.hpp @@ -19,4 +19,5 @@ #include "boost/mpl/eval_if.hpp" #include "boost/mpl/identity.hpp" +#include "boost/throw_exception.hpp" #include "boost/type_traits/add_reference.hpp" #include "boost/type_traits/is_reference.hpp" @@ -55,5 +56,5 @@ private: // private typedefs public: // structors - explicit visitor_ptr_t(visitor_t visitor) + explicit visitor_ptr_t(visitor_t visitor) BOOST_NOEXCEPT : visitor_(visitor) { @@ -65,5 +66,5 @@ public: // static visitor interfaces result_type operator()(const U&) const { - throw bad_visit(); + boost::throw_exception(bad_visit()); } |
Swift