From cadd22c74d9aff3cbb1184c6addb66b9d4571b68 Mon Sep 17 00:00:00 2001 From: Antony Polukhin Date: Tue, 29 Oct 2013 17:08:28 +0400 Subject: [PATCH] Docs and doxygen markup updated --- boost/type_index/template_info.hpp | 21 ++++++++++++++++++++- boost/type_index/type_index.hpp | 15 ++++++++++++--- boost/type_index/type_info.hpp | 8 ++++++++ libs/type_index/doc/Jamfile.v2 | 1 + libs/type_index/doc/type_index.qbk | 6 +++--- 5 files changed, 44 insertions(+), 7 deletions(-) diff --git a/boost/type_index/template_info.hpp b/boost/type_index/template_info.hpp index 0876b5a..c06262d 100644 --- a/boost/type_index/template_info.hpp +++ b/boost/type_index/template_info.hpp @@ -97,8 +97,27 @@ inline void lazy_function_signature_assert() { } #endif +#if defined(BOOST_TYPE_INDEX_DOXYGEN_INVOKED) -#if defined(BOOST_TYPE_INDEX_CTTI_BEGIN_SKIP) && defined(BOOST_TYPE_INDEX_CTTI_END_SKIP) + /// \def BOOST_TYPE_INDEX_CTTI_BEGIN_SKIP + /// + /// BOOST_TYPE_INDEX_FUNCTION_SIGNATURE, BOOST_TYPE_INDEX_CTTI_BEGIN_SKIP + /// and BOOST_TYPE_INDEX_CTTI_END_SKIP macroses are used for adding a + /// support for compilers, that by default are not recognized by TypeIndex library. + /// + /// See Compiler support for more info + #define BOOST_TYPE_INDEX_CTTI_BEGIN_SKIP 0 + + /// \def BOOST_TYPE_INDEX_CTTI_END_SKIP + /// + /// BOOST_TYPE_INDEX_FUNCTION_SIGNATURE, BOOST_TYPE_INDEX_CTTI_BEGIN_SKIP + /// and BOOST_TYPE_INDEX_CTTI_END_SKIP macroses are used for adding a + /// support for compilers, that by default are not recognized by TypeIndex library. + /// + /// See Compiler support for more info + #define BOOST_TYPE_INDEX_CTTI_END_SKIP 0 + +#elif defined(BOOST_TYPE_INDEX_CTTI_BEGIN_SKIP) && defined(BOOST_TYPE_INDEX_CTTI_END_SKIP) // skip user specified bytes count BOOST_STATIC_CONSTANT(std::size_t, ctti_skip_size_at_begin = BOOST_TYPE_INDEX_CTTI_BEGIN_SKIP); // skip user specified bytes count diff --git a/boost/type_index/type_index.hpp b/boost/type_index/type_index.hpp index 3ac6118..b44361e 100644 --- a/boost/type_index/type_index.hpp +++ b/boost/type_index/type_index.hpp @@ -138,6 +138,8 @@ public: /* *************** type_index free functions ******************* */ +#ifndef BOOST_TYPE_INDEX_DOXYGEN_INVOKED + inline bool operator == (detail::stl_type_info const& lhs, type_index const& rhs) BOOST_NOEXCEPT { return rhs == lhs; // Operation is commutative } @@ -162,9 +164,16 @@ inline bool operator >= (detail::stl_type_info const& lhs, type_index const& rhs return rhs <= lhs; } -#ifdef BOOST_CLASSINFO_COMPARE_BY_NAMES -#undef BOOST_CLASSINFO_COMPARE_BY_NAMES -#endif +#else // BOOST_TYPE_INDEX_DOXYGEN_INVOKED + +inline bool operator == (std::type_info const& lhs, type_index const& rhs) BOOST_NOEXCEPT; +inline bool operator != (std::type_info const& lhs, type_index const& rhs) BOOST_NOEXCEPT; +inline bool operator < (std::type_info const& lhs, type_index const& rhs) BOOST_NOEXCEPT; +inline bool operator > (std::type_info const& lhs, type_index const& rhs) BOOST_NOEXCEPT; +inline bool operator <= (std::type_info const& lhs, type_index const& rhs) BOOST_NOEXCEPT; +inline bool operator >= (std::type_info const& lhs, type_index const& rhs) BOOST_NOEXCEPT; + +#endif // BOOST_TYPE_INDEX_DOXYGEN_INVOKED /* *************** type_index free functions ******************* */ diff --git a/boost/type_index/type_info.hpp b/boost/type_index/type_info.hpp index 26ed189..8032506 100644 --- a/boost/type_index/type_info.hpp +++ b/boost/type_index/type_info.hpp @@ -268,6 +268,7 @@ inline const type_info& type_id_rtti_only(T* rtti_val) { /* *************** type_info free functions ******************* */ +#ifndef BOOST_TYPE_INDEX_DOXYGEN_INVOKED inline bool operator == (detail::stl_type_info const& lhs, type_info const& rhs) BOOST_NOEXCEPT { return rhs == static_cast(lhs); @@ -277,6 +278,13 @@ inline bool operator != (detail::stl_type_info const& lhs, type_info const& rhs) return !(lhs == rhs); } +#else // BOOST_TYPE_INDEX_DOXYGEN_INVOKED + +inline bool operator == (std::type_info const& lhs, type_info const& rhs) BOOST_NOEXCEPT; +inline bool operator != (std::type_info const& lhs, type_info const& rhs) BOOST_NOEXCEPT; + +#endif // BOOST_TYPE_INDEX_DOXYGEN_INVOKED + /// hash_value function overload for boost::type_info. inline std::size_t hash_value(type_info const& v) BOOST_NOEXCEPT { return v.hash_code(); diff --git a/libs/type_index/doc/Jamfile.v2 b/libs/type_index/doc/Jamfile.v2 index fb44471..4bef0d7 100644 --- a/libs/type_index/doc/Jamfile.v2 +++ b/libs/type_index/doc/Jamfile.v2 @@ -19,6 +19,7 @@ doxygen autodoc EXPAND_ONLY_PREDEF=YES MACRO_EXPANSION=YES "PREDEFINED=\"stl_type_info=std::type_info\" \\ + \"BOOST_TYPE_INDEX_DOXYGEN_INVOKED\" \\ \"detail::stl_type_info=std::type_info\"" "boost.doxygen.reftitle=Boost.TypeIndex Header Reference" ; diff --git a/libs/type_index/doc/type_index.qbk b/libs/type_index/doc/type_index.qbk index 7fb0a39..e11c74d 100644 --- a/libs/type_index/doc/type_index.qbk +++ b/libs/type_index/doc/type_index.qbk @@ -114,10 +114,10 @@ i [section Compiler support] TypeIndex has been tested and successfully work on MSVC2010, GCC-4.5, Clang-2.9. If your compiler is not -in a list of tested compilers, you shall correctly define `BOOST_TYPE_INDEX_FUNCTION_SIGNATURE`, +in a list of tested compilers, you must correctly define `BOOST_TYPE_INDEX_FUNCTION_SIGNATURE`, `BOOST_TYPE_INDEX_CTTI_BEGIN_SKIP` and `BOOST_TYPE_INDEX_CTTI_END_SKIP` macroses: -# define `BOOST_TYPE_INDEX_FUNCTION_SIGNATURE` to a a compiler specific macro, that outputs the *whole* +# define `BOOST_TYPE_INDEX_FUNCTION_SIGNATURE` to a compiler specific macro, that outputs the *whole* function signature, including template parameters # define `BOOST_TYPE_INDEX_CTTI_BEGIN_SKIP` and `BOOST_TYPE_INDEX_CTTI_END_SKIP` to `0` # get the output of `boost::template_id().name()` @@ -165,7 +165,7 @@ Such differences are usually not detected by linker and lead to errors at runtim [warning Even with `BOOST_TYPE_INDEX_FORCE_NORTTI_COMPATIBILITY` defined there is no guarantee that everything will be OK. Libraries that use their own workarounds for disabled RTTI - may fail to link orwork correctly. + may fail to link or to work correctly. ] [endsect]