diff --git a/include/armadillo_bits/fn_as_scalar.hpp b/include/armadillo_bits/fn_as_scalar.hpp index 499718c1..ee5a074e 100644 --- a/include/armadillo_bits/fn_as_scalar.hpp +++ b/include/armadillo_bits/fn_as_scalar.hpp @@ -76,7 +76,13 @@ as_scalar_redirect<2>::apply(const Glue& X) // T1 must result in a matrix with one row // T2 must result in a matrix with one column - if( (partial_unwrap::is_fast && partial_unwrap::is_fast) || (Proxy::use_at || Proxy::use_at) ) + constexpr bool proxy_is_mat = (is_Mat::stored_type>::value && is_Mat::stored_type>::value); + + constexpr bool use_at = (Proxy::use_at) || (Proxy::use_at); + + constexpr bool fast_unwrap = (partial_unwrap::is_fast && partial_unwrap::is_fast); + + if(proxy_is_mat || use_at || fast_unwrap) { const partial_unwrap tmp1(X.A); const partial_unwrap tmp2(X.B);