From 9c8daaf64dd305f4a1cd5542dcfaebd9846fc077 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Thu, 12 Jun 2014 00:15:52 +0400 Subject: [PATCH] Documentation tweaks. 1. Changed scoped_enum.qbk so that it's compatible with QuickBook 1.6. 2. Added Doxygen predefined macros to improve quality of the generated reference sections. --- doc/Jamfile.v2 | 18 ++++++++++++++++++ doc/scoped_enum.qbk | 27 ++++++++++++++------------- 2 files changed, 32 insertions(+), 13 deletions(-) diff --git a/doc/Jamfile.v2 b/doc/Jamfile.v2 index e39b821..ee477d9 100644 --- a/doc/Jamfile.v2 +++ b/doc/Jamfile.v2 @@ -18,6 +18,24 @@ doxygen ref_reference EXTRACT_PRIVATE=NO HIDE_UNDOC_MEMBERS=YES MACRO_EXPANSION=YES + "PREDEFINED=BOOST_CORE_DOXYGEN \\ + BOOST_SYMBOL_VISIBLE= \\ + BOOST_FORCEINLINE=inline \\ + BOOST_STATIC_ASSERT(x)= \\ + BOOST_STATIC_ASSERT_MSG(x,y)= \\ + BOOST_STATIC_CONSTANT(x,y)=\"static constexpr x y\" \\ + BOOST_RV_REF(x)=\"x&&\" \\ + BOOST_NESTED_TEMPLATE=template \\ + BOOST_CONSTEXPR=constexpr \\ + BOOST_CONSTEXPR_OR_CONST=constexpr \\ + BOOST_NOEXCEPT=noexcept \\ + BOOST_NOEXCEPT_IF(x)=noexcept(x) \\ + BOOST_NOEXCEPT_OR_NOTHROW=noexcept \\ + BOOST_COPY_ASSIGN_REF(x)=\"x const&\" \\ + BOOST_DEFAULTED_FUNCTION(x,y)=\"x = default;\" \\ + BOOST_DELETED_FUNCTION(x)=\"x = delete;\" \\ + BOOST_EXPLICIT_OPERATOR_BOOL()=\"explicit operator bool() const;\" \\ + BOOST_REF_CONST=const" ; xml core : core.qbk ; diff --git a/doc/scoped_enum.qbk b/doc/scoped_enum.qbk index 905b916..d0931f8 100644 --- a/doc/scoped_enum.qbk +++ b/doc/scoped_enum.qbk @@ -1,14 +1,12 @@ -[quickbook 1.5] - [section:scoped_enum scoped_enum] -[section Authors] +[simplesect Authors] * Beman Dawes * Vicente J. Botet Escriba * Anthony Williams -[endsect] +[endsimplesect] [section Overview] @@ -59,12 +57,9 @@ The enumeration can be forward declared: BOOST_SCOPED_ENUM_FORWARD_DECLARE(future_errc); -There are however some limitations: +There are however some limitations. First, the emulated scoped enum is not a C++ enum, so `is_enum< future_errc >` will be `false_type`. -* The emulated scoped enum is not a C++ enum, so `is_enum< future_errc >` will be `false_type`. -* The emulated scoped enum can not be used in switch nor in template arguments. For these cases the user needs to use some helpers. - -Instead of +Second, the emulated scoped enum can not be used in switch nor in template arguments. For these cases the user needs to use some helpers. Instead of switch (ev) { @@ -78,7 +73,7 @@ use case future_errc::broken_promise: // ... -And instead of +and instead of template <> struct is_error_code_enum< future_errc > : @@ -94,13 +89,19 @@ use { }; -* Explicit conversion to the underlying type should be performed with `boost::underlying_cast` instead of `static_cast`: +Lastly, explicit conversion to the underlying type should be performed with `boost::underlying_cast` instead of `static_cast`: unsigned int val = boost::underlying_cast< unsigned int >(ev); -Sample usage: +Here is usage example: - BOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(algae, char) { green, red, cyan }; BOOST_SCOPED_ENUM_DECLARE_END(algae) + BOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(algae, char) + { + green, + red, + cyan + } + BOOST_SCOPED_ENUM_DECLARE_END(algae) ... algae sample( algae::red ); void foo( algae color );