diff --git a/include/armadillo_bits/ProxyCube.hpp b/include/armadillo_bits/ProxyCube.hpp index ef639284..488e3272 100644 --- a/include/armadillo_bits/ProxyCube.hpp +++ b/include/armadillo_bits/ProxyCube.hpp @@ -70,7 +70,7 @@ struct ProxyCube< Cube > arma_inline aligned_ea_type get_aligned_ea() const { return Q; } template - arma_inline bool is_alias(const Cube& X) const { return (void_ptr(&Q) == void_ptr(&X)); } + arma_inline bool is_alias(const Cube& X) const { return (void_ptr(Q.mem) == void_ptr(X.mem)); } template arma_inline bool has_overlap(const subview_cube& X) const { return is_alias(X.m); } @@ -250,7 +250,7 @@ struct ProxyCube< subview_cube > arma_inline aligned_ea_type get_aligned_ea() const { return Q; } template - arma_inline bool is_alias(const Cube& X) const { return (void_ptr(&(Q.m)) == void_ptr(&X)); } + arma_inline bool is_alias(const Cube& X) const { return (void_ptr(Q.m.mem) == void_ptr(X.mem)); } template arma_inline bool has_overlap(const subview_cube& X) const { return Q.check_overlap(X); }