gboisse / gfx

A minimalist and easy to use graphics API.
MIT License
502 stars 36 forks source link

Fix compilation with msvc c++20. #55

Closed maoliver-amd closed 2 years ago

maoliver-amd commented 2 years ago

GFX doesnt currently compile when enabling conformance (enabled by default with C++20 ) with msvc compiler. This PR fixes that with 2 changes:

gboisse commented 2 years ago

Great, thanks. I understand the removal of the static_assert(false, ...) but really surprised about the this-> being required? Do you know why it's needed in this particular situation? Certainly hope we're not going to have to start adding that to all member variables with future versions of C++ 😛

maoliver-amd commented 2 years ago

Its because c++20 adds some new features, one of which is named handle. So it just requires the this-> to differentiate it to the compiler. So luckily not something that has to be added to everything 😄