novelrt / NovelRT

A cross-platform 2D game engine accompanied by a strong toolset for visual novels.
MIT License
183 stars 43 forks source link

Fix C++20 template resolution for MSVC in C++20 mode. #541

Closed RubyNova closed 1 year ago

RubyNova commented 1 year ago

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...) This PR introduces an MSVC-specific C++20 fix - it appears MSVC has a bug in template resolution when in C++20 mode, this seems to resolve it.

Is there an open issue that this resolves? If so, please link it here. N/A

What is the current behavior? (You can also link to an open issue here) C++20 fails to build becuase it thinks we are calling instance methods in static contexts when we aren't.

What is the new behavior (if this is a feature change)? C++20 resolves the template correctly and so can build on MSVC.

Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?) C++17 should be fine, so no.

Other information: N/A

Pheubel commented 1 year ago

I think this would close https://github.com/novelrt/NovelRT/issues/500, at least, in regards to the things currently listed there.

it also helps with bringing https://github.com/novelrt/NovelRT/issues/402 one step closer, this is one of the issues currently going on with getting GCC to compile.