Skip to content

Commit 27b375e

Browse files
committed
feat: attempting to create storage with runtime value
1 parent 42ff13f commit 27b375e

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

ecsact/entt/detail/bytes.hh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
namespace ecsact::entt::detail {
1010

1111
template<typename T>
12-
requires(std::integral<T> || std::floating_point<T>)
12+
requires(std::integral<T> || std::floating_point<T> || std::is_enum_v<T>)
1313
constexpr auto bytes_sizeof() -> int {
1414
using value_type = std::remove_cvref_t<T>;
1515

@@ -43,7 +43,7 @@ template<typename T>
4343
using unsigned_bit_size_equivalent_t = unsigned_bit_size_equivalent<T>::type;
4444

4545
template<typename T>
46-
requires(std::integral<T> || std::floating_point<T>)
46+
requires(std::integral<T> || std::floating_point<T> || std::is_enum_v<T>)
4747
auto bytes_copy_into( //
4848
T v,
4949
auto& out_bytes,

rt_entt_codegen/core/system_provider/association/association.cc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,10 @@ auto provider::association::entity_iteration(
9595
auto assoc_comp_cpp_ident = cpp_identifier(decl_full_name(assoc_comp_id));
9696

9797
ctx.write(std::format(
98-
"{0}.storage<{1}>(::ecsact::entt::detail::hash_vals({1}::id, {2});\n",
98+
"{0}.storage({3}.storage<{1}>(static_cast<::entt::id_type>(::ecsact::"
99+
"entt::detail::"
100+
"hash_vals({1}::"
101+
"id, {2}))));\n",
99102
assoc_view_names.at(assoc_id),
100103
assoc_comp_cpp_ident,
101104
util::comma_delim(
@@ -107,7 +110,8 @@ auto provider::association::entity_iteration(
107110
ecsact::meta::field_name(assoc_comp_id, field_id)
108111
);
109112
})
110-
)
113+
),
114+
names.registry_var_name
111115
));
112116
}
113117

0 commit comments

Comments
 (0)