Support Class Library
A set of tools providing classes and utility
|
Group of factory functions. More...
Functions | |
template<class T , class... Args> | |
scl::utils::Any | any (Args &&... args) |
Creates an scl::tools::Any from the given type and arguments. More... | |
template<class T , class... Args> | |
std::atomic< T > | atomic (Args &&... args) |
Creates an atomic in-place with the given set of arguments. More... | |
template<class T , class... Args> | |
T | from (Args &&... args) |
Instantiate the given value type in-place with the given set of arguments. More... | |
template<class T , class... Args> | |
scl::async::Mutexed< T > | mutexed (Args &&... args) |
Creates a scl::async::Mutexed from the given type and arguments. More... | |
template<class T , class... Args> | |
constexpr scl::utils::Optional< T > | optional (Args &&... args) |
Creates an scl::utils::Optional with a constructed value. More... | |
template<class T > | |
constexpr scl::utils::Optional< T > | emptyOptional () |
Creates an empty optional. More... | |
template<class T , class... Args> | |
constexpr scl::utils::Optional< T > | some (Args &&... args) |
Alias for scl::tools::make::optional. More... | |
template<class T > | |
constexpr scl::utils::Optional< T > | none () |
Alias for scl::tools::make::emptyOptional. More... | |
template<class T > | |
constexpr scl::utils::Optional< T > | optionalFromPointer (const T *ptr) |
Creates an optional from a pointer. More... | |
template<class T , class... Args> | |
std::promise< T > | promise (Args &&... args) |
Creates a fulfilled std::promise in-place with the given set of arguments. More... | |
template<class T , class... Args> | |
T * | ptr (Args &&... args) |
Creates a pointer in-place with the given set of arguments (using new) More... | |
template<class T , class E = scl::utils::Placeholder> | |
scl::utils::Result< T, E > | ok (const T &value) |
template<class T , class E > | |
scl::utils::Result< T, E > | err (const E &error) |
template<class T , class... Args> | |
std::shared_ptr< T > | shared (Args &&... args) |
Creates a shared_ptr in-place with the given set of arguments. More... | |
template<class T , class... Args> | |
std::unique_ptr< T > | unique (Args &&... args) |
Creates a unique_ptr in-place with the given set of arguments. More... | |
Group of factory functions.
scl::utils::Any scl::tools::make::any | ( | Args &&... | args | ) |
Creates an scl::tools::Any from the given type and arguments.
T | being the stored value type |
Args | being the arguments' types |
args | being the arguments to pass to the value type's constructor |
|
inline |
Creates an atomic in-place with the given set of arguments.
T | being the value type of the atomic to create |
Args | being the arguments' types |
args | being the arguments to pass to the constructor of the value type |
constexpr scl::utils::Optional<T> scl::tools::make::emptyOptional | ( | ) |
Creates an empty optional.
T | being the optional's value type |
Definition at line 28 of file optional.h.
scl::utils::Result<T, E> scl::tools::make::err | ( | const E & | error | ) |
|
inline |
Instantiate the given value type in-place with the given set of arguments.
T | being the value type to instantiate |
Args | being the arguments' types |
args | being the arguments to pass to the constructor of the value type |
scl::async::Mutexed<T> scl::tools::make::mutexed | ( | Args &&... | args | ) |
Creates a scl::async::Mutexed from the given type and arguments.
T | being the type of values wrapped by the Mutexed |
Args | being the types of the arguments passed to the constructor |
args | being the arguments passed to the constructor |
constexpr scl::utils::Optional<T> scl::tools::make::none | ( | ) |
Alias for scl::tools::make::emptyOptional.
Definition at line 44 of file optional.h.
scl::utils::Result<T, E> scl::tools::make::ok | ( | const T & | value | ) |
constexpr scl::utils::Optional<T> scl::tools::make::optional | ( | Args &&... | args | ) |
Creates an scl::utils::Optional with a constructed value.
T | being the optional's value type |
Args | being the arguments' types |
args | being the arguments passed to the constructor of the value type |
Definition at line 18 of file optional.h.
constexpr scl::utils::Optional<T> scl::tools::make::optionalFromPointer | ( | const T * | ptr | ) |
Creates an optional from a pointer.
T | being the value type of the Optional |
ptr | being the pointer to construct from |
Definition at line 55 of file optional.h.
|
inline |
Creates a fulfilled std::promise in-place with the given set of arguments.
T | being the value type of the fulfilled std::promise to create |
Args | being the arguments' types |
args | being the arguments to pass to the constructor of the value type |
|
inline |
Creates a pointer in-place with the given set of arguments (using new)
T | being the value type of the pointer to create |
Args | being the arguments' types |
args | being the arguments to pass to the constructor of the value type |
std::shared_ptr<T> scl::tools::make::shared | ( | Args &&... | args | ) |
Creates a shared_ptr in-place with the given set of arguments.
T | being the value type of the shared_ptr to create |
Args | being the arguments' types |
args | being the arguments to pass to the constructor of the value type |
constexpr scl::utils::Optional<T> scl::tools::make::some | ( | Args &&... | args | ) |
Alias for scl::tools::make::optional.
Definition at line 36 of file optional.h.
std::unique_ptr<T> scl::tools::make::unique | ( | Args &&... | args | ) |
Creates a unique_ptr in-place with the given set of arguments.
T | being the value type of the unique_ptr to create |
Args | being the arguments' types |
args | being the arguments to pass to the constructor of the value type |