68 typedef typename etl::types<T>::type
type;
70 ETL_STATIC_ASSERT((etl::is_base_of<TBase, type>::value),
"Unsupported type");
71 ETL_STATIC_ASSERT(
sizeof(
type) <= SIZE,
"Unsupported size");
72 ETL_STATIC_ASSERT(etl::alignment_of<type>::value <= ALIGNMENT,
"Unsupported alignment");
74 ::new (
static_cast<type*
>(data))
type(etl::forward<T>(value));
84 ETL_STATIC_ASSERT((etl::is_base_of<TBase, T>::value),
"Unsupported type");
85 ETL_STATIC_ASSERT(
sizeof(T) <= SIZE,
"Unsupported size");
86 ETL_STATIC_ASSERT(etl::alignment_of<T>::value <= ALIGNMENT,
"Unsupported alignment");
88 ::new (
static_cast<T*
>(data)) T(value);
97 static_cast<TBase*
>(data)->~TBase();
105 template <
typename T>
108 typedef typename etl::types<T>::type
type;
110 ETL_STATIC_ASSERT((etl::is_base_of<TBase, type>::value),
"Unsupported type");
111 ETL_STATIC_ASSERT(
sizeof(
type) <= SIZE,
"Unsupported size");
112 ETL_STATIC_ASSERT(etl::alignment_of<type>::value <= ALIGNMENT,
"Unsupported alignment");
114 static_cast<TBase*
>(
data)->~TBase();
115 ::new (
static_cast<type*
>(
data))
type(etl::forward<T>(value));
124 template <
typename T>
127 ETL_STATIC_ASSERT((etl::is_base_of<TBase, T>::value),
"Unsupported type");
128 ETL_STATIC_ASSERT(
sizeof(T) <= SIZE,
"Unsupported size");
129 ETL_STATIC_ASSERT(etl::alignment_of<T>::value <= ALIGNMENT,
"Unsupported alignment");
131 static_cast<TBase*
>(data)->~TBase();
132 ::new (
static_cast<T*
>(data)) T(value);
143 return *
static_cast<TBase*
>(data);
151 return *
static_cast<const TBase*
>(data);