What you do is
template <typename T> struct WrapDoFoo {using type = function_traits<&T::DoFoo>;};
. Then std::conditional_t<__, WrapDoFoo, WrapDoBar>::type
.