From 5c6ab3a884441ca2f19aeb66631deb4f2576053b Mon Sep 17 00:00:00 2001 From: Jakob Blomer Date: Fri, 26 Jan 2024 22:26:53 +0100 Subject: [PATCH] namespace layering: move RResultBase out of 'Internal' --- core/foundation/v7/inc/ROOT/RError.hxx | 12 ++++-------- core/foundation/v7/src/RError.cxx | 6 ++---- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/core/foundation/v7/inc/ROOT/RError.hxx b/core/foundation/v7/inc/ROOT/RError.hxx index fa43861fa1f91..64d22bbab4e1b 100644 --- a/core/foundation/v7/inc/ROOT/RError.hxx +++ b/core/foundation/v7/inc/ROOT/RError.hxx @@ -82,11 +82,9 @@ public: const RError &GetError() const { return fError; } }; - -namespace Internal { // clang-format off /** -\class ROOT::Experimental::Internal::RResultBase +\class ROOT::Experimental::RResultBase \ingroup Base \brief Common handling of the error case for RResult (T != void) and RResult @@ -142,8 +140,6 @@ public: void *operator new[](std::size_t) = delete; void *operator new[](std::size_t, void *) = delete; }; // class RResultBase -} // namespace Internal - // clang-format off /** @@ -204,7 +200,7 @@ where an exception may be thrown. */ // clang-format on template -class RResult : public Internal::RResultBase { +class RResult : public RResultBase { private: /// The result value in case of successful execution T fValue; @@ -265,8 +261,8 @@ public: }; /// RResult has no data member and no Inspect() method but instead a Success() factory method -template<> -class RResult : public Internal::RResultBase { +template <> +class RResult : public RResultBase { private: RResult() = default; diff --git a/core/foundation/v7/src/RError.cxx b/core/foundation/v7/src/RError.cxx index 98f2f9dc042cf..b72296dbee78f 100644 --- a/core/foundation/v7/src/RError.cxx +++ b/core/foundation/v7/src/RError.cxx @@ -47,8 +47,7 @@ void ROOT::Experimental::RError::AddFrame(RLocation &&sourceLocation) fStackTrace.emplace_back(sourceLocation); } - -ROOT::Experimental::Internal::RResultBase::~RResultBase() noexcept(false) +ROOT::Experimental::RResultBase::~RResultBase() noexcept(false) { if (R__unlikely(fError && !fIsChecked)) { // Prevent from throwing if the object is deconstructed in the course of stack unwinding for another exception @@ -65,8 +64,7 @@ ROOT::Experimental::Internal::RResultBase::~RResultBase() noexcept(false) } } - -void ROOT::Experimental::Internal::RResultBase::Throw() +void ROOT::Experimental::RResultBase::Throw() { throw ROOT::Experimental::RException(*fError); }