Replace =delete with SFINAE for invalid Vec integer methods#575
Replace =delete with SFINAE for invalid Vec integer methods#575chinmaychahar wants to merge 3 commits into
Conversation
|
|
…oftwareFoundation#559) Signed-off-by: maychin <chinmay.cc.06@gmail.com> Signed-off-by: chinmaychahar <chinmay.cc.06@gmail.com>
7ee36c5 to
33e84ff
Compare
|
I think it's probably unwise to rely on either std::is_floating_point or std::is_integral. We should probably define our own extensible type trait that will capture what we really intend and be user-extensible and future-proof. |
Signed-off-by: chinmaychahar <chinmay.cc.06@gmail.com>
de0bf8a to
326e68b
Compare
|
Thanks @lgritz, I added an is_float_like that defaults to std::is_floating_point with a specialization for half. Let me know if this is along the lines of what you had in mind |
|
Could a reviewer please take a look at this? Wouldn't want it go stale |
|
Apologies for the delay, I've been consumed with other issues. And thanks for you continued efforts! I'm happy to work through the issues. The implementation needs to support I think something like this is the right direction: In and then in and then later: and finally: Also note that this needs to work with C++17 through C++26, and unfortunately some of these trait template change signature, so it's a little tricky. It would also be good to add CI jobs that build with the various C++ standards. Also, be sure to configure your fork of the repo to run the CI on your local branch. That way, you can confirm it works before pushing to the PR. When I find myself in a situation like this where I have to make substantial changes to an already-submitted PR, I often create a second branch, work there until I'm happy, then squash the commits and cherry-pick them over to the branch for the PR. That avoids a lot of noise on the PR. |
What the heck does that mean? |
Summary
Fixes #559
Replace
= deletetemplate specializations with SFINAE using the existingIMATH_ENABLE_IFmacro forlength(),normalize(),normalizeExc(),normalizeNonNull(),normalized(),normalizedExc(), andnormalizedNonNull()in Vec2, Vec3, and Vec4.Removes the entire
Specializations for VecN<short>, VecN<int>block including the@cond Doxygen_Suppresswrapper which will no longer be needed when SFINAE makes the methods invisible to both the compiler and Doxygen for non-applicable types.Status
Draft PR. I will iterate based on feedback and open questions in #559