您必须声明一个带 2 个参数的参数化函数,如果第一个参数是 or 类型,则返回第一个参数的类型double,float否则返回第二个参数的类型。为什么这段代码会抛出错误?
template <typename T1, typename T2>
using BinaryType = std::function<std::conditional<
std::is_floating_point<T1>::value,
T1, T2>::type (T1, T2)>;