c++ - Getting SFINAE correct with functions -
I have written a quick thing that determines that certain types (and arguments) are variable for plain function pointer Whether or not it works: template & lt; Typename F, typename ... args & gt; Struct is_stateless: std :: is_convertible & lt; F, typename std :: result_of & lt; F (Args ...) & gt; :: Type (*) (Args ...) & gt; :: type {}; It works for the longest time, but it has a serious drawback: std :: result_of & lt; F (Args ...) & gt; :: . If you accidentally gave incorrect arguments for your function (say that you have left & amp; ) due to result_of you type Field I like my is_stateless structure to be "false" in this case (as you like a "right" fun and logic that is not meant to be variable in a function Indicator). I am open to using the features present in C ++ 11 and C + 1 GCE 4.8. * And below. Any ideas on how to do it? institutionalizing result_of F for args is not allowed if you do it any...