mpc
Haskell-like feature supports in C++
|
A class that holds a single value. More...
#include <single.hpp>
Public Types | |
using | value_type = T |
Public Member Functions | |
explicit (not detail::is_implicitly_default_constructible_v< T >) const expr single()=default | |
single (const single &)=default | |
single (single &&)=default | |
explicit (not std::is_convertible_v< const T &, T >) const expr single(const T &rhs) | |
template<class U = T> requires std::constructible_from<T, U&&> explicit(not std::is_convertible_v<U, T>) | |
constexpr | single (U &&rhs) |
template<tuple_like Tuple> requires ( not std::constructible_from<T, Tuple&&> and std::constructible_from<T, detail::copy_reference_t<Tuple, std::tuple_element_t<0, Tuple>>&&> ) explicit(not std::is_convertible_v<std::tuple_element_t<0, Tuple>, T>) | |
constexpr | single (Tuple &&rhs) |
template<class... Args> requires std::constructible_from<T, Args&&...> | |
constexpr | single (std::in_place_t, Args &&... args) |
template<class U , class... Args> requires std::constructible_from<T, std::initializer_list<U>, Args&&...> | |
constexpr | single (std::in_place_t, std::initializer_list< U > il, Args &&... args) |
constexpr single & | operator= (const single &rhs) |
constexpr single & | operator= (single &&rhs) noexcept(std::is_nothrow_move_assignable_v< T >) |
template<std::convertible_to< T > U = T> | |
single & | operator= (U &&rhs) |
template<tuple_like Tuple> requires ( not std::convertible_to<Tuple, T> and std::convertible_to<std::tuple_element_t<0, Tuple>, T> ) | |
constexpr single & | operator= (Tuple &&rhs) |
auto | operator<=> (const single &) const =default |
void | swap (single &other) noexcept(std::is_nothrow_swappable_v< T >) |
constexpr decltype(auto) | operator* () & |
constexpr decltype(auto) | operator* () const & |
constexpr decltype(auto) | operator* () && |
constexpr decltype(auto) | operator* () const && |
constexpr auto | operator-> () |
constexpr auto | operator-> () const |
A class that holds a single value.
To prepare multiple classes with different types but the same properties, the tag type can be assigned to the second type parameter.