3
0
mirror of https://github.com/triqs/dft_tools synced 2025-01-12 14:08:24 +01:00

arrays: add lazy call to matrix_tensor_proxy

- correction to previous patch
This commit is contained in:
Olivier Parcollet 2014-04-07 15:11:03 +02:00
parent e1e9ee20fd
commit 4ae4dfd42b

View File

@ -60,7 +60,12 @@ namespace arrays {
value_type *restrict data_start() { return &storage()[indexmap().start_shift()]; } value_type *restrict data_start() { return &storage()[indexmap().start_shift()]; }
view_type operator()() const { return *this; } view_type operator()() const { return *this; }
template <typename... Args> value_type const &operator()(Args &&... args) const { return a(n, std::forward<Args>(args)...); }
template <typename... Args>
std::c14::enable_if_t<!triqs::clef::is_any_lazy<Args...>::value, value_type const &> operator()(Args &&... args) const {
return a(n, std::forward<Args>(args)...);
}
TRIQS_CLEF_IMPLEMENT_LAZY_CALL();
template <typename RHS> const_matrix_tensor_proxy &operator=(const RHS &X) =delete; // can not assign to a const template <typename RHS> 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()]; } value_type *restrict data_start() { return &storage()[indexmap().start_shift()]; }
view_type operator()() const { return *this; } view_type operator()() const { return *this; }
template <typename... Args> value_type &operator()(Args &&... args) const { return a(n, std::forward<Args>(args)...); }
template <typename... Args>
std::c14::enable_if_t<!triqs::clef::is_any_lazy<Args...>::value, value_type &> operator()(Args &&... args) const {
return a(n, std::forward<Args>(args)...);
}
TRIQS_CLEF_IMPLEMENT_LAZY_CALL();
template <typename RHS> matrix_tensor_proxy &operator=(const RHS &X) { template <typename RHS> matrix_tensor_proxy &operator=(const RHS &X) {
triqs_arrays_assign_delegation(*this, X); triqs_arrays_assign_delegation(*this, X);