相关疑难解决方法(0)

检测类型是否为std :: tuple?

目前我有两个功能:

template<typename Type> bool f(Type* x);
template<typename... List> bool f(std::tuple<List...>* x);
Run Code Online (Sandbox Code Playgroud)

有没有办法将这两个函数与一个额外的模板参数合并,该参数指示传递的类型是否为元组?

template<typename Type, bool IsTuple = /* SOMETHING */> bool f(Type* x);
Run Code Online (Sandbox Code Playgroud)

c++ templates tuples type-traits c++11

13
推荐指数
4
解决办法
4200
查看次数

标签 统计

c++ ×1

c++11 ×1

templates ×1

tuples ×1

type-traits ×1