Don't use ForeachType as it don't work if foreach type is not copyable.

This fixes compilation error:
include/d/std/traits.d:8024: Error: Generating an `inout` copy constructor for `struct game.graphic.manager.Graphic` failed, therefore instances of it are uncopyable
This commit is contained in:
Michał Masiukiewicz 2022-10-04 22:18:45 +02:00
parent bd2afce19a
commit 56ce8c3f9c

View file

@ -465,7 +465,7 @@ export struct EntityManager
static if (isArray!MemberType)
{ // Workaround. This code is never called with: not an array type, but compiler prints an error
// name = fullyQualifiedName!(Unqual!(ForeachType!MemberType));//.stringof;
name = fullName!(Unqual!(ForeachType!MemberType));
name = fullName!(Unqual!(typeof(MemberType.init[0])));
}
bool is_optional;
@ -691,7 +691,7 @@ export struct EntityManager
static if (isArray!MemberType)
{ // Workaround. This code is never called with: not an array type, but compiler prints an error
// name = fullyQualifiedName!(Unqual!(ForeachType!MemberType));
name = fullName!(Unqual!(ForeachType!MemberType));
name = fullName!(Unqual!(typeof(MemberType.init[0])));
//name = Unqual!(ForeachType!MemberType).stringof;
}
@ -899,10 +899,12 @@ export struct EntityManager
static foreach (iii, comp_info; components_info.m_req[0
.. components_info.m_req_counter])
{
__traits(getMember, input_data, comp_info.name) = (cast(ForeachType!(typeof(__traits(getMember,
Sys.EntitiesData, comp_info.name)))*)(
cast(void*) block + info.deltas[system.m_components[iii]]))[offset
.. entities_count];
__traits(getMember, input_data, comp_info.name) = (
cast(typeof(
(typeof(__traits(getMember, Sys.EntitiesData, comp_info.name))).init[0]
)*)
(cast(void*) block + info.deltas[system.m_components[iii]])
)[offset .. entities_count];
}
static foreach (iii, comp_info; components_info.m_optional[0