43#ifndef LIB_META_TUPLE_CLOSURE_H
44#define LIB_META_TUPLE_CLOSURE_H
71 static_assert (!
sizeof(PAR),
72 "attempt to partially close something not tuple-like");
75 template<
template<
typename...>
class TUP,
typename...PARS>
78 static_assert (
sizeof...(PARS)
79 ,
"attempt to partially close empty record");
88 return {std::move(
params)...};
93 template<
typename...VALS>
98 auto boundArgs = std::make_tuple (std::forward<VALS> (
vs)...);
104 template<
typename...VALS>
109 auto boundArgs = std::make_tuple (std::forward<VALS> (
vs)...);
115 template<
size_t idx,
typename VAL>
123 template<
size_t idx,
typename VAL>
162 template<
typename...TTT>
165 static_assert(
sizeof...(TTT)
166 ,
"empty list ... attempting total (not partial) closure?");
171 template<
typename...TTT>
176 template<
typename T1,
typename T2,
typename...TS>
178 : __and_<is_same<T1,T2>
186 template<
typename T,
size_t N>
191 static_assert(N,
"attempt to partially close empty array");
194 template<
typename T,
size_t N>
199 template<
typename T,
typename...TT>
201 : std::array<T, 1+sizeof...(TT)>
204 ,
"Array can only hold elements of uniform type");
205 using Array = std::array<T, 1+
sizeof...(TT)>;
211 template<
typename...XS>
217 template<
typename...TTT>
226 template<
typename T,
size_t N>
239 template<
typename...TTT>
240 struct tuple_size<
lib::meta::ArrayAdapt<TTT...> >
241 : integral_constant<size_t, sizeof...(TTT)>
245 template<
size_t I,
typename...TTT>
246 struct tuple_element<I,
lib::meta::ArrayAdapt<TTT...> >
247 : tuple_element<I, typename lib::meta::ArrayAdapt<TTT...>::Array>
Partial function application and building a complete function closure.
Implementation namespace for support and library code.
OBJ * unConst(const OBJ *)
shortcut to save some typing when having to define const and non-const variants of member functions
Metaprogramming with tuples-of-types and the std::tuple record.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...