15namespace swoc {
inline namespace SWOC_VERSION_NS {
namespace meta {
66template <
unsigned N>
struct CaseTag :
public CaseTag<N - 1> {
67 constexpr CaseTag() {}
69 static constexpr unsigned value = N;
73template <>
struct CaseTag<0> {
74 constexpr CaseTag() {}
76 static constexpr unsigned value = 0;
146template <
typename T,
typename U>
149 return std::forward<U>(u);
168template <
typename... Args>
struct vary :
public Args... {
169 using Args::operator()...;
172template <
typename... Args>
vary(Args...) ->
vary<Args...>;
186template <
typename T,
typename... Types>
struct is_any_of {
187 static constexpr bool value = std::disjunction<std::is_same<T, Types>...>::value;
190template <
typename T,
typename... Types>
struct is_homogenous {
191 static constexpr bool value = std::conjunction<std::is_same<T, Types>...>::value;
196template <
typename T,
typename... Types>
inline constexpr bool is_any_of_v = is_any_of<T, Types...>::value;
209 static constexpr size_t size =
sizeof...(Types);
222 template <
template <
typename... Pack>
typename T>
using apply = T<Types...>;
237 template <
typename T>
static constexpr bool contains = is_any_of<T, Types...>::value;
257template <
typename T>
struct let {
258 using self_type = let;
260 let(self_type
const &that) =
delete;
261 self_type &operator=(self_type
const &) =
delete;
271 let(T &var, T
const &value);
278 let(T &var, T &&value);
283template <
typename T> let<T>::let(T &var, T
const &value) :
_var(var),
_value(
std::move(var)) {
286template <
typename T> let<T>::let(T &var, T &&value) :
_var(var),
_value(
std::move(var)) {
287 _var = std::move(value);
290template <
typename T> let<T>::~let() {
291 _var = std::move(_value);
For template deduction guides.