// 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
+// when: July 2001, April 2013 - 2019
#include <algorithm>
#include <boost/core/addressof.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/is_const.hpp>
-#include <boost/mpl/if.hpp>
+#include <boost/type_traits/conditional.hpp>
namespace boost
{
{
public: // structors
- any() BOOST_NOEXCEPT
+ BOOST_CONSTEXPR any() BOOST_NOEXCEPT
: content(0)
{
}
any & operator=(any rhs)
{
- any(rhs).swap(*this);
+ rhs.swap(*this);
return *this;
}
return *this;
}
- // move assignement
+ // move assignment
any & operator=(any&& rhs) BOOST_NOEXCEPT
{
rhs.swap(*this);
public: // types (public so any_cast can be non-friend)
#endif
- class placeholder
+ class BOOST_SYMBOL_VISIBLE placeholder
{
public: // structors
};
template<typename ValueType>
- class holder : public placeholder
+ class holder
+#ifndef BOOST_NO_CXX11_FINAL
+ final
+#endif
+ : public placeholder
{
public: // structors
// `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>,
+ typedef BOOST_DEDUCED_TYPENAME boost::conditional<
+ boost::is_reference<ValueType>::value,
ValueType,
BOOST_DEDUCED_TYPENAME boost::add_reference<ValueType>::type
>::type ref_type;
}
// Copyright Kevlin Henney, 2000, 2001, 2002. All rights reserved.
+// Copyright Antony Polukhin, 2013-2019.
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at