Workaround MSVC bug

This commit is contained in:
Jérôme Leclercq 2020-09-04 14:18:57 +02:00
parent 3082620ef9
commit a8b9a8c56d
1 changed files with 6 additions and 7 deletions

View File

@ -22,14 +22,13 @@ namespace Nz::GL
namespace namespace
{ {
template<typename> template<typename FuncType, std::size_t FuncIndex, typename>
struct GLWrapper; struct GLWrapper;
template<typename Ret, typename... Args> template<typename FuncType, std::size_t FuncIndex, typename Ret, typename... Args>
struct GLWrapper<Ret(Args...)> struct GLWrapper<FuncType, FuncIndex, Ret(Args...)>
{ {
template<typename FuncType, std::size_t FuncIndex> static auto WrapErrorHandling()
auto WrapErrorHandling()
{ {
return [](Args... args) -> Ret return [](Args... args) -> Ret
{ {
@ -79,8 +78,8 @@ namespace Nz::GL
{ {
if (std::strcmp(funcName, "glGetError") != 0) //< Prevent infinite recursion if (std::strcmp(funcName, "glGetError") != 0) //< Prevent infinite recursion
{ {
GLWrapper<std::remove_pointer_t<FuncType>> wrapper; using Wrapper = GLWrapper<FuncType, FuncIndex, std::remove_pointer_t<FuncType>>;
func = wrapper.template WrapErrorHandling<FuncType, FuncIndex>(); func = Wrapper::WrapErrorHandling();
} }
} }
#endif #endif