Entt: 'std::swap': no matching overloaded function found

Created on 7 Apr 2020  ·  4Comments  ·  Source: skypjack/entt

Compiler: MSVC19 with C++ 17 features.
Basic code to get this error:

void render(entt::registry& registry) {
    auto view = registry.view<Sprite, Material>();
}

Error occur on line 427 of storage.hpp.

Thank you for your help.

invalid

Most helpful comment

@skypjack You could put some static_asserts in assure to ensure that components are move-constructible and all that. Then you get a clear error message in one place instead of cryptic error messages all over the place.

All 4 comments

Found the problem I use a reference inside one of my component. Sorry for the trouble.

@skypjack You could put some static_asserts in assure to ensure that components are move-constructible and all that. Then you get a clear error message in one place instead of cryptic error messages all over the place.

@Kerndog73 actually the requirement is move constructible and move assignable.
I'd rather put the static assert within the storage class.

By “and all that”, I meant move-assignable 😅. It makes a lot more sense in the storage class actually.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

skypjack picture skypjack  ·  6Comments

Kerndog73 picture Kerndog73  ·  5Comments

dBagrat picture dBagrat  ·  4Comments

Logris picture Logris  ·  7Comments

jaspercb picture jaspercb  ·  6Comments