1 #ifndef FWCore_Utilities_SoATuple_h
2 #define FWCore_Utilities_SoATuple_h
104 template <
typename T>
107 template <
typename... Args>
152 delete[] static_cast<AlignedType*>(
m_values[0]);
160 template <
unsigned int I>
162 unsigned int iIndex)
const {
165 return *(static_cast<ReturnType const*>(
m_values[
I]) + iIndex);
169 template <
unsigned int I>
174 #if GCC_PREREQUISITE(4, 7, 0)
175 return static_cast<ReturnType const*>(__builtin_assume_aligned(
m_values[
I], Helper::kAlignment));
177 return static_cast<ReturnType const*>(
m_values[
I]);
181 template <
unsigned int I>
214 template <
typename... FArgs>
225 template <
unsigned int I>
227 unsigned int iIndex) {
230 return *(static_cast<ReturnType*>(
m_values[
I]) + iIndex);
234 template <
unsigned int I>
238 #if GCC_PREREQUISITE(4, 7, 0)
239 return static_cast<ReturnType*>(__builtin_assume_aligned(
m_values[
I], Helper::kAlignment));
241 return static_cast<ReturnType*>(
m_values[
I]);
245 template <
unsigned int I>
255 for (
unsigned int i = 0;
i <
sizeof...(Args); ++
i) {
278 const size_t itemsNeeded = (memoryNeededInBytes + max_alignment - 1) /
sizeof(AlignedType);
279 char* newMemory = static_cast<char*>(static_cast<void*>(
new AlignedType[itemsNeeded]));
283 delete[] static_cast<AlignedType*>(oldMemory);