Skip to content

I need to use this in a std::map but am being prevented by operator deletion #19

@benajaero

Description

@benajaero

I'm using a manager to store my game maps. The code is similar to this.

//_maps is an std::map. name is a string
tmx::Map _map
MapManager::_maps[name] = _map;

Fails because of operator deleted. So I got rid of that code and am directly storing maps in my game controller. However, I cannot keep loading the map each cycle as that is cpu intensive. I therefore tried to place the maps as private values in the controller but I get this error.

                                                                                            [5/9038]
./include/playing.h:14:18: note: copy constructor of 'PlayController' is implicitly deleted because field '_outerWorld' has a deleted
      copy constructor
        tmx::Map _outerWorld;

./include/tmxlite/Map.hpp:96:9: note: 'Map' has been explicitly marked deleted here
        Map(const Map&) = delete;

How can I get around this? I tried deleting the Map code but it leads to even more errors. Note std::map insert does not work for some reason

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions