-
Notifications
You must be signed in to change notification settings - Fork 395
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NDMatrix] Resolved Dangling Reference Warning
GCC13 introduced a warning for potentially dangling references. The NDMatrix class was creating temporary objects to store the offseted pointer and then returning refrences to these pointers. Although this is correct, since the pointer is owned by the base NDMatrix object, it was confusing the compiler which is not something you want to do in general. Changed how the NDMatrix proxy class works by storing the offset into the pointer directly and passing a reference to the base pointer instead. This makes it clear to the compiler that this pointer belongs to another class and we are returning a reference to a portion of that memory, which is allowed.
- Loading branch information
1 parent
c246f54
commit 569873f
Showing
1 changed file
with
14 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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