개요
- conjunction
- disjunction
- negation
예제
- 코드
#include <iostream>
using namespace std;
template <typename T, typename... Ts> void func(T, Ts...) {
if (conjunction<is_same<T, Ts>...>::value) {
cout << "conjunction" << endl;
}
if (disjunction<is_same<T, Ts>...>::value) {
cout << "disjunction" << endl;
}
}
int main() {
func(1, 2, 3);
cout << "------ 1" << endl;
func(1, "a");
cout << "------ 2" << endl;
func(1, 2, "a");
cout << "------ 3" << endl;
cout << negation<bool_constant<true>>::value << endl;
cout << negation<bool_constant<false>>::value << endl;
return 0;
}
- 실행 결과
conjunction
disjunction
------ 1
------ 2
disjunction
------ 3
0
1