From ce5022c1e8b620bb35c29201537b07bb23ca8f98 Mon Sep 17 00:00:00 2001 From: conrad Date: Tue, 7 Jun 2022 22:34:46 +1000 Subject: [PATCH] more thorough alias checking --- include/armadillo_bits/ProxyCube.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); }