You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently we have a list of files named MapFactory<k> for <k> in 1 through 15. This will make maintaining the code a bit of a chore, plus most of the code is repeated anyway. Unfortunately, partial template specialization of functions using Enums/ints to distinguish is impossible in C++17 (not that it's gotten any better since). Further, the options may not be known until runtime (e.g. from bindings).
However, we can most likely make a bunch of template specializations, which I think would cut down vs. what we have currently. We definitely could make some preprocessor directives to instantiate the template a bunch of times. Just an idea. Very low priority issue, though.
The text was updated successfully, but these errors were encountered:
neat trick-- you can't do partial template specialization of functions with integers, but you can do them with structs. I can just make a functor class, and then use those partial template specializations as needed.
Currently we have a list of files named
MapFactory<k>
for<k>
in 1 through 15. This will make maintaining the code a bit of a chore, plus most of the code is repeated anyway. Unfortunately, partial template specialization of functions using Enums/ints to distinguish is impossible in C++17 (not that it's gotten any better since). Further, the options may not be known until runtime (e.g. from bindings).However, we can most likely make a bunch of template specializations, which I think would cut down vs. what we have currently. We definitely could make some preprocessor directives to instantiate the template a bunch of times. Just an idea. Very low priority issue, though.
The text was updated successfully, but these errors were encountered: