VCCC  2024.05
VisualCamp Common C++ library
conjunction.hpp
Go to the documentation of this file.
1 //
2 // Created by cosge on 2023-10-14.
3 //
4 
5 #ifndef VCCC_TYPE_TRAITS_CONJUNCTION_HPP
6 #define VCCC_TYPE_TRAITS_CONJUNCTION_HPP
7 
8 #include <type_traits>
9 
10 namespace vccc {
11 
16 
21 template<typename ...B>
22 struct conjunction;
23 
26 
27 template<>
28 struct conjunction<> : std::true_type {};
29 
30 template<typename B1>
31 struct conjunction<B1> : B1 {};
32 
33 template<typename B1, typename ...BN>
34 struct conjunction<B1, BN...> : std::conditional_t<bool(B1::value), conjunction<BN...>, B1> {};
35 
36 } // namespace vccc
37 
38 #endif // VCCC_TYPE_TRAITS_CONJUNCTION_HPP
Definition: directory.h:12
Definition: conjunction.hpp:22