Foundation Classes - Improve NCollection vector constructors#835
Merged
dpasukhi merged 1 commit intoOpen-Cascade-SAS:IRfrom Nov 16, 2025
Merged
Foundation Classes - Improve NCollection vector constructors#835dpasukhi merged 1 commit intoOpen-Cascade-SAS:IRfrom
dpasukhi merged 1 commit intoOpen-Cascade-SAS:IRfrom
Conversation
Member
dpasukhi
commented
Nov 16, 2025
- Updated constructors in NCollection_Vec2, NCollection_Vec3, and NCollection_Vec4 to use initializer lists instead of assignment, enhancing readability and potentially optimizing performance.
- Ensured all constructors are marked as constexpr and noexcept where applicable.
- Updated constructors in NCollection_Vec2, NCollection_Vec3, and NCollection_Vec4 to use initializer lists instead of assignment, enhancing readability and potentially optimizing performance. - Ensured all constructors are marked as constexpr and noexcept where applicable.
There was a problem hiding this comment.
Pull Request Overview
This PR modernizes the constructor implementations for NCollection vector classes (Vec2, Vec3, Vec4) by replacing assignment-based initialization with member initializer lists. The changes improve code consistency, enable full constexpr support for the default constructor, and align with modern C++ best practices.
Key Changes:
- Converted all constructor implementations from assignment-based to initializer list-based initialization
- Added
constexprandnoexceptqualifiers to the default constructor where previously missing - Removed
std::memsetusage in favor of compile-time initialization
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| NCollection_Vec4.hxx | Updated all Vec4 constructors to use initializer lists; made default constructor constexpr/noexcept |
| NCollection_Vec3.hxx | Updated all Vec3 constructors to use initializer lists; made default constructor constexpr/noexcept |
| NCollection_Vec2.hxx | Updated all Vec2 constructors to use initializer lists for consistency |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.