Adds documentation for Ensure macros
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2022-03-20 11:59:18 +01:00
parent e8f4ab27b5
commit 8667c8f8ff
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
1 changed files with 10 additions and 0 deletions

View File

@ -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; \