diff --git a/triqs/arrays/matrix_tensor_proxy.hpp b/triqs/arrays/matrix_tensor_proxy.hpp index 766db471..1ce3e2b1 100644 --- a/triqs/arrays/matrix_tensor_proxy.hpp +++ b/triqs/arrays/matrix_tensor_proxy.hpp @@ -60,7 +60,12 @@ namespace arrays { value_type *restrict data_start() { return &storage()[indexmap().start_shift()]; } view_type operator()() const { return *this; } - template value_type const &operator()(Args &&... args) const { return a(n, std::forward(args)...); } + + template + std::c14::enable_if_t::value, value_type const &> operator()(Args &&... args) const { + return a(n, std::forward(args)...); + } + TRIQS_CLEF_IMPLEMENT_LAZY_CALL(); template const_matrix_tensor_proxy &operator=(const RHS &X) =delete; // can not assign to a const @@ -109,7 +114,13 @@ namespace arrays { value_type *restrict data_start() { return &storage()[indexmap().start_shift()]; } view_type operator()() const { return *this; } - template value_type &operator()(Args &&... args) const { return a(n, std::forward(args)...); } + + template + std::c14::enable_if_t::value, value_type &> operator()(Args &&... args) const { + return a(n, std::forward(args)...); + } + + TRIQS_CLEF_IMPLEMENT_LAZY_CALL(); template matrix_tensor_proxy &operator=(const RHS &X) { triqs_arrays_assign_delegation(*this, X);