From 2fc4f1cd090aa759d3675e6ed8a058df5ad2b409 Mon Sep 17 00:00:00 2001 From: Olivier Parcollet Date: Tue, 22 Oct 2013 14:10:44 +0200 Subject: [PATCH] gf: add rebind view/const + delete swap --- triqs/gfs/gf.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/triqs/gfs/gf.hpp b/triqs/gfs/gf.hpp index 7f7e3513..0898fa4f 100644 --- a/triqs/gfs/gf.hpp +++ b/triqs/gfs/gf.hpp @@ -459,6 +459,9 @@ namespace triqs { namespace gfs { this->_data_proxy.rebind(this->_data,X); this->_singularity.rebind(X._singularity); } + + void rebind (gf_view const &X) noexcept { rebind (gf_view{X});} + gf_view & operator = (gf_view const & ) = delete; }; // class gf_const_view @@ -584,5 +587,10 @@ namespace triqs { namespace gfs { }} +// same as for arrays : views can not be swapped by the std::swap. Delete it +namespace std { +template +void swap(triqs::gfs::gf_view &a, triqs::gfs::gf_view &b) = delete; +} #include "./gf_expr.hpp" #endif