Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ChrisMGeo opened this issue Mar 30, 2023 · 0 comments

Comments

@ChrisMGeo
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant