0
我試圖創建工作像「其中」限制在高級語言的宏:追加到在可變參數ç每ARG宏觀
#define where(T, ...) typename std::enable_if< /* tricky part */ >::type
// should expand like so: trait1<T>::value && trait2<T>::value ... traitN<T>::value
這樣VA_ARGS爲特徵的列表,像這樣使用:
template<class T,
where(T, std::is_default_constructible, std::is_class)>
class A { };
這可能嗎?
也許使用['std :: linkage'](http://en.cppreference.com/w/cpp/types/conjunction)?您可能需要一個接收類型列表的中間特徵。 –