diff --git a/doc/Jamfile.v2 b/doc/Jamfile.v2 index e4110a9..36b616b 100644 --- a/doc/Jamfile.v2 +++ b/doc/Jamfile.v2 @@ -18,6 +18,7 @@ doxygen autodoc EXPAND_ONLY_PREDEF=YES MACRO_EXPANSION=YES "PREDEFINED=\"stl_type_info=std::type_info\" \\ + \"BOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT()=explicit operator bool() noexcept;\" \\ \"BOOST_STACKTRACE_FUNCTION\"" "boost.doxygen.reftitle=Boost.Stacktrace Header Reference" ; diff --git a/include/boost/stacktrace.hpp b/include/boost/stacktrace.hpp index 82c3920..f82235b 100644 --- a/include/boost/stacktrace.hpp +++ b/include/boost/stacktrace.hpp @@ -115,11 +115,13 @@ public: /// @b Complexity: Amortized O(1), O(1) for noop backend. BOOST_STACKTRACE_FUNCTION std::string operator[](std::size_t frame) const; + /// @cond bool operator!() const BOOST_NOEXCEPT { return !size(); } + /// @endcond - /// @brief Allows to check that capturing stack trace was successful. + /// @brief Allows to check that stack trace capturing was successful. /// @returns `true` if `this->size() != 0` /// /// @b Complexity: O(1) @@ -136,6 +138,7 @@ public: BOOST_STACKTRACE_FUNCTION bool operator==(const stacktrace& rhs) const BOOST_NOEXCEPT; }; +/// Additional comparison operators for stacktraces that have amortized O(1) complexity. inline bool operator> (const stacktrace& lhs, const stacktrace& rhs) BOOST_NOEXCEPT { return rhs < lhs; } inline bool operator<=(const stacktrace& lhs, const stacktrace& rhs) BOOST_NOEXCEPT { return !(lhs > rhs); } inline bool operator>=(const stacktrace& lhs, const stacktrace& rhs) BOOST_NOEXCEPT { return !(lhs < rhs); }