ADTF
|
Fundamental types, classes, functions and macros - applicable using
#include <a_util/base.h>
More...
Classes | |
class | NullaryDelegate< ReturnType > |
General delegate template: encapsulates a function or a method without a parameter. More... | |
class | UnaryDelegate< ReturnType, ParamType > |
General function template: encapsulates a function or a method with a single parameter. More... | |
class | ScopeGuard< F > |
Scope guard executing a callable object of type F on scope exit. More... | |
struct | underlying_type_or_type< T, bool > |
Retrieves the underlying type if T is an enum, otherwise the type itself. More... | |
struct | underlying_type_or_type< T, true > |
Retrieves the underlying type of the enum type T . More... | |
struct | is_explicitly_convertible_to< T, U > |
Checks if there is an explicitly defined conversion from U to T . More... | |
Typedefs | |
template<class T , bool is_enum = std::is_enum_v<T>> | |
using | 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. More... | |
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. | |
Functions | |
template<class F > | |
auto | scopeExit (F &&f) |
Creates a scope guard executing callable f on scope exit. More... | |
template<typename T > | |
void | maybe_unused (T &&) |
Mimics C++17 attribute maybe_unused to silence compiler warnings on potentially unused enitities. More... | |
Variables | |
template<class T , class U > | |
constexpr bool | is_explicitly_convertible_to_v = is_explicitly_convertible_to<T, U>::value |
Helper variable template for is_explicitly_convertible_to. More... | |
Fundamental types, classes, functions and macros - applicable using
#include <a_util/base.h>
using 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.
T | The type tor retrieve the underlying type from |
is_enum | value to determine if T is an enum |
Definition at line 89 of file type_traits.h.
void a_util::maybe_unused | ( | T && | ) |
Mimics C++17 attribute maybe_unused
to silence compiler warnings on potentially unused enitities.
T | Type of the potentially unused entity |
Definition at line 51 of file workspace/conan/dev_essential/1.5.0/dw/stable/package/aef85909f792a5a628750d25016a24323084963f/include/a_util/base/types.h.
Referenced by Result::Result(), and a_util::result::operator==().
|
inline |
Creates a scope guard executing callable f
on scope exit.
Usage example:
This can help simplify C-style resource handling and control flow for exception handling.
[in] | f | The callable object to execute. |
Definition at line 128 of file scopeguard.h.
|
constexpr |
Helper variable template for is_explicitly_convertible_to.
T | The to type |
U | The from type |
Definition at line 139 of file type_traits.h.