-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
4 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c5f8474
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, these are incorrect fixes. It should not work like that, especially that pointer change.
Can you show me exact errors on msvc.
c5f8474
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could it be somehow related that it is ".h" and msvc doesn't understand that its a C++ file.
c5f8474
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try .hpp, to be sure.
I cannot reproduce this myself because I don't have msvc setup.
c5f8474
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure you are using correct GCC version. std::move error seems like a case of old GCC, that doesn't have algorithmic move and mistakes it for utility std::move.
c5f8474
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wdym incorrect?
GLint ints[expectedValuesN];
doesn't form a constant expression, MSVC dislikes that, GCC is more tolerant, but I think in that case MSVC is making a right call.std::apply()
change should be fine, even if you pass function type by value it's implicitly converted into a pointer behind the scenes, no need to cast it back to a value type.std::move
I'm just not used to that form of std::move, here it's not different fromstd::copy
, mostly a cosmetic change as far as I can tell.c5f8474
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GLint ints[expectedValuesN];
is a VLA (variable length array) which is a thing in plain C but not C++. GCC offers it by default as an extension.expectedValuesN
is declared asconst
though, perhaps what was wanted was a compile-time constant? Then using it as the array size would be correct:For
std::apply
the parameter is calledDedicatedGLFuncPtrPtr
(note double "Ptr"), will a double-depth pointer decay to the function correctly? Also will this still work if you pass something like a lambda or a functor object?For
std::move
in this case it seems to be equivalent sinceGLint
is just some flavor ofint
, though I like the use ofstd::move
to denote the intent (we no longer care about the original table and will not using it anymore).c5f8474
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right about VLA. I changed template parameter into a function argument and didn't think it through.
I shall take another look at this.
std::move - this is purely for intent, yes. std::copy is the same.
I 99% sure apply will not work in this case.
Edit:
Apparently it somehow does