Skip to content

Using Better Enums in std::unordered_map as key leads to 'message : see reference to class template instantiation' #113

Description

@ChrisMGeo

I have a nested unordered_map with different enums (std::unordered_map<EnumA, std::unordered_map<EnumB, int>>). Whenever I'm creating a variable of this type it leads to a multitude of errors, with a message: see reference to class template instantiation. I've tried adding the following before #include "enum.h" for EnumA and EnumB but that doesn't work:

#define BETTER_ENUMS_DEFAULT_CONSTRUCTOR(Enum) \
  public:                                      \
    Enum() = default;
#include "enum.h"

Is it possible to create a map without having to follow instructions over here? Since I need to change the values in the map a lot.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions