diff -r 72f5890881c2 boost/boost/any.hpp
|
a
|
b
|
|
| 15 | 15 | // when: July 2001, April 2013 - May 2013 |
| 16 | 16 | |
| 17 | 17 | #include <algorithm> |
| 18 | | #include <typeinfo> |
| 19 | 18 | |
| 20 | 19 | #include "boost/config.hpp" |
| 21 | 20 | #include <boost/type_traits/remove_reference.hpp> |
| … |
… |
|
| 28 | 27 | #include <boost/utility/enable_if.hpp> |
| 29 | 28 | #include <boost/type_traits/is_same.hpp> |
| 30 | 29 | #include <boost/type_traits/is_const.hpp> |
| | 30 | #include <boost/core/typeinfo.hpp> |
| 31 | 31 | |
| 32 | 32 | // See boost/python/type_id.hpp |
| 33 | 33 | // TODO: add BOOST_TYPEID_COMPARE_BY_NAME to config.hpp |
| … |
… |
|
| 144 | 144 | any().swap(*this); |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | | const std::type_info & type() const BOOST_NOEXCEPT |
| | 147 | const boost::core::typeinfo & type() const BOOST_NOEXCEPT |
| 148 | 148 | { |
| 149 | | return content ? content->type() : typeid(void); |
| | 149 | return content ? content->type() : BOOST_CORE_TYPEID(void); |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | #ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS |
| … |
… |
|
| 165 | 165 | |
| 166 | 166 | public: // queries |
| 167 | 167 | |
| 168 | | virtual const std::type_info & type() const BOOST_NOEXCEPT = 0; |
| | 168 | virtual const boost::core::typeinfo & type() const BOOST_NOEXCEPT = 0; |
| 169 | 169 | |
| 170 | 170 | virtual placeholder * clone() const = 0; |
| 171 | 171 | |
| … |
… |
|
| 189 | 189 | #endif |
| 190 | 190 | public: // queries |
| 191 | 191 | |
| 192 | | virtual const std::type_info & type() const BOOST_NOEXCEPT |
| | 192 | virtual const boost::core::typeinfo & type() const BOOST_NOEXCEPT |
| 193 | 193 | { |
| 194 | | return typeid(ValueType); |
| | 194 | return BOOST_CORE_TYPEID(ValueType); |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | virtual placeholder * clone() const |
| … |
… |
|
| 247 | 247 | { |
| 248 | 248 | return operand && |
| 249 | 249 | #ifdef BOOST_AUX_ANY_TYPE_ID_NAME |
| 250 | | std::strcmp(operand->type().name(), typeid(ValueType).name()) == 0 |
| | 250 | std::strcmp(operand->type().name(), BOOST_CORE_TYPEID(ValueType).name()) == 0 |
| 251 | 251 | #else |
| 252 | | operand->type() == typeid(ValueType) |
| | 252 | operand->type() == BOOST_CORE_TYPEID(ValueType) |
| 253 | 253 | #endif |
| 254 | 254 | ? &static_cast<any::holder<ValueType> *>(operand->content)->held |
| 255 | 255 | : 0; |