forked from boostorg/core
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.
This commit is contained in:
@@ -18,6 +18,24 @@ doxygen ref_reference
|
||||
<doxygen:param>EXTRACT_PRIVATE=NO
|
||||
<doxygen:param>HIDE_UNDOC_MEMBERS=YES
|
||||
<doxygen:param>MACRO_EXPANSION=YES
|
||||
<doxygen:param>"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 ;
|
||||
|
@@ -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 );
|
||||
|
Reference in New Issue
Block a user