58 #ifndef LIB_META_TUPLE_RECORD_INIT_H 59 #define LIB_META_TUPLE_RECORD_INIT_H 99 template<
typename TAR>
104 template<
typename TY>
106 : __and_<is_constructible<TAR, TY const&>
107 ,__not_<is_narrowingInit<typename Strip<TY>::TypePlain
108 ,typename Strip<TAR>::TypePlain>>
119 char buffer[
sizeof(TAR)];
122 template<
typename TY,
class BA>
127 handle(TY
const& srcElm)
129 new(&(BA::buffer)) TAR{srcElm};
143 accessTargetElement()
145 return *
reinterpret_cast<TAR*
> (&converter_.buffer);
153 if (not node.data.accept (converter_))
155 +
"» element from " + string(node)
156 ,error::LUMIERA_ERROR_WRONG_TYPE);
162 accessTargetElement().~TAR();
168 return accessTargetElement();
194 template<
typename...TYPES>
198 using TargetType =
typename Pick<
Types<TYPES...>, i>::Type;
206 operator TargetType<i> ()
208 using util::toString;
210 if (values.childSize() <= i)
211 throw error::Logic (
"Attempt to init the " + toString(
sizeof...(TYPES))
212 +
" element " + util::typeStr<std::tuple<TYPES...>>()
213 +
" from an Rec<GenNode> with only " + toString(values.childSize())
214 +
" child elements: " + toString(values)
215 ,error::LUMIERA_ERROR_WRONG_TYPE);
217 return GenNodeAccessor<TargetType<i>> (values.child(i));
Any copy and copy construction prohibited.
Helpers for working with lib::meta::Types (i.e.
Some basic facilities for manipulating type sequences.
Implementation namespace for support and library code.
Metaprogramming with tuples-of-types and the std::tuple record.
Derived specific exceptions within Lumiera's exception hierarchy.
Generic building block for tree shaped (meta)data structures.
Helpers for type detection, type rewriting and metaprogramming.
object-like record of data.
Metaprogramming: Helpers for manipulating lists-of-types.
generic data element node within a tree