Skip to content

Foundation Classes - Improve NCollection vector constructors#835

Merged
dpasukhi merged 1 commit intoOpen-Cascade-SAS:IRfrom
dpasukhi:ncol_vec_constexpr
Nov 16, 2025
Merged

Foundation Classes - Improve NCollection vector constructors#835
dpasukhi merged 1 commit intoOpen-Cascade-SAS:IRfrom
dpasukhi:ncol_vec_constexpr

Conversation

@dpasukhi
Copy link
Copy Markdown
Member

  • 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.
@dpasukhi dpasukhi added this to the Release 8.0 milestone Nov 16, 2025
@dpasukhi dpasukhi requested a review from Copilot November 16, 2025 14:00
@dpasukhi dpasukhi self-assigned this Nov 16, 2025
@dpasukhi dpasukhi added 2. Enhancement New feature or request 1. Foundation Classes Containers, system calls wrappers, smart pointers and other low level of OCCT code labels Nov 16, 2025
@dpasukhi dpasukhi added the 1. Coding Coding rules, trivial changes and misprints label Nov 16, 2025
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 constexpr and noexcept qualifiers to the default constructor where previously missing
  • Removed std::memset usage 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

@dpasukhi dpasukhi merged commit 07239e2 into Open-Cascade-SAS:IR Nov 16, 2025
23 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in Maintenance Nov 16, 2025
@dpasukhi dpasukhi deleted the ncol_vec_constexpr branch November 16, 2025 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1. Coding Coding rules, trivial changes and misprints 1. Foundation Classes Containers, system calls wrappers, smart pointers and other low level of OCCT code 2. Enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants