File indexing completed on 2025-01-18 09:50:07
0001
0002
0003
0004
0005
0006
0007 #ifndef BOOST_PROCESS_DETAIL_TRAITS_DECL_HPP_
0008 #define BOOST_PROCESS_DETAIL_TRAITS_DECL_HPP_
0009
0010 #include <boost/process/detail/config.hpp>
0011 #include <boost/none.hpp>
0012 #include <type_traits>
0013
0014 #if defined(BOOST_POSIX_API)
0015 #include <boost/process/detail/posix/handler.hpp>
0016 #elif defined(BOOST_WINDOWS_API)
0017 #include <boost/process/detail/windows/handler.hpp>
0018 #endif
0019
0020
0021 namespace boost { namespace process { namespace detail {
0022
0023
0024 template<typename T>
0025 struct is_initializer : std::is_base_of<handler_base, T> {};
0026
0027
0028 template<typename T>
0029 struct is_initializer<T&> : std::is_base_of<handler_base, T> {};
0030
0031
0032 template<typename T>
0033 struct initializer_tag;
0034
0035
0036
0037 template<typename T>
0038 struct initializer_tag<const T> { typedef typename initializer_tag<T>::type type; };
0039
0040
0041 template<typename T>
0042 struct initializer_tag<T&> { typedef typename initializer_tag<T>::type type; };
0043
0044
0045 template<typename T>
0046 struct initializer_tag<const T&> { typedef typename initializer_tag<T>::type type; };
0047
0048 template<typename T>
0049 struct initializer_builder;
0050
0051
0052 template<typename First, typename ...Args>
0053 struct valid_argument_list;
0054
0055 template<typename First>
0056 struct valid_argument_list<First>
0057 {
0058 constexpr static bool value = is_initializer<First>::value || !std::is_void<typename initializer_tag<First>::type>::value;
0059 typedef std::integral_constant<bool, value> type;
0060 };
0061
0062 template<typename First, typename ...Args>
0063 struct valid_argument_list
0064 {
0065 constexpr static bool my_value = is_initializer<First>::value || !std::is_void<typename initializer_tag<First>::type>::value;
0066 constexpr static bool value = valid_argument_list<Args...>::value && my_value;
0067 typedef std::integral_constant<bool, value> type;
0068 };
0069
0070
0071
0072 }}}
0073
0074
0075
0076 #endif