X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=boost%2Fboost%2Fany.hpp;h=a8c654c373bc34d34fa024cc02d91bb62b85a4d4;hb=43c09d723435a5b203f2ac0c39e2086de836b386;hp=483daca32e62e306ba8e9512178a3e1efec49f08;hpb=c2f99181e60c3b92ddeed85a5910ac856d155810;p=lyx.git diff --git a/boost/boost/any.hpp b/boost/boost/any.hpp index 483daca32e..a8c654c373 100644 --- a/boost/boost/any.hpp +++ b/boost/boost/any.hpp @@ -19,6 +19,17 @@ #include #include +// See boost/python/type_id.hpp +// TODO: add BOOST_TYPEID_COMPARE_BY_NAME to config.hpp +# if (defined(__GNUC__) && __GNUC__ >= 3) \ + || defined(_AIX) \ + || ( defined(__sgi) && defined(__host_mips)) \ + || (defined(__hpux) && defined(__HP_aCC)) \ + || (defined(linux) && defined(__INTEL_COMPILER) && defined(__ICC)) +# define BOOST_AUX_ANY_TYPE_ID_NAME +#include +# endif + namespace boost { class any @@ -61,9 +72,9 @@ namespace boost return *this; } - any & operator=(const any & rhs) + any & operator=(any rhs) { - any(rhs).swap(*this); + rhs.swap(*this); return *this; } @@ -164,9 +175,14 @@ namespace boost template ValueType * any_cast(any * operand) { - return operand && operand->type() == typeid(ValueType) - ? &static_cast *>(operand->content)->held - : 0; + return operand && +#ifdef BOOST_AUX_ANY_TYPE_ID_NAME + std::strcmp(operand->type().name(), typeid(ValueType).name()) == 0 +#else + operand->type() == typeid(ValueType) +#endif + ? &static_cast *>(operand->content)->held + : 0; } template