SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
|
Utility wrapper that behaves like std::optional but makes the type conform with the std::copyable concept. More...
#include <seqan3/core/detail/copyable_wrapper.hpp>
Public Member Functions | |
constexpr | copyable_wrapper () noexcept(std::is_nothrow_default_constructible_v< t >) |
Use a specialised default constructor, if the wrapped type is default initialisable. If not, the default constructor of std::optional is used. | |
constexpr | copyable_wrapper (copyable_wrapper &&)=default |
Defaulted. | |
constexpr | copyable_wrapper (copyable_wrapper const &)=default |
< Use std::optional assignment operators. | |
template<typename... args_t> requires std::invocable<t, args_t...> | |
constexpr decltype(auto) | operator() (args_t... args) const noexcept(std::is_nothrow_invocable_v< t, args_t... >) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
template<typename... args_t> requires std::invocable<t, args_t...> | |
constexpr decltype(auto) | operator() (args_t... args) noexcept(std::is_nothrow_invocable_v< t, args_t... >) |
Invokes the wrapped object with passed arguments. | |
constexpr copyable_wrapper & | operator= (copyable_wrapper &&other) noexcept(std::is_nothrow_move_constructible_v< t >) |
Move assignment for non-movable wrapped types. | |
constexpr copyable_wrapper & | operator= (copyable_wrapper const &other) noexcept(std::is_nothrow_copy_constructible_v< t >) |
Copy assignment for non-copyable wrapped types. | |
constexpr | ~copyable_wrapper ()=default |
Defaulted. | |
Public Member Functions inherited from std::optional< t > | |
T | emplace (T... args) |
T | has_value (T... args) |
T | operator bool (T... args) |
T | operator* (T... args) |
T | operator-> (T... args) |
T | operator= (T... args) |
T | optional (T... args) |
T | reset (T... args) |
T | swap (T... args) |
T | value (T... args) |
T | value_or (T... args) |
T | ~optional (T... args) |
Related Symbols | |
(Note that these are not member symbols.) | |
template<typename t > | |
copyable_wrapper (t) -> copyable_wrapper< std::remove_reference_t< t > > | |
Type deduction guide that strips references. | |
Utility wrapper that behaves like std::optional but makes the type conform with the std::copyable concept.
|
constexprdefault |
< Use std::optional assignment operators.
Defaulted.
|
inlineconstexprnoexcept |
Invokes the wrapped object with passed arguments.
std::bad_optional_access | if no value is contained. |
This is a SeqAn-specific extension that allows easy invocation of the wrapped object. t
needs to be callable with the passed arguments.
Constness of this function depends on the constness of the call-operator of the wrapped object.