diff --git a/triqs/utility/tuple_tools.hpp b/triqs/utility/tuple_tools.hpp index 0a31c0af..54e03435 100644 --- a/triqs/utility/tuple_tools.hpp +++ b/triqs/utility/tuple_tools.hpp @@ -49,25 +49,22 @@ namespace triqs { namespace tuple { * Returns : f(t[0], t[1], ...) * Equivalent to f(*t) in python .... */ - template struct apply_impl { - template + template struct apply_impl { + template auto operator()(F && f, T const & t, Args && ... args) - DECL_AND_RETURN( apply_impl()(std::forward(f),t, std::get(t), std::forward(args)...)); + DECL_AND_RETURN( apply_impl()(std::forward(f),t, std::get(t), std::forward(args)...)); }; - template struct apply_impl<-1,T> { - template + template<> struct apply_impl<-1> { + template auto operator()(F && f, T const & t, Args && ... args) DECL_AND_RETURN( std::forward(f)(std::forward(args)...)); }; template - auto apply (F && f, T const & t) DECL_AND_RETURN( apply_impl::value-1,T>()(std::forward(f),t)); + auto apply (F && f, T const & t) DECL_AND_RETURN( apply_impl::value-1>()(std::forward(f),t)); - //template - //ReturnType apply(ReturnType(ClassType::*f)(Args...) const, T const & t) { return apply([f](Args const & ... args) { return (*f)(args...);} ,t);} - - template - ReturnType apply( ReturnType(*f)(Args...), T const & t) { return apply([f](Args const & ... args) { return (*f)(args...);} ,t);} + //template + //ReturnType apply( ReturnType(*f)(Args...), T const & t) { return apply([f](Args const & ... args) { return (*f)(args...);} ,t);} /** * apply_construct(t)