49 #ifndef LIB_META_TUPLE_RECORD_INIT_H 50 #define LIB_META_TUPLE_RECORD_INIT_H 90 template<
typename TAR>
97 : __and_<is_constructible<TAR, TY const&>
98 ,__not_<is_narrowingInit<typename Strip<TY>::TypePlain
99 ,typename Strip<TAR>::TypePlain>>
110 char buffer[
sizeof(TAR)];
113 template<
typename TY,
class BA>
118 handle(TY
const& srcElm)
120 new(&(BA::buffer)) TAR{srcElm};
134 accessTargetElement()
136 return *
reinterpret_cast<TAR*
> (&converter_.buffer);
144 if (not node.data.accept (converter_))
146 +
"» element from " + string(node)
147 ,error::LUMIERA_ERROR_WRONG_TYPE);
153 accessTargetElement().~TAR();
159 return accessTargetElement();
185 template<
typename...TYPES>
189 using TargetType =
typename Pick<
Types<TYPES...>, i>::Type;
197 operator TargetType<i> ()
199 using util::toString;
201 if (values.childSize() <= i)
202 throw error::Logic (
"Attempt to init the " + toString(
sizeof...(TYPES))
203 +
" element " + util::typeStr<std::tuple<TYPES...>>()
204 +
" from an Rec<GenNode> with only " + toString(values.childSize())
205 +
" child elements: " + toString(values)
206 ,error::LUMIERA_ERROR_WRONG_TYPE);
208 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