diff --git a/include/armadillo_bits/fn_accu.hpp b/include/armadillo_bits/fn_accu.hpp index 9f0ae9f5..49fb10ea 100644 --- a/include/armadillo_bits/fn_accu.hpp +++ b/include/armadillo_bits/fn_accu.hpp @@ -286,8 +286,8 @@ accu(const eGlue& expr) typedef typename expr_type::proxy1_type::stored_type P1_stored_type; typedef typename expr_type::proxy2_type::stored_type P2_stored_type; - const bool have_direct_mem_1 = (is_Mat::value) || (is_subview_col::value); - const bool have_direct_mem_2 = (is_Mat::value) || (is_subview_col::value); + constexpr bool have_direct_mem_1 = (is_Mat::value) || (is_subview_col::value); + constexpr bool have_direct_mem_2 = (is_Mat::value) || (is_subview_col::value); if(have_direct_mem_1 && have_direct_mem_2) { @@ -982,15 +982,12 @@ accu(const SpOp& expr) typedef typename T1::elem_type eT; - const bool is_vectorise = \ + constexpr bool is_vectorise = \ (is_same_type::yes) || (is_same_type::yes) || (is_same_type::yes); - if(is_vectorise) - { - return accu(expr.m); - } + if(is_vectorise) { return accu(expr.m); } const SpMat tmp = expr; diff --git a/include/armadillo_bits/fn_as_scalar.hpp b/include/armadillo_bits/fn_as_scalar.hpp index 5509f844..33b3aa48 100644 --- a/include/armadillo_bits/fn_as_scalar.hpp +++ b/include/armadillo_bits/fn_as_scalar.hpp @@ -76,11 +76,11 @@ 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 - const bool has_all_mat = (is_Mat::value || is_Mat_trans::value) && (is_Mat::value || is_Mat_trans::value); + constexpr bool has_all_mat = (is_Mat::value || is_Mat_trans::value) && (is_Mat::value || is_Mat_trans::value); - const bool use_at = (Proxy::use_at || Proxy::use_at); + constexpr bool use_at = (Proxy::use_at || Proxy::use_at); - const bool do_partial_unwrap = (has_all_mat || use_at); + constexpr bool do_partial_unwrap = (has_all_mat || use_at); if(do_partial_unwrap) { @@ -140,8 +140,8 @@ as_scalar_redirect<3>::apply(const Glue< Glue, T3, glue_time const strip_inv strip1(X.A.B); const strip_diagmat strip2(strip1.M); - const bool tmp2_do_inv_gen = strip1.do_inv_gen && arma_config::optimise_invexpr; - const bool tmp2_do_diagmat = strip2.do_diagmat; + constexpr bool tmp2_do_inv_gen = strip1.do_inv_gen && arma_config::optimise_invexpr; + constexpr bool tmp2_do_diagmat = strip2.do_diagmat; if(tmp2_do_diagmat == false) { diff --git a/include/armadillo_bits/op_all_meat.hpp b/include/armadillo_bits/op_all_meat.hpp index e0b952d3..185d4eec 100644 --- a/include/armadillo_bits/op_all_meat.hpp +++ b/include/armadillo_bits/op_all_meat.hpp @@ -216,7 +216,7 @@ op_all::all_vec_helper uword count = 0; - const bool use_at = (Proxy::use_at || Proxy::use_at); + constexpr bool use_at = (Proxy::use_at || Proxy::use_at); if(use_at == false) { diff --git a/include/armadillo_bits/op_any_meat.hpp b/include/armadillo_bits/op_any_meat.hpp index 22bb2f30..3d5ff8aa 100644 --- a/include/armadillo_bits/op_any_meat.hpp +++ b/include/armadillo_bits/op_any_meat.hpp @@ -206,7 +206,7 @@ op_any::any_vec_helper arma_conform_assert_same_size(A, B, "relational operator"); - const bool use_at = (Proxy::use_at || Proxy::use_at); + constexpr bool use_at = (Proxy::use_at || Proxy::use_at); if(use_at == false) { diff --git a/include/armadillo_bits/op_dot_meat.hpp b/include/armadillo_bits/op_dot_meat.hpp index 6d5ed261..169556e7 100644 --- a/include/armadillo_bits/op_dot_meat.hpp +++ b/include/armadillo_bits/op_dot_meat.hpp @@ -207,9 +207,9 @@ op_dot::apply(const T1& X, const T2& Y) { arma_debug_sigprint(); - const bool use_at = (Proxy::use_at) || (Proxy::use_at); + constexpr bool use_at = (Proxy::use_at) || (Proxy::use_at); - const bool have_direct_mem = (quasi_unwrap::has_orig_mem) && (quasi_unwrap::has_orig_mem); + constexpr bool have_direct_mem = (quasi_unwrap::has_orig_mem) && (quasi_unwrap::has_orig_mem); if(use_at || have_direct_mem) {