From 2ebd172f4e01a425b51674b6a3fbace251331931 Mon Sep 17 00:00:00 2001 From: Antony Polukhin Date: Thu, 20 Feb 2014 18:53:05 +0400 Subject: [PATCH] Final cleanup of directory. Patches were updated. Minor bugfixes. --- include/boost/type_index/ctti_type_index.hpp | 5 + patched/README.md | 4 + patched/any/Jamfile.patch | 12 -- patched/any/any.patch | 91 ---------- patched/any/any_test.patch | 61 ------- patched/boost_any.patch | 131 +++++++++++++++ ...o.patch => boost_detail_sp_typeinfo.patch} | 57 ++++--- patched/boost_exception.patch | 156 ++++++++++++++++++ patched/boost_function.patch | 60 +++++++ patched/boost_smart_ptr.patch | 26 +++ patched/boost_test.patch | 58 +++++++ patched/boost_test_no_rtti.patch | 44 ----- .../variant.patch => boost_variant.patch} | 37 +++-- patched/detail/README.md | 1 - patched/graph/Jamfile.patch | 23 --- patched/graph/graphml.patch | 83 ---------- patched/graph/graphvis.patch | 30 ---- patched/graph/parallel/distribution.patch | 40 ----- patched/property_map/README.md | 3 - .../property_map/dynamic_property_map.patch | 80 --------- .../detail/ptree_implementation.patch | 22 --- patched/variant/Jamfile.patch | 12 -- patched/xpressive/linker.patch | 38 ----- patched/xpressive/match_result.patch | 33 ---- patched/xpressive/peeker.patch | 43 ----- todos.txt | 72 -------- 26 files changed, 503 insertions(+), 719 deletions(-) delete mode 100644 patched/any/Jamfile.patch delete mode 100644 patched/any/any.patch delete mode 100644 patched/any/any_test.patch create mode 100644 patched/boost_any.patch rename patched/{detail/sp_typeinfo.patch => boost_detail_sp_typeinfo.patch} (71%) create mode 100644 patched/boost_exception.patch create mode 100644 patched/boost_function.patch create mode 100644 patched/boost_smart_ptr.patch create mode 100644 patched/boost_test.patch delete mode 100644 patched/boost_test_no_rtti.patch rename patched/{variant/variant.patch => boost_variant.patch} (53%) delete mode 100644 patched/detail/README.md delete mode 100644 patched/graph/Jamfile.patch delete mode 100644 patched/graph/graphml.patch delete mode 100644 patched/graph/graphvis.patch delete mode 100644 patched/graph/parallel/distribution.patch delete mode 100644 patched/property_map/README.md delete mode 100644 patched/property_map/dynamic_property_map.patch delete mode 100644 patched/property_tree/detail/ptree_implementation.patch delete mode 100644 patched/variant/Jamfile.patch delete mode 100644 patched/xpressive/linker.patch delete mode 100644 patched/xpressive/match_result.patch delete mode 100644 patched/xpressive/peeker.patch delete mode 100644 todos.txt diff --git a/include/boost/type_index/ctti_type_index.hpp b/include/boost/type_index/ctti_type_index.hpp index 07006e2..b44fc22 100644 --- a/include/boost/type_index/ctti_type_index.hpp +++ b/include/boost/type_index/ctti_type_index.hpp @@ -84,6 +84,11 @@ public: }; +inline const ctti_type_index::type_info_t& ctti_type_index::type_info() const BOOST_NOEXCEPT { + return *data_; +} + + template inline ctti_type_index ctti_type_index::type_id() BOOST_NOEXCEPT { typedef BOOST_DEDUCED_TYPENAME boost::remove_reference::type no_ref_t; diff --git a/patched/README.md b/patched/README.md index 4a602ba..4dab0d6 100644 --- a/patched/README.md +++ b/patched/README.md @@ -3,3 +3,7 @@ patches for Boost libraries to work without RTTI Here are the patches that are TESTED and work well with RTTI disabled and enabled. Patches add tests for some of the libraries to make sure that library compile and work without RTTI. + +Patches remove duplicate code, improve output, allow compilation with RTTI off... + +Libraries Boost.Graph, Boost.XPressive, Boost.PropertyMap and others may also benefit from TypeIndex library. diff --git a/patched/any/Jamfile.patch b/patched/any/Jamfile.patch deleted file mode 100644 index 07eac20..0000000 --- a/patched/any/Jamfile.patch +++ /dev/null @@ -1,12 +0,0 @@ -Index: . -=================================================================== ---- . (revision 86520) -+++ . (working copy) -@@ -8,6 +8,7 @@ - - test-suite any : - [ run ../any_test.cpp ] -+ [ run ../any_test.cpp : : : off : testing_any_no_rtti ] - [ run any_test_rv.cpp ] - [ compile-fail any_cast_cv_failed.cpp ] - [ compile-fail any_test_temporary_to_ref_failed.cpp ] diff --git a/patched/any/any.patch b/patched/any/any.patch deleted file mode 100644 index 8502cfe..0000000 --- a/patched/any/any.patch +++ /dev/null @@ -1,91 +0,0 @@ -Index: . -=================================================================== ---- . (revision 86520) -+++ . (working copy) -@@ -15,7 +15,7 @@ - // when: July 2001, April 2013 - May 2013 - - #include --#include -+#include - - #include "boost/config.hpp" - #include -@@ -29,17 +29,6 @@ - #include - #include - --// See boost/python/type_id.hpp --// TODO: add BOOST_TYPEID_COMPARE_BY_NAME to config.hpp --# if defined(__GNUC__) \ -- || 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 -- - #if defined(_MSC_VER) - #pragma warning(push) - #pragma warning(disable: 4172) // Mistakenly warns: returning address of local variable or temporary -@@ -149,9 +138,9 @@ - any().swap(*this); - } - -- const std::type_info & type() const BOOST_NOEXCEPT -+ const boost::type_info & type() const BOOST_NOEXCEPT - { -- return content ? content->type() : typeid(void); -+ return content ? content->type() : boost::type_id(); - } - - #ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS -@@ -170,7 +159,7 @@ - - public: // queries - -- virtual const std::type_info & type() const BOOST_NOEXCEPT = 0; -+ virtual const boost::type_info & type() const BOOST_NOEXCEPT = 0; - - virtual placeholder * clone() const = 0; - -@@ -194,9 +183,9 @@ - #endif - public: // queries - -- virtual const std::type_info & type() const BOOST_NOEXCEPT -+ virtual const boost::type_info & type() const BOOST_NOEXCEPT - { -- return typeid(ValueType); -+ return boost::type_id(); - } - - virtual placeholder * clone() const -@@ -237,7 +226,12 @@ - lhs.swap(rhs); - } - -- class BOOST_SYMBOL_VISIBLE bad_any_cast : public std::bad_cast -+ class BOOST_SYMBOL_VISIBLE bad_any_cast : -+#ifndef BOOST_NO_RTTI -+ public std::bad_cast -+#else -+ public std::exception -+#endif - { - public: - virtual const char * what() const BOOST_NOEXCEPT_OR_NOTHROW -@@ -251,11 +245,7 @@ - ValueType * any_cast(any * operand) BOOST_NOEXCEPT - { - return operand && --#ifdef BOOST_AUX_ANY_TYPE_ID_NAME -- std::strcmp(operand->type().name(), typeid(ValueType).name()) == 0 --#else -- operand->type() == typeid(ValueType) --#endif -+ operand->type() == boost::type_id() - ? &static_cast *>(operand->content)->held - : 0; - } diff --git a/patched/any/any_test.patch b/patched/any/any_test.patch deleted file mode 100644 index 3f8d5ed..0000000 --- a/patched/any/any_test.patch +++ /dev/null @@ -1,61 +0,0 @@ -Index: . -=================================================================== ---- . (revision 86520) -+++ . (working copy) -@@ -91,7 +91,10 @@ - - check_true(value.empty(), "empty"); - check_null(any_cast(&value), "any_cast"); -+#ifndef BOOST_NO_RTTI - check_equal(value.type(), typeid(void), "type"); -+#endif -+ check_equal(value.type(), boost::type_id(), "type boost"); - } - - void test_converting_ctor() -@@ -100,7 +103,10 @@ - any value = text; - - check_false(value.empty(), "empty"); -+#ifndef BOOST_NO_RTTI - check_equal(value.type(), typeid(std::string), "type"); -+#endif -+ check_equal(value.type(), boost::type_id(), "type boost"); - check_null(any_cast(&value), "any_cast"); - check_non_null(any_cast(&value), "any_cast"); - check_equal( -@@ -158,7 +164,10 @@ - any * assign_result = &(value = text); - - check_false(value.empty(), "type"); -+#ifndef BOOST_NO_RTTI - check_equal(value.type(), typeid(std::string), "type"); -+#endif -+ check_equal(value.type(), boost::type_id(), "type boost"); - check_null(any_cast(&value), "any_cast"); - check_non_null(any_cast(&value), "any_cast"); - check_equal( -@@ -191,7 +200,10 @@ - - check_true(original.empty(), "empty on original"); - check_false(swapped.empty(), "empty on swapped"); -+#ifndef BOOST_NO_RTTI - check_equal(swapped.type(), typeid(std::string), "type"); -+#endif -+ check_equal(swapped.type(), boost::type_id(), "type boost"); - check_equal( - text, any_cast(swapped), - "comparing swapped copy against original text"); -@@ -264,8 +276,12 @@ - check_false(value1.empty(), "type"); - check_false(value2.empty(), "type"); - -+#ifndef BOOST_NO_RTTI - check_equal(value1.type(), typeid(const char*), "type"); - check_equal(value2.type(), typeid(const char*), "type"); -+#endif -+ check_equal(value1.type(), boost::type_id(), "type boost"); -+ check_equal(value2.type(), boost::type_id(), "type boost"); - - check_non_null(any_cast(&value1), "any_cast"); - check_non_null(any_cast(&value2), "any_cast"); diff --git a/patched/boost_any.patch b/patched/boost_any.patch new file mode 100644 index 0000000..688002c --- /dev/null +++ b/patched/boost_any.patch @@ -0,0 +1,131 @@ +From b59340efc30219492b095d2cfcdb8183b3e35b69 Mon Sep 17 00:00:00 2001 +From: Antony Polukhin +Date: Thu, 20 Feb 2014 17:06:44 +0400 +Subject: [PATCH 1/2] Boost.Any not can work without RTTI support. + +--- + test/Jamfile.v2 | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 +index cd167dc..76f9e5a 100644 +--- a/test/Jamfile.v2 ++++ b/test/Jamfile.v2 +@@ -9,6 +9,7 @@ + test-suite any : + [ run any_test.cpp ] + [ run any_test_rv.cpp ] ++ [ run any_test_rv.cpp : : : off : any_test_rv_no_rtti ] + [ compile-fail any_cast_cv_failed.cpp ] + [ compile-fail any_test_temporary_to_ref_failed.cpp ] + [ compile-fail any_test_cv_to_rv_failed.cpp ] +-- +1.8.5.3 + + +From 62b9b01713fc50355f82e892bc0fd5618ce5c648 Mon Sep 17 00:00:00 2001 +From: Antony Polukhin +Date: Thu, 20 Feb 2014 17:30:42 +0400 +Subject: [PATCH 2/2] Boost.Any not can work without RTTI support. + +--- + include/boost/any.hpp | 37 +++++++++++++------------------------ + 1 file changed, 13 insertions(+), 24 deletions(-) + +diff --git a/include/boost/any.hpp b/include/boost/any.hpp +index a63fea4..bda00a2 100644 +--- a/include/boost/any.hpp ++++ b/include/boost/any.hpp +@@ -15,9 +15,9 @@ + // when: July 2001, April 2013 - May 2013 + + #include +-#include + + #include "boost/config.hpp" ++#include + #include + #include + #include +@@ -29,17 +29,6 @@ + #include + #include + +-// See boost/python/type_id.hpp +-// TODO: add BOOST_TYPEID_COMPARE_BY_NAME to config.hpp +-# if defined(__GNUC__) \ +- || 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 +@@ -144,9 +133,9 @@ namespace boost + any().swap(*this); + } + +- const std::type_info & type() const BOOST_NOEXCEPT ++ const boost::typeind::type_info& type() const BOOST_NOEXCEPT + { +- return content ? content->type() : typeid(void); ++ return content ? content->type() : boost::typeind::type_id().type_info(); + } + + #ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS +@@ -165,7 +154,7 @@ namespace boost + + public: // queries + +- virtual const std::type_info & type() const BOOST_NOEXCEPT = 0; ++ virtual const boost::typeind::type_info& type() const BOOST_NOEXCEPT = 0; + + virtual placeholder * clone() const = 0; + +@@ -189,9 +178,9 @@ namespace boost + #endif + public: // queries + +- virtual const std::type_info & type() const BOOST_NOEXCEPT ++ virtual const boost::typeind::type_info& type() const BOOST_NOEXCEPT + { +- return typeid(ValueType); ++ return boost::typeind::type_id().type_info(); + } + + virtual placeholder * clone() const +@@ -232,7 +221,12 @@ namespace boost + lhs.swap(rhs); + } + +- class BOOST_SYMBOL_VISIBLE bad_any_cast : public std::bad_cast ++ class BOOST_SYMBOL_VISIBLE bad_any_cast : ++#ifndef BOOST_NO_RTTI ++ public std::bad_cast ++#else ++ public std::exception ++#endif + { + public: + virtual const char * what() const BOOST_NOEXCEPT_OR_NOTHROW +@@ -245,12 +239,7 @@ namespace boost + template + ValueType * any_cast(any * operand) BOOST_NOEXCEPT + { +- return operand && +-#ifdef BOOST_AUX_ANY_TYPE_ID_NAME +- std::strcmp(operand->type().name(), typeid(ValueType).name()) == 0 +-#else +- operand->type() == typeid(ValueType) +-#endif ++ return operand && operand->type() == boost::typeind::type_id() + ? &static_cast *>(operand->content)->held + : 0; + } +-- +1.8.5.3 + diff --git a/patched/detail/sp_typeinfo.patch b/patched/boost_detail_sp_typeinfo.patch similarity index 71% rename from patched/detail/sp_typeinfo.patch rename to patched/boost_detail_sp_typeinfo.patch index 2acb7b1..b0649e0 100644 --- a/patched/detail/sp_typeinfo.patch +++ b/patched/boost_detail_sp_typeinfo.patch @@ -1,29 +1,45 @@ -Index: . -=================================================================== ---- . (revision 86532) -+++ . (working copy) -@@ -15,121 +15,15 @@ +From b77c0af6af8bc4797defc3627878acc3cf7a6f39 Mon Sep 17 00:00:00 2001 +From: Antony Polukhin +Date: Thu, 20 Feb 2014 17:57:24 +0400 +Subject: [PATCH] detail/sp_typeinfo.hpp now uses TypeIndex + +--- + include/boost/detail/sp_typeinfo.hpp | 123 +++-------------------------------- + 1 file changed, 8 insertions(+), 115 deletions(-) + +diff --git a/include/boost/detail/sp_typeinfo.hpp b/include/boost/detail/sp_typeinfo.hpp +index 43fae78..fbdf86d 100644 +--- a/include/boost/detail/sp_typeinfo.hpp ++++ b/include/boost/detail/sp_typeinfo.hpp +@@ -10,126 +10,19 @@ + // detail/sp_typeinfo.hpp + // + // Copyright 2007 Peter Dimov ++// Copyright 2014 Antony Polukhin + // + // Distributed under the Boost Software License, Version 1.0. // See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#include -+#include - --#if defined( BOOST_NO_TYPEID ) ++#include +namespace boost { namespace detail { - --#include --#include -+typedef boost::type_info sp_typeinfo; - --namespace boost --{ ++ ++typedef boost::typeind::type_info sp_typeinfo; ++ +}} // namespace boost::detail +-#if defined( BOOST_NO_TYPEID ) +- +-#include +-#include +- +-namespace boost +-{ +- -namespace detail -{ -+#define BOOST_SP_TYPEID(T) (boost::type_id()) - +- -class sp_typeinfo -{ -private: @@ -127,6 +143,9 @@ Index: . -#define BOOST_SP_TYPEID(T) typeid(T) - -#endif -- ++#define BOOST_SP_TYPEID(T) (boost::typeind::type_id().type_info()) + #endif // #ifndef BOOST_DETAIL_SP_TYPEINFO_HPP_INCLUDED -+ +-- +1.8.5.3 + diff --git a/patched/boost_exception.patch b/patched/boost_exception.patch new file mode 100644 index 0000000..9b3643e --- /dev/null +++ b/patched/boost_exception.patch @@ -0,0 +1,156 @@ +From 8f57d59bfbc978673a2493a90b4f3e7e54ddbf18 Mon Sep 17 00:00:00 2001 +From: Antony Polukhin +Date: Thu, 20 Feb 2014 18:30:11 +0400 +Subject: [PATCH] Boost.Exception now uses TypeIndex to reduce duplicate code + and simplify name demanglings + +--- + include/boost/exception/detail/type_info.hpp | 43 +++------------------- + include/boost/exception/diagnostic_information.hpp | 2 +- + include/boost/exception/exception.hpp | 3 +- + include/boost/exception/info.hpp | 2 +- + test/Jamfile.v2 | 2 + + 5 files changed, 12 insertions(+), 40 deletions(-) + +diff --git a/include/boost/exception/detail/type_info.hpp b/include/boost/exception/detail/type_info.hpp +index 6e5942d..a247b71 100644 +--- a/include/boost/exception/detail/type_info.hpp ++++ b/include/boost/exception/detail/type_info.hpp +@@ -12,13 +12,7 @@ + #pragma warning(push,1) + #endif + +-#include +-#include +-#include +-//#ifndef BOOST_NO_TYPEID +-//#include +-//#endif +-#include ++#include + + namespace + boost +@@ -28,11 +22,7 @@ boost + std::string + tag_type_name() + { +-#ifdef BOOST_NO_TYPEID +- return BOOST_CURRENT_FUNCTION; +-#else +- return /*units::detail::demangle*/(typeid(T*).name()); +-#endif ++ return boost::typeind::type_id().pretty_name(); + } + + template +@@ -40,41 +30,20 @@ boost + std::string + type_name() + { +-#ifdef BOOST_NO_TYPEID +- return BOOST_CURRENT_FUNCTION; +-#else +- return /*units::detail::demangle*/(typeid(T).name()); +-#endif ++ return boost::typeind::type_id().pretty_name(); + } + + namespace + exception_detail + { +- struct +- type_info_ +- { +- detail::sp_typeinfo const * type_; +- +- explicit +- type_info_( detail::sp_typeinfo const & type ): +- type_(&type) +- { +- } +- +- friend +- bool +- operator<( type_info_ const & a, type_info_ const & b ) +- { +- return 0!=(a.type_->before(*b.type_)); +- } +- }; ++ typedef boost::typeind::type_index type_info_; + } + } + +-#define BOOST_EXCEPTION_STATIC_TYPEID(T) ::boost::exception_detail::type_info_(BOOST_SP_TYPEID(T)) ++#define BOOST_EXCEPTION_STATIC_TYPEID(T) ::boost::typeind::type_id() + + #ifndef BOOST_NO_RTTI +-#define BOOST_EXCEPTION_DYNAMIC_TYPEID(x) ::boost::exception_detail::type_info_(typeid(x)) ++#define BOOST_EXCEPTION_DYNAMIC_TYPEID(x) ::boost::typeind::type_id_runtime(x) + #endif + + #if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +diff --git a/include/boost/exception/diagnostic_information.hpp b/include/boost/exception/diagnostic_information.hpp +index 2f5cb88..0f8b5e8 100644 +--- a/include/boost/exception/diagnostic_information.hpp ++++ b/include/boost/exception/diagnostic_information.hpp +@@ -151,7 +151,7 @@ boost + #ifndef BOOST_NO_RTTI + if ( verbose ) + tmp << std::string("Dynamic exception type: ") << +- /*units::detail::demangle*/((be?(BOOST_EXCEPTION_DYNAMIC_TYPEID(*be)):(BOOST_EXCEPTION_DYNAMIC_TYPEID(*se))).type_->name()) << '\n'; ++ /*units::detail::demangle*/((be?(BOOST_EXCEPTION_DYNAMIC_TYPEID(*be)):(BOOST_EXCEPTION_DYNAMIC_TYPEID(*se)))) << '\n'; + #endif + if( with_what && se && verbose ) + tmp << "std::exception::what: " << wh << '\n'; +diff --git a/include/boost/exception/exception.hpp b/include/boost/exception/exception.hpp +index 9f20a04..53c341f 100644 +--- a/include/boost/exception/exception.hpp ++++ b/include/boost/exception/exception.hpp +@@ -12,6 +12,8 @@ + #pragma warning(push,1) + #endif + ++#include ++ + namespace + boost + { +@@ -151,7 +153,6 @@ boost + exception_detail + { + class error_info_base; +- struct type_info_; + + struct + error_info_container +diff --git a/include/boost/exception/info.hpp b/include/boost/exception/info.hpp +index edbf058..e0f4950 100644 +--- a/include/boost/exception/info.hpp ++++ b/include/boost/exception/info.hpp +@@ -96,7 +96,7 @@ boost + { + shared_ptr const & p = i->second; + #ifndef BOOST_NO_RTTI +- BOOST_ASSERT( *BOOST_EXCEPTION_DYNAMIC_TYPEID(*p).type_==*ti.type_ ); ++ BOOST_ASSERT(BOOST_EXCEPTION_DYNAMIC_TYPEID(*p)==ti ); + #endif + return p; + } +diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 +index d2dfcd6..5bd076d 100644 +--- a/test/Jamfile.v2 ++++ b/test/Jamfile.v2 +@@ -35,7 +35,9 @@ run enable_error_info_test.cpp helper1.cpp ; + run throw_exception_test.cpp helper2.cpp ; + run errno_test.cpp ; + run error_info_test.cpp ; ++run error_info_test.cpp : : : off : error_info_test_rtti ; + run diagnostic_information_test.cpp ; ++run diagnostic_information_test.cpp : : : off : diagnostic_information_test_rtti ; + run refcount_ptr_test.cpp ; + run current_exception_cast_test.cpp ; + run no_exceptions_test.cpp : : : off ; +-- +1.8.5.3 + diff --git a/patched/boost_function.patch b/patched/boost_function.patch new file mode 100644 index 0000000..54601a4 --- /dev/null +++ b/patched/boost_function.patch @@ -0,0 +1,60 @@ +From 6f71069e85fab36d9b95d53ddb6d80b8d1bdb6b0 Mon Sep 17 00:00:00 2001 +From: Antony Polukhin +Date: Thu, 20 Feb 2014 18:33:20 +0400 +Subject: [PATCH] Use TypeIndex in Boost.Function to remove duplicate code and + improve code performance + +--- + include/boost/function/function_base.hpp | 22 +--------------------- + test/Jamfile.v2 | 2 ++ + 2 files changed, 3 insertions(+), 21 deletions(-) + +diff --git a/include/boost/function/function_base.hpp b/include/boost/function/function_base.hpp +index f3663d7..8fd2c8d 100644 +--- a/include/boost/function/function_base.hpp ++++ b/include/boost/function/function_base.hpp +@@ -44,27 +44,7 @@ + # pragma warning( disable : 4127 ) // "conditional expression is constant" + #endif + +-// Define BOOST_FUNCTION_STD_NS to the namespace that contains type_info. +-#ifdef BOOST_NO_STD_TYPEINFO +-// Embedded VC++ does not have type_info in namespace std +-# define BOOST_FUNCTION_STD_NS +-#else +-# define BOOST_FUNCTION_STD_NS std +-#endif +- +-// Borrowed from Boost.Python library: determines the cases where we +-// need to use std::type_info::name to compare instead of operator==. +-#if defined( BOOST_NO_TYPEID ) +-# define BOOST_FUNCTION_COMPARE_TYPE_ID(X,Y) ((X)==(Y)) +-#elif defined(__GNUC__) \ +- || defined(_AIX) \ +- || ( defined(__sgi) && defined(__host_mips)) +-# include +-# define BOOST_FUNCTION_COMPARE_TYPE_ID(X,Y) \ +- (std::strcmp((X).name(),(Y).name()) == 0) +-# else +-# define BOOST_FUNCTION_COMPARE_TYPE_ID(X,Y) ((X)==(Y)) +-#endif ++#define BOOST_FUNCTION_COMPARE_TYPE_ID(X,Y) (boost::typeind::type_index((X))==(Y)) + + #if defined(__ICL) && __ICL <= 600 || defined(__MWERKS__) && __MWERKS__ < 0x2406 && !defined(BOOST_STRICT_CONFIG) + # define BOOST_FUNCTION_TARGET_FIX(x) x +diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 +index 68895fa..12a00db 100644 +--- a/test/Jamfile.v2 ++++ b/test/Jamfile.v2 +@@ -21,6 +21,8 @@ import testing ; + : + [ run libs/function/test/function_test.cpp : : : : lib_function_test ] + ++ [ run libs/function/test/function_test.cpp : : : off : lib_function_test_no_rtti ] ++ + [ run libs/function/test/function_n_test.cpp : : : : ] + + [ run libs/function/test/allocator_test.cpp ../../../libs/test/build//boost_test_exec_monitor : : : : ] +-- +1.8.5.3 + diff --git a/patched/boost_smart_ptr.patch b/patched/boost_smart_ptr.patch new file mode 100644 index 0000000..5120199 --- /dev/null +++ b/patched/boost_smart_ptr.patch @@ -0,0 +1,26 @@ +From 03194eefcb9c3314054855d28bd9a90d3188768d Mon Sep 17 00:00:00 2001 +From: Antony Polukhin +Date: Thu, 20 Feb 2014 18:50:10 +0400 +Subject: [PATCH] Use TypeIndex features in Boost.SharedPtr to avoid type_info + related bugs + +--- + include/boost/smart_ptr/detail/sp_counted_impl.hpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/boost/smart_ptr/detail/sp_counted_impl.hpp b/include/boost/smart_ptr/detail/sp_counted_impl.hpp +index a7b43ae..5955036 100644 +--- a/include/boost/smart_ptr/detail/sp_counted_impl.hpp ++++ b/include/boost/smart_ptr/detail/sp_counted_impl.hpp +@@ -155,7 +155,7 @@ public: + + virtual void * get_deleter( detail::sp_typeinfo const & ti ) + { +- return ti == BOOST_SP_TYPEID(D)? &reinterpret_cast( del ): 0; ++ return ti == boost::typeind::type_id()? &reinterpret_cast( del ): 0; + } + + virtual void * get_untyped_deleter() +-- +1.8.5.3 + diff --git a/patched/boost_test.patch b/patched/boost_test.patch new file mode 100644 index 0000000..e5348f1 --- /dev/null +++ b/patched/boost_test.patch @@ -0,0 +1,58 @@ +From fcd4da81d14847272fa888f4e9a54930b48ee95b Mon Sep 17 00:00:00 2001 +From: Antony Polukhin +Date: Sat, 11 Jan 2014 19:19:20 +0400 +Subject: [PATCH] Make Boost.Test work with RTTI disabled (fixes #9228) + +--- + include/boost/test/execution_monitor.hpp | 2 +- + include/boost/test/tree/test_case_template.hpp | 13 +++++++++++-- + 2 files changed, 12 insertions(+), 3 deletions(-) + +diff --git a/include/boost/test/execution_monitor.hpp b/include/boost/test/execution_monitor.hpp +index f6b7681..259f97c 100644 +--- a/include/boost/test/execution_monitor.hpp ++++ b/include/boost/test/execution_monitor.hpp +@@ -261,7 +261,7 @@ public: + template + void erase_exception_translator( boost::type* = 0 ) + { +- m_custom_translators = m_custom_translators->erase( m_custom_translators ); ++ m_custom_translators = m_custom_translators->template erase( m_custom_translators ); + } + + private: +diff --git a/include/boost/test/tree/test_case_template.hpp b/include/boost/test/tree/test_case_template.hpp +index 9f7466a..b0fa634 100644 +--- a/include/boost/test/tree/test_case_template.hpp ++++ b/include/boost/test/tree/test_case_template.hpp +@@ -34,8 +34,13 @@ + #include + #include + +-// STL ++#ifndef BOOST_NO_RTTI + #include // for typeid ++#else ++#include ++#endif ++ ++// STL + #include // for std::string + #include // for std::list + +@@ -77,7 +82,11 @@ struct generate_test_case_4_type { + std::string full_name; + assign_op( full_name, m_test_case_name, 0 ); + full_name += '<'; +- full_name += typeid(TestType).name(); ++#ifndef BOOST_NO_RTTI ++ full_name += typeid(TestType).name(); ++#else ++ full_name += BOOST_CURRENT_FUNCTION; ++#endif + if( boost::is_const::value ) + full_name += " const"; + full_name += '>'; +-- +1.8.5.3 + diff --git a/patched/boost_test_no_rtti.patch b/patched/boost_test_no_rtti.patch deleted file mode 100644 index f022315..0000000 --- a/patched/boost_test_no_rtti.patch +++ /dev/null @@ -1,44 +0,0 @@ -Index: trunk/boost/test/execution_monitor.hpp -=================================================================== ---- trunk/boost/test/execution_monitor.hpp (revision 86235) -+++ trunk/boost/test/execution_monitor.hpp (working copy) -@@ -261,7 +261,7 @@ - template - void erase_exception_translator( boost::type* = 0 ) - { -- m_custom_translators = m_custom_translators->erase( m_custom_translators ); -+ m_custom_translators = m_custom_translators->template erase( m_custom_translators ); - } - - private: -Index: trunk/boost/test/tree/test_case_template.hpp -=================================================================== ---- trunk/boost/test/tree/test_case_template.hpp (revision 86235) -+++ trunk/boost/test/tree/test_case_template.hpp (working copy) -@@ -34,8 +34,13 @@ - #include - #include - -+#ifndef BOOST_NO_RTTI -+#include // for typeid -+#else -+#include -+#endif -+ - // STL --#include // for typeid - #include // for std::string - #include // for std::list - -@@ -77,7 +82,11 @@ - std::string full_name; - assign_op( full_name, m_test_case_name, 0 ); - full_name += '<'; -+#ifndef BOOST_NO_RTTI - full_name += typeid(TestType).name(); -+#else -+ full_name += BOOST_CURRENT_FUNCTION; -+#endif - if( boost::is_const::value ) - full_name += " const"; - full_name += '>'; diff --git a/patched/variant/variant.patch b/patched/boost_variant.patch similarity index 53% rename from patched/variant/variant.patch rename to patched/boost_variant.patch index 0a96b94..9e2a844 100644 --- a/patched/variant/variant.patch +++ b/patched/boost_variant.patch @@ -1,7 +1,16 @@ -Index: . -=================================================================== ---- . (revision 86532) -+++ . (working copy) +From 21f31f2ceb6d5669ca4e0bcc7b62cf1836eb7002 Mon Sep 17 00:00:00 2001 +From: Antony Polukhin +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 // for std::size_t #include // for placement new @@ -9,28 +18,29 @@ Index: . -#if !defined(BOOST_NO_TYPEID) -#include // for typeid, std::type_info -#endif // BOOST_NO_TYPEID -+#include "boost/type_index/type_info.hpp" ++#include "boost/type_index.hpp" #include "boost/variant/detail/config.hpp" #include "boost/mpl/aux_/value_wknd.hpp" -@@ -830,23 +828,19 @@ +@@ -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 -+ : public static_visitor ++ : public static_visitor { public: // visitor interfaces template - const std::type_info& operator()(const T&) const BOOST_NOEXCEPT -+ const boost::type_info& operator()(const T&) const BOOST_NOEXCEPT ++ const boost::typeind::type_info& operator()(const T&) const BOOST_NOEXCEPT { - return typeid(T); -+ return boost::type_id(); ++ return boost::typeind::type_id().type_info(); } }; @@ -40,13 +50,13 @@ Index: . /////////////////////////////////////////////////////////////////////////////// // (detail) class comparer // -@@ -2155,13 +2149,11 @@ +@@ -2155,13 +2148,11 @@ public: // queries return false; } -#if !defined(BOOST_NO_TYPEID) - const std::type_info& type() const -+ const boost::type_info& type() const ++ const boost::typeind::type_info& type() const { detail::variant::reflect visitor; return this->apply_visitor(visitor); @@ -55,3 +65,6 @@ Index: . public: // prevent comparison with foreign types +-- +1.8.5.3 + diff --git a/patched/detail/README.md b/patched/detail/README.md deleted file mode 100644 index a5e2b55..0000000 --- a/patched/detail/README.md +++ /dev/null @@ -1 +0,0 @@ -To be honest sp_typeinfo.hpp won't be required with Boost.TypeIndex, because Boost.TypeIndex is more functional then sp_typeinfo and requires much less macro for usage. sp_typeinfo.patch contains a temporary solution for easy migration. Later sp_typeinfo may be removed and BOOST_SP_TYPEID(T) macro deprecated. diff --git a/patched/graph/Jamfile.patch b/patched/graph/Jamfile.patch deleted file mode 100644 index 401631c..0000000 --- a/patched/graph/Jamfile.patch +++ /dev/null @@ -1,23 +0,0 @@ -Index: . -=================================================================== ---- . (revision 86520) -+++ . (working copy) -@@ -59,6 +59,10 @@ - /boost/test//boost_test_exec_monitor/static - ../build//boost_graph - ../../regex/build//boost_regex : --log_level=all ] -+ [ run graphviz_test.cpp -+ /boost/test//boost_test_exec_monitor/static -+ ../build//boost_graph -+ ../../regex/build//boost_regex : --log_level=all : : off : testing_graphviz_no_rtti ] - [ run metis_test.cpp : $(METIS_INPUT_FILE) ] - [ run gursoy_atun_layout_test.cpp ] - [ run layout_test.cpp : : : always_show_run_output intel:off ] -@@ -124,6 +128,7 @@ - [ run two_graphs_common_spanning_trees_test.cpp ] - [ run random_spanning_tree_test.cpp ../build//boost_graph ] - [ run graphml_test.cpp ../build//boost_graph : : "graphml_test.xml" ] -+ [ run graphml_test.cpp ../build//boost_graph : : "graphml_test.xml" : off : testing_graphml_no_rtti ] - [ run mas_test.cpp ../../test/build//boost_unit_test_framework/static : $(TEST_DIR) ] - [ run stoer_wagner_test.cpp ../../test/build//boost_unit_test_framework/static : $(TEST_DIR) ] - [ compile filtered_graph_properties_dijkstra.cpp ] diff --git a/patched/graph/graphml.patch b/patched/graph/graphml.patch deleted file mode 100644 index 6fb75c4..0000000 --- a/patched/graph/graphml.patch +++ /dev/null @@ -1,83 +0,0 @@ -Index: . -=================================================================== ---- . (revision 86520) -+++ . (working copy) -@@ -18,7 +18,7 @@ - #include - #include - #include // for exceptions --#include -+#include - #include - #include - #include -@@ -218,16 +218,16 @@ - class get_type_name - { - public: -- get_type_name(const std::type_info& type, const char** type_names, std::string& type_name) -+ get_type_name(const boost::type_info& type, const char** type_names, std::string& type_name) - : m_type(type), m_type_names(type_names), m_type_name(type_name) {} - template - void operator()(Type) - { -- if (typeid(Type) == m_type) -+ if (boost::type_id() == m_type) - m_type_name = m_type_names[mpl::find::type::pos::value]; - } - private: -- const std::type_info &m_type; -+ const boost::type_info &m_type; - const char** m_type_names; - std::string &m_type_name; - }; -@@ -262,18 +262,18 @@ - for (dynamic_properties::const_iterator i = dp.begin(); i != dp.end(); ++i) - { - std::string key_id = "key" + lexical_cast(key_count++); -- if (i->second->key() == typeid(Graph*)) -+ if (i->second->key() == boost::type_id()) - graph_key_ids[i->first] = key_id; -- else if (i->second->key() == typeid(vertex_descriptor)) -+ else if (i->second->key() == boost::type_id()) - vertex_key_ids[i->first] = key_id; -- else if (i->second->key() == typeid(edge_descriptor)) -+ else if (i->second->key() == boost::type_id()) - edge_key_ids[i->first] = key_id; - else - continue; - std::string type_name = "string"; - mpl::for_each(get_type_name(i->second->value(), type_names, type_name)); - out << " second->key() == typeid(Graph*) ? "graph" : (i->second->key() == typeid(vertex_descriptor) ? "node" : "edge")) << "\"" -+ << (i->second->key() == boost::type_id() ? "graph" : (i->second->key() == boost::type_id() ? "node" : "edge")) << "\"" - << " attr.name=\"" << i->first << "\"" - << " attr.type=\"" << type_name << "\"" - << " />\n"; -@@ -287,7 +287,7 @@ - // Output graph data - for (dynamic_properties::const_iterator i = dp.begin(); i != dp.end(); ++i) - { -- if (i->second->key() == typeid(Graph*)) -+ if (i->second->key() == boost::type_id()) - { - // The const_cast here is just to get typeid correct for property - // map key; the graph should not be mutated using it. -@@ -304,7 +304,7 @@ - // Output data - for (dynamic_properties::const_iterator i = dp.begin(); i != dp.end(); ++i) - { -- if (i->second->key() == typeid(vertex_descriptor)) -+ if (i->second->key() == boost::type_id()) - { - out << " first] << "\">" - << encode_char_entities(i->second->get_string(*v)) << "\n"; -@@ -325,7 +325,7 @@ - // Output data - for (dynamic_properties::const_iterator i = dp.begin(); i != dp.end(); ++i) - { -- if (i->second->key() == typeid(edge_descriptor)) -+ if (i->second->key() == boost::type_id()) - { - out << " first] << "\">" - << encode_char_entities(i->second->get_string(*e)) << "\n"; diff --git a/patched/graph/graphvis.patch b/patched/graph/graphvis.patch deleted file mode 100644 index ad72648..0000000 --- a/patched/graph/graphvis.patch +++ /dev/null @@ -1,30 +0,0 @@ -Index: . -=================================================================== ---- . (revision 86520) -+++ . (working copy) -@@ -16,6 +16,7 @@ - #include - #include - #include // for FILE -+#include - #include - #include - #include -@@ -489,7 +490,7 @@ - bool first = true; - for (dynamic_properties::const_iterator i = dp->begin(); - i != dp->end(); ++i) { -- if (typeid(key) == i->second->key()) { -+ if (boost::type_id() == i->second->key()) { - if (first) out << " ["; - else out << ", "; - first = false; -@@ -518,7 +519,7 @@ - bool first = true; - for (dynamic_properties::const_iterator i = dp->begin(); - i != dp->end(); ++i) { -- if (typeid(key) == i->second->key() -+ if (boost::type_id() == i->second->key() - && i->first != *node_id) { - if (first) out << " ["; - else out << ", "; diff --git a/patched/graph/parallel/distribution.patch b/patched/graph/parallel/distribution.patch deleted file mode 100644 index 8d65cee..0000000 --- a/patched/graph/parallel/distribution.patch +++ /dev/null @@ -1,40 +0,0 @@ -Index: . -=================================================================== ---- . (revision 86520) -+++ . (working copy) -@@ -22,7 +22,7 @@ - #include - #include - #include --#include -+#include - - namespace boost { namespace parallel { - -@@ -71,7 +71,7 @@ - - virtual void* address() { return &distribution_; } - virtual const void* address() const { return &distribution_; } -- virtual const std::type_info& type() const { return typeid(Distribution); } -+ virtual const boost::type_info& type() const { return boost::type_id(); } - - private: - Distribution distribution_; -@@ -106,7 +106,7 @@ - template - T* as() - { -- if (distribution_->type() == typeid(T)) -+ if (distribution_->type() == boost::type_id()) - return static_cast(distribution_->address()); - else - return 0; -@@ -115,7 +115,7 @@ - template - const T* as() const - { -- if (distribution_->type() == typeid(T)) -+ if (distribution_->type() == boost::type_id()) - return static_cast(distribution_->address()); - else - return 0; diff --git a/patched/property_map/README.md b/patched/property_map/README.md deleted file mode 100644 index edc0074..0000000 --- a/patched/property_map/README.md +++ /dev/null @@ -1,3 +0,0 @@ -This patch requires additional care. - -It works and tested through the Boost.Graph tests, but in some places `typeid(variable)` were replaced with `typeid(Type)`. diff --git a/patched/property_map/dynamic_property_map.patch b/patched/property_map/dynamic_property_map.patch deleted file mode 100644 index 685b353..0000000 --- a/patched/property_map/dynamic_property_map.patch +++ /dev/null @@ -1,80 +0,0 @@ -Index: . -=================================================================== ---- . (revision 86520) -+++ . (working copy) -@@ -24,7 +24,7 @@ - #include - #include - #include --#include -+#include - #include - #include - #include -@@ -60,8 +60,8 @@ - virtual boost::any get(const any& key) = 0; - virtual std::string get_string(const any& key) = 0; - virtual void put(const any& key, const any& value) = 0; -- virtual const std::type_info& key() const = 0; -- virtual const std::type_info& value() const = 0; -+ virtual const boost::type_info& key() const = 0; -+ virtual const boost::type_info& value() const = 0; - }; - - -@@ -147,7 +147,7 @@ - using boost::put; - - key_type key = any_cast(in_key); -- if (in_value.type() == typeid(value_type)) { -+ if (in_value.type() == boost::type_id()) { - put(property_map_, key, any_cast(in_value)); - } else { - // if in_value is an empty string, put a default constructed value_type. -@@ -188,8 +188,8 @@ - writable_property_map_tag*>::value)>()); - } - -- virtual const std::type_info& key() const { return typeid(key_type); } -- virtual const std::type_info& value() const { return typeid(value_type); } -+ virtual const boost::type_info& key() const { return boost::type_id(); } -+ virtual const boost::type_info& value() const { return boost::type_id(); } - - PropertyMap& base() { return property_map_; } - const PropertyMap& base() const { return property_map_; } -@@ -283,7 +283,7 @@ - { - for (dynamic_properties::iterator i = dp.lower_bound(name); - i != dp.end() && i->first == name; ++i) { -- if (i->second->key() == typeid(key)) { -+ if (i->second->key() == boost::type_id()) { - i->second->put(key, value); - return true; - } -@@ -305,7 +305,7 @@ - { - for (dynamic_properties::const_iterator i = dp.lower_bound(name); - i != dp.end() && i->first == name; ++i) { -- if (i->second->key() == typeid(key)) -+ if (i->second->key() == boost::type_id()) - return any_cast(i->second->get(key)); - } - -@@ -318,7 +318,7 @@ - { - for (dynamic_properties::const_iterator i = dp.lower_bound(name); - i != dp.end() && i->first == name; ++i) { -- if (i->second->key() == typeid(key)) -+ if (i->second->key() == boost::type_id()) - return any_cast(i->second->get(key)); - } - -@@ -331,7 +331,7 @@ - { - for (dynamic_properties::const_iterator i = dp.lower_bound(name); - i != dp.end() && i->first == name; ++i) { -- if (i->second->key() == typeid(key)) -+ if (i->second->key() == boost::type_id()) - return i->second->get_string(key); - } - diff --git a/patched/property_tree/detail/ptree_implementation.patch b/patched/property_tree/detail/ptree_implementation.patch deleted file mode 100644 index ad08026..0000000 --- a/patched/property_tree/detail/ptree_implementation.patch +++ /dev/null @@ -1,22 +0,0 @@ -Index: . -=================================================================== ---- . (revision 86520) -+++ . (working copy) -@@ -650,7 +650,7 @@ - } - BOOST_PROPERTY_TREE_THROW(ptree_bad_data( - std::string("conversion of data to type \"") + -- typeid(Type).name() + "\" failed", data())); -+ boost::type_id().name_demangled() + "\" failed", data())); - } - - template -@@ -805,7 +805,7 @@ - data() = *o; - } else { - BOOST_PROPERTY_TREE_THROW(ptree_bad_data( -- std::string("conversion of type \"") + typeid(Type).name() + -+ std::string("conversion of type \"") + boost::type_id().name_demangled() + - "\" to data failed", boost::any())); - } - } diff --git a/patched/variant/Jamfile.patch b/patched/variant/Jamfile.patch deleted file mode 100644 index 4808b70..0000000 --- a/patched/variant/Jamfile.patch +++ /dev/null @@ -1,12 +0,0 @@ -Index: . -=================================================================== ---- . (revision 86532) -+++ . (working copy) -@@ -53,6 +53,7 @@ - clang:-fno-exceptions - : variant_noexcept_test - ] -+ [ run recursive_variant_test.cpp : : : off : variant_nortti_test ] - [ run variant_swap_test.cpp ] - ; - diff --git a/patched/xpressive/linker.patch b/patched/xpressive/linker.patch deleted file mode 100644 index 7e3f155..0000000 --- a/patched/xpressive/linker.patch +++ /dev/null @@ -1,38 +0,0 @@ -Index: . -=================================================================== ---- . (revision 86520) -+++ . (working copy) -@@ -19,7 +19,7 @@ - #endif - #include - #include --#include -+#include - #include - #include - #include -@@ -144,7 +144,7 @@ - explicit xpression_linker(Traits const &tr) - : back_stack_() - , traits_(&tr) -- , traits_type_(&typeid(Traits)) -+ , traits_type_(&boost::type_id()) - , has_backrefs_(false) - { - } -@@ -310,13 +310,13 @@ - template - Traits const &get_traits() const - { -- BOOST_ASSERT(*this->traits_type_ == typeid(Traits)); -+ BOOST_ASSERT(*this->traits_type_ == boost::type_id()); - return *static_cast(this->traits_); - } - - std::stack back_stack_; - void const *traits_; -- std::type_info const *traits_type_; -+ boost::type_info const *traits_type_; - bool has_backrefs_; - }; - diff --git a/patched/xpressive/match_result.patch b/patched/xpressive/match_result.patch deleted file mode 100644 index f6fe0ab..0000000 --- a/patched/xpressive/match_result.patch +++ /dev/null @@ -1,33 +0,0 @@ -Index: . -=================================================================== ---- . (revision 86520) -+++ . (working copy) -@@ -25,9 +25,9 @@ - #include - #include - #include --#include - #include - #include -+#include - #include - #include - #include -@@ -72,7 +72,7 @@ - // - struct type_info_less - { -- bool operator()(std::type_info const *left, std::type_info const *right) const -+ bool operator()(boost::type_info const *left, boost::type_info const *right) const - { - return 0 != left->before(*right); - } -@@ -679,7 +679,7 @@ - typedef typename proto::result_of::value::type arg_right_type; - BOOST_MPL_ASSERT((proto::matches)); - BOOST_MPL_ASSERT((is_same)); -- this->args_[&typeid(proto::value(proto::left(arg)))] = &proto::value(proto::right(arg)); -+ this->args_[&boost::type_id()] = &proto::value(proto::right(arg)); - return *this; - } - diff --git a/patched/xpressive/peeker.patch b/patched/xpressive/peeker.patch deleted file mode 100644 index 8d46b0c..0000000 --- a/patched/xpressive/peeker.patch +++ /dev/null @@ -1,43 +0,0 @@ -Index: . -=================================================================== ---- . (revision 86520) -+++ . (working copy) -@@ -14,7 +14,7 @@ - #endif - - #include --#include -+#include - #include - #include - #include -@@ -250,9 +250,9 @@ - if(0 == this->traits_) - { - this->traits_ = &tr; -- this->traits_type_ = &typeid(Traits); -+ this->traits_type_ = &boost::type_id(); - } -- else if(*this->traits_type_ != typeid(Traits) || this->get_traits_() != tr) -+ else if(*this->traits_type_ != boost::type_id() || this->get_traits_() != tr) - { - this->fail(); // traits mis-match! set all and bail - } -@@ -265,7 +265,7 @@ - template - Traits const &get_traits_() const - { -- BOOST_ASSERT(!!(*this->traits_type_ == typeid(Traits))); -+ BOOST_ASSERT(!!(*this->traits_type_ == boost::type_id())); - return *static_cast(this->traits_); - } - -@@ -274,7 +274,7 @@ - bool str_icase_; - bool line_start_; - void const *traits_; -- std::type_info const *traits_type_; -+ boost::type_info const *traits_type_; - int leading_simple_repeat_; - bool has_backrefs_; - }; diff --git a/todos.txt b/todos.txt deleted file mode 100644 index 89184bb..0000000 --- a/todos.txt +++ /dev/null @@ -1,72 +0,0 @@ -Sketch of TypeIndex v3 library interface: - -// boost/type_index/type_index_base.hpp -namespace boost{ namespace typeind { - -namespce detail { - -template -class type_index_base - const TypeInfo* data_; - -public: -type_index_base(const TypeInfo&); - -const char* raw_name() const noexcept; -const char* name() const noexcept; -const char* pretty_name() const; -std::size_t hash_value() const noexcept; -const TypeInfo& type_info() const noexcept; - -// comparison operators -}; - -}}} // namespace boost::typeind::detail - - -// boost/type_index.hpp -/// Contians core functionality for everyday use -namespace boost{ namespace typeind { - -// MSVC is capable of calling typeid(T) even when RTTI is off -#if (!defined(BOOST_NO_RTTI) && !defined(BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY)) || defined(BOOST_MSVC) -typedef std::type_info type_info; // RTTI on/off dependent -typedef type_index_base type_index; -#else -#else -#endif - -inline bool is_equal(const type_info&, const type_info&) noexcept; - -template -type_index type_id() noexcept; - -template -type_index type_id_with_cvr() noexcept; - -template -type_index type_id_runtime(const T&) noexcept; - -template -type_index type_id_runtime(const T*) noexcept; - -/* macro that must be put inside class to allow `type_id_runtime` calls with RTTI disabled */ -/// Empty if RTTI is on -#define BOOST_TYPE_INDEX_REGISTER_CLASS - -}} // namespace boost::typeind - -// boost/type_index/ctti.hpp -/// Contians minimal functionality required by boost/type_index.hpp with RTTI off -namespace boost { namespace detail { - template - struct ctti { - /// Returns raw name. Must be as short, as possible, to avoid code bloat - static const char* n() noexcept; - }; -} // namespace detail - -namespace typeind { - // Will be used instead of std::type_info when RTTI is off - class ctti_data; // POD. Interface is close to std::type_info -}}