Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multiXd view bug #22

Open
bglaessle opened this issue May 9, 2017 · 0 comments
Open

multiXd view bug #22

bglaessle opened this issue May 9, 2017 · 0 comments

Comments

@bglaessle
Copy link

Just that this is documented somewhere:

multi2d<Double> matrix = someFunction();
multi1d<Double> vec_view = matrix[0];
multi1d<Double> vec_copy; vec_copy = matrix[0];

modifying vec_view will silently modify matrix, because compilers
are allowed to optimize out the multi1d copy c'tor call.
This also applies to other scenarios where a subslice of a multiXd is accessed.
The third statement provides an actual copy and does not modify matrix.

bjoo pushed a commit that referenced this issue Mar 3, 2023
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

No branches or pull requests

1 participant