
8 Sep
2012
8 Sep
'12
4:45 p.m.
Daniel Walker wrote:
Do you know of any previously proposed solutions to the SFINAE problem; e.g. alternative result_of implementations?
This post (Note: written in Japanese http://d.hatena.ne.jp/iorate/20110717/1310913102 ) says that boost::result_of (and std::result_of) cannot be used for SFINAE and presents the following implementation template < class , class = void > struct result_of_aux {}; template < class F, class ...Args> struct result_of_aux<F(Args...), decltype(std::declval<F>()(std::declval<Args>()...), void ())> { typedef decltype(std::declval<F>()(std::declval<Args>()...)) type; }; template < class Sig> struct result_of : result_of_aux<Sig> {}; Regards, Michel