entt: basic_sparse_set - assure_at_least Assertion `elem == null' failed.
Hello,
how can this assertion happen?
The call looks like:
reg.emplace_or_replace<Component>(entity, SOME_STATIC_STRING);
Which leads to the assert on:
The component to add looks like:
struct Component
{
QString str;
};
A check with reg.valid on the entity did not return any error (and a couple of time the call works without causing the assert).
Not sure what else to check, as far as I can tell, the entity was also not deleted…
entt version:
#define ENTT_VERSION_MAJOR 3
#define ENTT_VERSION_MINOR 11
#define ENTT_VERSION_PATCH 0
Thanks in advance.
About this issue
- Original URL
- State: closed
- Created 7 months ago
- Comments: 20 (10 by maintainers)
Commits related to this issue
- test: avoid using custom entities when emplacing in a registry - see #1095 — committed to skypjack/entt by skypjack 5 months ago
- registry: assert when emplacing invalid entities - close #1095 — committed to skypjack/entt by skypjack 5 months ago
- registry: assert when emplacing invalid entities - close #1095 — committed to skypjack/entt by skypjack 5 months ago
Mmm, ok, let’s reopen the issue as feature request then. We can add the checks back in place with the next release. 👍
Just FYI, I had the exact same assertion when emplacing a component after previously accessing the same type of component from a deleted entity (Which of course is wrong).
Something like this
https://github.com/skypjack/entt/wiki/Push-EnTT-across-boundaries