同步操作将从 cutself/proj 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
// See http://www.boost.org/libs/any for Documentation.#ifndef BOOST_ANY_INCLUDED#define BOOST_ANY_INCLUDED#if defined(_MSC_VER)# pragma once#endif// what: variant type boost::any// who: contributed by Kevlin Henney,// with features contributed and bugs found by// Antony Polukhin, Ed Brey, Mark Rodgers,// Peter Dimov, and James Curran// when: July 2001, April 2013 - May 2013#include <algorithm>#include "boost/config.hpp"#include <boost/type_index.hpp>#include <boost/type_traits/remove_reference.hpp>#include <boost/type_traits/decay.hpp>#include <boost/type_traits/remove_cv.hpp>#include <boost/type_traits/add_reference.hpp>#include <boost/type_traits/is_reference.hpp>#include <boost/type_traits/is_const.hpp>#include <boost/throw_exception.hpp>#include <boost/static_assert.hpp>#include <boost/utility/enable_if.hpp>#include <boost/type_traits/is_same.hpp>#include <boost/type_traits/is_const.hpp>#include <boost/mpl/if.hpp>namespace boost{class any{public: // structorsany() BOOST_NOEXCEPT: content(0){}template<typename ValueType>any(const ValueType & value): content(new holder<BOOST_DEDUCED_TYPENAME remove_cv<BOOST_DEDUCED_TYPENAME decay<const ValueType>::type>::type>(value)){}any(const any & other): content(other.content ? other.content->clone() : 0){}#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES// Move constructorany(any&& other) BOOST_NOEXCEPT: content(other.content){other.content = 0;}// Perfect forwarding of ValueTypetemplate<typename ValueType>any(ValueType&& value, typename boost::disable_if<boost::is_same<any&, ValueType> >::type* = 0 // disable if value has type `any&`, typename boost::disable_if<boost::is_const<ValueType> >::type* = 0) // disable if value has type `const ValueType&&`: content(new holder< typename decay<ValueType>::type >(static_cast<ValueType&&>(value))){}#endif~any() BOOST_NOEXCEPT{delete content;}public: // modifiersany & swap(any & rhs) BOOST_NOEXCEPT{std::swap(content, rhs.content);return *this;}#ifdef BOOST_NO_CXX11_RVALUE_REFERENCEStemplate<typename ValueType>any & operator=(const ValueType & rhs){any(rhs).swap(*this);return *this;}any & operator=(any rhs){any(rhs).swap(*this);return *this;}#elseany & operator=(const any& rhs){any(rhs).swap(*this);return *this;}// move assignementany & operator=(any&& rhs) BOOST_NOEXCEPT{rhs.swap(*this);any().swap(rhs);return *this;}// Perfect forwarding of ValueTypetemplate <class ValueType>any & operator=(ValueType&& rhs){any(static_cast<ValueType&&>(rhs)).swap(*this);return *this;}#endifpublic: // queriesbool empty() const BOOST_NOEXCEPT{return !content;}void clear() BOOST_NOEXCEPT{any().swap(*this);}const boost::typeindex::type_info& type() const BOOST_NOEXCEPT{return content ? content->type() : boost::typeindex::type_id<void>().type_info();}#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDSprivate: // types#elsepublic: // types (public so any_cast can be non-friend)#endifclass placeholder{public: // structorsvirtual ~placeholder(){}public: // queriesvirtual const boost::typeindex::type_info& type() const BOOST_NOEXCEPT = 0;virtual placeholder * clone() const = 0;};template<typename ValueType>class holder : public placeholder{public: // structorsholder(const ValueType & value): held(value){}#ifndef BOOST_NO_CXX11_RVALUE_REFERENCESholder(ValueType&& value): held(static_cast< ValueType&& >(value)){}#endifpublic: // queriesvirtual const boost::typeindex::type_info& type() const BOOST_NOEXCEPT{return boost::typeindex::type_id<ValueType>().type_info();}virtual placeholder * clone() const{return new holder(held);}public: // representationValueType held;private: // intentionally left unimplementedholder & operator=(const holder &);};#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDSprivate: // representationtemplate<typename ValueType>friend ValueType * any_cast(any *) BOOST_NOEXCEPT;template<typename ValueType>friend ValueType * unsafe_any_cast(any *) BOOST_NOEXCEPT;#elsepublic: // representation (public so any_cast can be non-friend)#endifplaceholder * content;};inline void swap(any & lhs, any & rhs) BOOST_NOEXCEPT{lhs.swap(rhs);}class BOOST_SYMBOL_VISIBLE bad_any_cast :#ifndef BOOST_NO_RTTIpublic std::bad_cast#elsepublic std::exception#endif{public:virtual const char * what() const BOOST_NOEXCEPT_OR_NOTHROW{return "boost::bad_any_cast: ""failed conversion using boost::any_cast";}};template<typename ValueType>ValueType * any_cast(any * operand) BOOST_NOEXCEPT{return operand && operand->type() == boost::typeindex::type_id<ValueType>()? &static_cast<any::holder<BOOST_DEDUCED_TYPENAME remove_cv<ValueType>::type> *>(operand->content)->held: 0;}template<typename ValueType>inline const ValueType * any_cast(const any * operand) BOOST_NOEXCEPT{return any_cast<ValueType>(const_cast<any *>(operand));}template<typename ValueType>ValueType any_cast(any & operand){typedef BOOST_DEDUCED_TYPENAME remove_reference<ValueType>::type nonref;nonref * result = any_cast<nonref>(&operand);if(!result)boost::throw_exception(bad_any_cast());// Attempt to avoid construction of a temporary object in cases when// `ValueType` is not a reference. Example:// `static_cast<std::string>(*result);`// which is equal to `std::string(*result);`typedef BOOST_DEDUCED_TYPENAME boost::mpl::if_<boost::is_reference<ValueType>,ValueType,BOOST_DEDUCED_TYPENAME boost::add_reference<ValueType>::type>::type ref_type;return static_cast<ref_type>(*result);}template<typename ValueType>inline ValueType any_cast(const any & operand){typedef BOOST_DEDUCED_TYPENAME remove_reference<ValueType>::type nonref;return any_cast<const nonref &>(const_cast<any &>(operand));}#ifndef BOOST_NO_CXX11_RVALUE_REFERENCEStemplate<typename ValueType>inline ValueType any_cast(any&& operand){BOOST_STATIC_ASSERT_MSG(boost::is_rvalue_reference<ValueType&&>::value /*true if ValueType is rvalue or just a value*/|| boost::is_const< typename boost::remove_reference<ValueType>::type >::value,"boost::any_cast shall not be used for getting nonconst references to temporary objects");return any_cast<ValueType>(operand);}#endif// Note: The "unsafe" versions of any_cast are not part of the// public interface and may be removed at any time. They are// required where we know what type is stored in the any and can't// use typeid() comparison, e.g., when our types may travel across// different shared libraries.template<typename ValueType>inline ValueType * unsafe_any_cast(any * operand) BOOST_NOEXCEPT{return &static_cast<any::holder<ValueType> *>(operand->content)->held;}template<typename ValueType>inline const ValueType * unsafe_any_cast(const any * operand) BOOST_NOEXCEPT{return unsafe_any_cast<ValueType>(const_cast<any *>(operand));}}// Copyright Kevlin Henney, 2000, 2001, 2002. All rights reserved.//// 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)#endif
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。