Skip to content

multiXd view bug #22

@bglaessle

Description

@bglaessle

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions