55 template<
typename T_Type,
typename T_Parent,
bool T_storeStatic = false>
72 template<
typename... Args>
73 MemberStore(Args&&... args) : member(std::forward<Args>(args)...) {}
87 template<
typename T_Type,
typename T_Parent>
98 static char member[
sizeof(
Type)];
99 static bool isInitialized;
104 template<
typename... Args>
106 if (!isInitialized) {
107 isInitialized =
true;
108 new (member)
Type(std::forward<Args>(args)...);
114 return *((
Type*)MemberStore::member);
119 return *((
Type const*)MemberStore::member);
123#ifndef DOXYGEN_DISABLE
124 template<
typename Type,
typename Parent>
125 char MemberStore<Type, Parent, true>::member[
sizeof(Type)] = {};
127 template<
typename Type,
typename Parent>
128 bool MemberStore<Type, Parent, true>::isInitialized =
false;
#define CODI_INLINE
See codi::Config::ForcedInlines.
Definition config.h:457
#define CODI_DD(Type, Default)
Abbreviation for CODI_DECLARE_DEFAULT.
Definition macros.hpp:94
#define CODI_ANY
Used in default declarations of expression templates.
Definition macros.hpp:98
CoDiPack - Code Differentiation Package.
Definition codi.hpp:90
T_Type Type
See MemberStore.
Definition memberStore.hpp:91
T_Parent Parent
See MemberStore.
Definition memberStore.hpp:92
Type const & get() const
Get a reference to the actual member.
Definition memberStore.hpp:118
MemberStore(Args &&... args)
Arguments are forwarded to the constructor of the member.
Definition memberStore.hpp:105
Type & get()
Get a reference to the actual member.
Definition memberStore.hpp:113
Defines a member that can either be static or local to the struct.
Definition memberStore.hpp:56
static bool constexpr storeStatic
See MemberStore.
Definition memberStore.hpp:63
MemberStore(Args &&... args)
Arguments are forwarded to the constructor of the member.
Definition memberStore.hpp:73
T_Type Type
< See MemberStore
Definition memberStore.hpp:60
T_Parent Parent
See MemberStore.
Definition memberStore.hpp:61
Type & get()
Get a reference to the actual member.
Definition memberStore.hpp:76
Type const & get() const
Get a reference to the actual member.
Definition memberStore.hpp:81