|
Pretty Good Sum Type
1.0.0
|
A type modeling "sums with constructors" as used in functional programming. More...
#include <sum_type.hpp>
Public Member Functions | |
| template<class T , class... Args> | |
| sum_type (constructor< T > t, Args &&...args) | |
| Ctor. | |
| sum_type (sum_type const &other) | |
| Copy ctor. | |
| sum_type (sum_type &&other) | |
| Move ctor. | |
| ~sum_type () | |
| Dtor. | |
| sum_type & | operator= (sum_type const &other) |
| Copy-assign operator. | |
| sum_type & | operator= (sum_type &&other) |
| Move-assign operator. | |
| template<class R , class... Fs> | |
| R | match (Fs &&...fs) const |
match function, const overoad | |
| template<class R , class... Fs> | |
| R | match (Fs &&...fs) |
match function, non-const overoad | |
| template<class... Fs> | |
| void | match (Fs &&...fs) const |
match procedure, const overoad | |
| template<class... Fs> | |
| void | match (Fs &&...fs) |
match procedure, non-const overoad | |
| template<class T > | |
| constexpr bool | is () const noexcept |
The currently active v is a T? | |
| template<std::size_t I> | |
| constexpr bool | is_type_at () const noexcept |
The currently active v is at position I? | |
Friends | |
| struct | detail::sum_type_accessor |
| template<std::size_t I, class... Us> | |
| struct | detail::get_sum_type_element |
A type modeling "sums with constructors" as used in functional programming.
1.8.10