//满足参数至少两个时才会被选择。当满足参数至少两个2个时第一个参数为true就会被选择。或者只有两个参数,因为下边偏特化版本需要三个参数。template<bool _First_value,class_First,class... _Rest>struct_Conjunction{// handle false trait or last traitusing type = _First;};//对上一个进行了偏特化。偏特化出第三个参数和第一个参数是true。只有满足参数大于2个第一个参数为true时才会被调用,否则调用非特化版本。template<class_True,class_Next,class... _Rest>struct_Conjunction<true, _True, _Next, _Rest...>{// the first trait is true, try the next oneusing type =typename_Conjunction<_Next::value, _Next, _Rest...>::type;};//对_Conjunction数据进行过滤,当参数个数为0个时默认返回true_typetemplate<class... _Traits>structconjunction:true_type{};// If _Traits is empty, true_type//对_Conjunction数据进行过滤,当参数个数大于0个时利用继承方式去处理。最后获取到false_type或者true_type。template<class_First,class... _Rest>structconjunction<_First, _Rest...>: _Conjunction<_First::value, _First, _Rest...>::type {// the first false trait in _Traits, or the last trait if none are false};//获取false或者true,当里边有false时为false,没有就为truetemplate<class... _Traits>
_INLINE_VAR constexprbool conjunction_v = conjunction<_Traits...>::value;
//取相反的值。利用继承获得bool_constant类型。template<class_Trait>structnegation:bool_constant<!static_cast<bool>(_Trait::value)>{};// The negated result of _Trait//获取最后的结果。false或者truetemplate<class_Trait>
_INLINE_VAR constexprbool negation_v = negation<_Trait>::value;
//满足参数至少两个时才会被选择。当满足参数至少两个2个时第一个参数为true就会被选择。或者只有两个参数,因为下边偏特化版本需要三个参数。template <bool _First_value, class _First, class... _Rest>struct _Conjunction { // handle false trait or last trait using type = _First;};//对上一个进行了偏特化。偏特化出第三个参数和第一个参数是true。