Skip to content

Conversation

@akchaud5
Copy link

@akchaud5 akchaud5 commented Oct 5, 2025

Fixes #26289

  • Introduce internal type-safe ops for std::vector and std::vector<std::vector> with a thread-local registry.
  • Register ops in vector-based _InputArray/_OutputArray/_InputOutputArray constructors and rawIn/rawOut/rawInOut.
  • Replace unsafe type-punning in matrix_wrap.cpp with ops-based size/data/resize.
  • No ABI change; behavior preserved without UB on new libc++ vector representations.

Build: validated core-only build succeeds.

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

 opencv#26289)

- Introduce internal type-safe ops for std::vector<T> and std::vector<std::vector<T>> with a thread-local registry.
- Register ops in vector-based _InputArray/_OutputArray/_InputOutputArray constructors and rawIn/rawOut/rawInOut.
- Replace unsafe type-punning in matrix_wrap.cpp with ops-based size/data/resize.
- No ABI change; behavior preserved without UB on new libc++ vector representations.

Build: validated core-only build succeeds.
@akchaud5 akchaud5 force-pushed the core-inputarray-vector-ops-26289-clean branch from 9b906e5 to 14f8d50 Compare October 6, 2025 02:59
@asmorkalov asmorkalov changed the title core: remove std::vector type-punning in _InputArray/_OutputArray (fi… core: remove std::vector type-punning in _InputArray/_OutputArray Oct 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

_InputArray and its derivatives need a clean-up

2 participants