Skip to content

Replace =delete with SFINAE for invalid Vec integer methods#575

Open
chinmaychahar wants to merge 1 commit into
AcademySoftwareFoundation:mainfrom
chinmaychahar:sfinae-vec-integer-methods
Open

Replace =delete with SFINAE for invalid Vec integer methods#575
chinmaychahar wants to merge 1 commit into
AcademySoftwareFoundation:mainfrom
chinmaychahar:sfinae-vec-integer-methods

Conversation

@chinmaychahar

Copy link
Copy Markdown

Summary

Fixes #559

Replace = delete template specializations with SFINAE using the existing IMATH_ENABLE_IF macro for length(), normalize(), normalizeExc(), normalizeNonNull(), normalized(), normalizedExc(), and normalizedNonNull() in Vec2, Vec3, and Vec4.

Removes the entire Specializations for VecN<short>, VecN<int> block including the @cond Doxygen_Suppress wrapper 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

@linux-foundation-easycla

linux-foundation-easycla Bot commented Jun 13, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: chinmaychahar / name: chinmaychahar (33e84ff)

@chinmaychahar chinmaychahar changed the title Replace =delete with SFINAE for invalid Vec integer methods (#559) Replace =delete with SFINAE for invalid Vec integer methods Jun 13, 2026
…oftwareFoundation#559)

Signed-off-by: maychin <chinmay.cc.06@gmail.com>
Signed-off-by: chinmaychahar <chinmay.cc.06@gmail.com>
@chinmaychahar chinmaychahar force-pushed the sfinae-vec-integer-methods branch from 7ee36c5 to 33e84ff Compare June 13, 2026 08:58
@lgritz

lgritz commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace =delete with SFINAE for invalid Vec integer methods

2 participants