diff --git a/src/Ensure.hpp b/src/Ensure.hpp index 6235f73..afdcc5e 100644 --- a/src/Ensure.hpp +++ b/src/Ensure.hpp @@ -13,6 +13,8 @@ throw ArbUt::__ErrorHelpers::CreateEnsureError(#expr, std::source_location::current()); \ } +/// @brief Ensures two expressions are equal. Throws an exception if the assertion fails. +/// @ingroup Ensure #define EnsureEquals(a, b) \ if ((a) != (b)) { \ std::stringstream error_ss; \ @@ -20,6 +22,8 @@ throw ArbUt::__ErrorHelpers::CreateEnsureError(error_ss.str().c_str(), std::source_location::current()); \ } +/// @brief Ensures a is greater than b. Throws an exception if the assertion fails. +/// @ingroup Ensure #define EnsureGreater(a, b) \ if ((a) <= (b)) { \ std::stringstream error_ss; \ @@ -27,6 +31,8 @@ throw ArbUt::__ErrorHelpers::CreateEnsureError(error_ss.str().c_str(), std::source_location::current()); \ } +/// @brief Ensures a is greater or equals to b. Throws an exception if the assertion fails. +/// @ingroup Ensure #define EnsureGreaterOrEquals(a, b) \ if ((a) < (b)) { \ std::stringstream error_ss; \ @@ -34,6 +40,8 @@ throw ArbUt::__ErrorHelpers::CreateEnsureError(error_ss.str().c_str(), std::source_location::current()); \ } +/// @brief Ensures a is less than b. Throws an exception if the assertion fails. +/// @ingroup Ensure #define EnsureLess(a, b) \ if ((a) >= (b)) { \ std::stringstream error_ss; \ @@ -41,6 +49,8 @@ throw ArbUt::__ErrorHelpers::CreateEnsureError(error_ss.str().c_str(), std::source_location::current()); \ } +/// @brief Ensures a is less than or equals to b. Throws an exception if the assertion fails. +/// @ingroup Ensure #define EnsureLessOrEquals(a, b) \ if ((a) > (b)) { \ std::stringstream error_ss; \