Ticket #10346: any_without_rtti.patch

File any_without_rtti.patch, 2.2 KB (added by Minmin Gong <gongminmin@…>, 8 years ago)
  • boost/boost/any.hpp

    diff -r 72f5890881c2 boost/boost/any.hpp
    a b  
    1515// when:  July 2001, April 2013 - May 2013
    1616
    1717#include <algorithm>
    18 #include <typeinfo>
    1918
    2019#include "boost/config.hpp"
    2120#include <boost/type_traits/remove_reference.hpp>
     
    2827#include <boost/utility/enable_if.hpp>
    2928#include <boost/type_traits/is_same.hpp>
    3029#include <boost/type_traits/is_const.hpp>
     30#include <boost/core/typeinfo.hpp>
    3131
    3232// See boost/python/type_id.hpp
    3333// TODO: add BOOST_TYPEID_COMPARE_BY_NAME to config.hpp
     
    144144            any().swap(*this);
    145145        }
    146146
    147         const std::type_info & type() const BOOST_NOEXCEPT
     147        const boost::core::typeinfo & type() const BOOST_NOEXCEPT
    148148        {
    149             return content ? content->type() : typeid(void);
     149            return content ? content->type() : BOOST_CORE_TYPEID(void);
    150150        }
    151151
    152152#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
     
    165165
    166166        public: // queries
    167167
    168             virtual const std::type_info & type() const BOOST_NOEXCEPT = 0;
     168            virtual const boost::core::typeinfo & type() const BOOST_NOEXCEPT = 0;
    169169
    170170            virtual placeholder * clone() const = 0;
    171171
     
    189189#endif
    190190        public: // queries
    191191
    192             virtual const std::type_info & type() const BOOST_NOEXCEPT
     192            virtual const boost::core::typeinfo & type() const BOOST_NOEXCEPT
    193193            {
    194                 return typeid(ValueType);
     194                return BOOST_CORE_TYPEID(ValueType);
    195195            }
    196196
    197197            virtual placeholder * clone() const
     
    247247    {
    248248        return operand &&
    249249#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
    251251#else
    252             operand->type() == typeid(ValueType)
     252            operand->type() == BOOST_CORE_TYPEID(ValueType)
    253253#endif
    254254            ? &static_cast<any::holder<ValueType> *>(operand->content)->held
    255255            : 0;