Error#
Documentation#
Defined in namespace hal
#include <libhal/error.hpp>
- group Error
Functions
-
inline status success()#
a readability function for returning successful results;
For functions that return
status
, rather than returning{}
to default initialize the status object as βsuccessβ, use this function to make it more clear to the reader.An Example:
hal::status some_function() { return hal::success(); }
- Returns:
status - that is always successful
-
inline status success()#
-
namespace error#
Error objects, templates, and constants.
Variables
-
template<auto... options>
constexpr bool invalid_option = invalid_option_t<options...>::value# Helper definition to simplify the usage of invalid_option_t.
- Template Parameters:
options β ignored by the application but needed to create a non-trivial specialization of this class which allows its usage in static_assert.
-
template<auto... options>
struct invalid_option_t : public std::false_type# - #include <error.hpp>
Used for defining static_asserts that should always fail, but only if the static_assert line is hit via
if constexpr
control block. Prefer to NOT use this directly but to useinvalid_option
instead.- Template Parameters:
options β ignored by the application but needed to create a non-trivial specialization of this class which allows its usage in static_assert.
-
template<auto... options>