RA3Bar-RA3Launcher
RA3Bar-RA3Launcher copied to clipboard
Migrate to new c++17 and adapt for msvc
Adapting to a certain compiler is really a dirty work, especially for an amateur C++ user like me. I just tried to make least change to get it compiled, as well as keeping mingw working. So I'd be very appreciated for any suggestions, from which can I get tips about C++ programming without diving into new C++ standards. 🤣
Uh I've tried to declare static constexpr auto allButtons2 = {playGame};
which MSVC complains C2131 ...
Uh I've tried to declare
static constexpr auto allButtons2 = {playGame};
which MSVC complains C2131 ...
@runapp If MSVC do complain C2131 on constexpr initializer_list
, then sure you can change it to const.
But for other constexpr auto
variables, if they are used inside lambdas, you can declare them as static auto constexpr
, so we can avoid unnecessary changes in lambda capture lists.
Hmmm... I've checked all the changed declaration. Seems all of them are initializer_list
?
Hmmm... I've checked all the changed declaration. Seems all of them are
initializer_list
?
@runapp I mean those lambda capture lists, you can remove the default capture and restore them to the original code.
If MSVC complains that some variables are not captured, then change them from auto constexpr
to static auto constexpr
.
Can you also update the README.md
, since it can now be compiled with MSVC?