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: image

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

Most upvoted comments

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

reg.emplace<Transform>(e, {});
reg.destroy(e);
reg.get_or_emplace<Transform>(e); // bad

// ...

auto e2 = reg.create();
reg.get_or_emplace<Transform>(e2); // triggers assert