| From 21f31f2ceb6d5669ca4e0bcc7b62cf1836eb7002 Mon Sep 17 00:00:00 2001 |
| From: Antony Polukhin <antoshkka@gmail.com> |
| Date: Thu, 20 Feb 2014 17:26:24 +0400 |
| Subject: [PATCH] Boost.Variant not can work without RTTI support. |
| |
| --- |
| include/boost/variant/variant.hpp | 19 +++++-------------- |
| 1 file changed, 5 insertions(+), 14 deletions(-) |
| |
| diff --git a/include/boost/variant/variant.hpp b/include/boost/variant/variant.hpp |
| index 46c3ae3..8604ba9 100644 |
| --- a/include/boost/variant/variant.hpp |
| +++ b/include/boost/variant/variant.hpp |
| @@ -18,9 +18,7 @@ |
| #include <cstddef> // for std::size_t |
| #include <new> // for placement new |
| |
| -#if !defined(BOOST_NO_TYPEID) |
| -#include <typeinfo> // for typeid, std::type_info |
| -#endif // BOOST_NO_TYPEID |
| +#include "boost/type_index.hpp" |
| |
| #include "boost/variant/detail/config.hpp" |
| #include "boost/mpl/aux_/value_wknd.hpp" |
| @@ -829,24 +827,19 @@ private: |
| // |
| // Generic static visitor that performs a typeid on the value it visits. |
| // |
| - |
| -#if !defined(BOOST_NO_TYPEID) |
| - |
| class reflect |
| - : public static_visitor<const std::type_info&> |
| + : public static_visitor<const boost::typeind::type_info&> |
| { |
| public: // visitor interfaces |
| |
| template <typename T> |
| - const std::type_info& operator()(const T&) const BOOST_NOEXCEPT |
| + const boost::typeind::type_info& operator()(const T&) const BOOST_NOEXCEPT |
| { |
| - return typeid(T); |
| + return boost::typeind::type_id<T>().type_info(); |
| } |
| |
| }; |
| |
| -#endif // BOOST_NO_TYPEID |
| - |
| /////////////////////////////////////////////////////////////////////////////// |
| // (detail) class comparer |
| // |
| @@ -2155,13 +2148,11 @@ public: // queries |
| return false; |
| } |
| |
| -#if !defined(BOOST_NO_TYPEID) |
| - const std::type_info& type() const |
| + const boost::typeind::type_info& type() const |
| { |
| detail::variant::reflect visitor; |
| return this->apply_visitor(visitor); |
| } |
| -#endif |
| |
| public: // prevent comparison with foreign types |
| |
| -- |
| 1.8.5.3 |
| |