schema entity initialize() method, optional argument forwarding in file::create, populate_derived in InstanceData

This commit is contained in:
Thomas Krijnen
2026-01-15 19:24:55 +01:00
parent c089c11cd6
commit 4ec643d4e1
32 changed files with 38750 additions and 63173 deletions
+11 -1
View File
@@ -410,8 +410,18 @@ public:
void build_inverses_(const express::Base&);
// @nb this does not support id assignment
template <typename T, typename... Ts>
T create(Ts&&... args) {
T t = create(&T::Class()).template as<T>();
if constexpr (sizeof...(Ts) > 0) {
t.initialize(std::forward<Ts>(args)...);
}
return t;
}
template <typename T>
T create(int id=-1) {
T create(int id = -1) {
return create(&T::Class(), id).template as<T>();
}