|
| template<class T, bool is_enum = std::is_enum_v<T>> |
| using | a_util::underlying_type_or_type_t = typename underlying_type_or_type<T, is_enum>::type |
| | Retrieves the underlying type if T is an enum, otherwise the type itself.
|
| |
|
typedef void * | handle_t |
| | Type of a handle value.
|
| |
|
typedef const void * | const_handle_t |
| | Type of a const handle value.
|
| |
|
typedef std::int64_t | timestamp_t |
| | Type of a timestamp value. If not otherwise stated, always in microseconds.
|
| |
|
typedef std::atomic< timestamp_t > | atomic_timestamp_t |
| | Type of an atomic timestamp_t.
|
| |
Fundamental types, classes, functions and macros - applicable using
#include <a_util/base.h>
◆ underlying_type_or_type_t
template<class T, bool is_enum = std::is_enum_v<T>>
Retrieves the underlying type if T is an enum, otherwise the type itself.
- Template Parameters
-
| T | The type tor retrieve the underlying type from |
| is_enum | value to determine if T is an enum |
◆ maybe_unused()
template<typename T>
| void a_util::maybe_unused |
( |
T && | | ) |
|
◆ scopeExit()
template<class F>
| auto a_util::scopeExit |
( |
F && | f | ) |
|
|
inline |
Creates a scope guard executing callable f on scope exit.
Usage example:
{
auto needs_cleanup = create_something();
auto onexit =
scopeExit([&]() { cleanup(needs_cleanup); });
could_throw();
}
auto scopeExit(F &&f)
Definition scopeguard.h:128
This can help simplify C-style resource handling and control flow for exception handling.
- Parameters
-
| [in] | f | The callable object to execute. |
- Returns
- An instance of ScopeGuard
◆ is_explicitly_convertible_to_v
template<class T, class U>