-
Notifications
You must be signed in to change notification settings - Fork 454
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
nested magic_enum::enum_switch -- failed on msvc? #200
Comments
initial code (compiled by msvc without errors, but wrong result) -- https://gist.github.com/Korsar13/f993beaa52947a0ce42a632602e2aecf |
Hi! The problem here is not the magic_enum library, but that MSVC handles the nested lambdas. Probably the compiler wants to simplify lambdas instantiation, that's why It don't want to create new lambda types for all enum / different usings. This problem can be eliminated if you use not nested lambda, but some struct. |
From the library side: This issue can be eliminated with the following techniques:
|
@schaumb
|
https://gist.github.com/Korsar13/5c171d0cd0b47d62276cac07b6b6a184
compiled by clang, prints
msvc compilation fails,
mm.cpp(39): error C2893: Failed to specialize function template 'void convert_tmpl(const TSrc *,TDst *,size_t)'
The text was updated successfully, but these errors were encountered: