diff --git a/triqs/gfs/gf.hpp b/triqs/gfs/gf.hpp index 9f0a738b..722b859e 100644 --- a/triqs/gfs/gf.hpp +++ b/triqs/gfs/gf.hpp @@ -676,12 +676,17 @@ namespace gfs { g.singularity() = inverse(g.singularity()); } - template gf inverse(gf_view g) { - auto res = gf(g); - invert_in_place(res); + template gf inverse(gf const & g) { + auto res = g; + gf_view v = res; + invert_in_place(v); return res; } + template gf inverse(gf_view g) { + return inverse(gf(g)); + } + // ---- transpose : a new gf template