Pretty Good Sum Type
1.0.0
|
Primary template. More...
#include <recursive_union.hpp>
Public Types | |
using | result_type = R |
The return type of visit | |
Static Public Member Functions | |
template<class O , class F , class... Fs, class = pgs::enable_if_t<is_callable<F, T>::value, void>> | |
static result_type | visit (overload_tag< O >, T const &t, F &&f, Fs &&...) |
f is callable on t (of type T const& ) | |
template<class F , class O , class... Fs, class = pgs::enable_if_t<!is_callable<F, T>::value, void>> | |
static result_type | visit (overload_tag< O > o, T const &t, F &&, Fs &&...fs) |
f is not callable on t (of type T const& ), recurse | |
template<class O , class F , class... Fs, class = pgs::enable_if_t<is_callable<F, T>::value, void>> | |
static result_type | visit (overload_tag< O >, T &t, F &&f, Fs &&...) |
f is callable on t (of type T& ) | |
template<class F , class O , class... Fs, class = pgs::enable_if_t<!is_callable<F, T>::value, void>> | |
static result_type | visit (overload_tag< O > o, T &t, F &&, Fs &&...fs) |
f is not callable on t (of type T& ) | |
Primary template.
R | return type |
T | head of the parameter pack |
Ts | tail of the paramter pack |
If the f
(of type F
) under consideration can be applied to t
(that is, applied to a T
) do so, else continue searching by stripping f
off the head of the parameter pack and recurively invoking visit
.