|
30 | 30 |
|
31 | 31 | THRUST_NAMESPACE_BEGIN |
32 | 32 |
|
33 | | -namespace detail |
34 | | -{ |
35 | | - |
36 | | -template <typename Operation> |
37 | | -struct unary_traits_imp; |
38 | | - |
39 | | -template <typename Operation> |
40 | | -struct unary_traits_imp<Operation*> |
41 | | -{ |
42 | | - using function_type = Operation; |
43 | | - using param_type = const function_type&; |
44 | | - using result_type = typename Operation::result_type; |
45 | | - using argument_type = typename Operation::argument_type; |
46 | | -}; // end unary_traits_imp |
47 | | - |
48 | | -template <typename Result, typename Argument> |
49 | | -struct unary_traits_imp<Result (*)(Argument)> |
50 | | -{ |
51 | | - using function_type = Result (*)(Argument); |
52 | | - using param_type = Result (*)(Argument); |
53 | | - using result_type = Result; |
54 | | - using argument_type = Argument; |
55 | | -}; // end unary_traits_imp |
56 | | - |
57 | | -template <typename Operation> |
58 | | -struct binary_traits_imp; |
59 | | - |
60 | | -template <typename Operation> |
61 | | -struct binary_traits_imp<Operation*> |
62 | | -{ |
63 | | - using function_type = Operation; |
64 | | - using param_type = const function_type&; |
65 | | - using result_type = typename Operation::result_type; |
66 | | - using first_argument_type = typename Operation::first_argument_type; |
67 | | - using second_argument_type = typename Operation::second_argument_type; |
68 | | -}; // end binary_traits_imp |
69 | | - |
70 | | -template <typename Result, typename Argument1, typename Argument2> |
71 | | -struct binary_traits_imp<Result (*)(Argument1, Argument2)> |
72 | | -{ |
73 | | - using function_type = Result (*)(Argument1, Argument2); |
74 | | - using param_type = Result (*)(Argument1, Argument2); |
75 | | - using result_type = Result; |
76 | | - using first_argument_type = Argument1; |
77 | | - using second_argument_type = Argument2; |
78 | | -}; // end binary_traits_imp |
79 | | - |
80 | | -} // namespace detail |
81 | | - |
82 | | -_CCCL_SUPPRESS_DEPRECATED_PUSH |
83 | | -template <typename Operation> |
84 | | -struct unary_traits |
85 | | -{ |
86 | | - using function_type = typename detail::unary_traits_imp<Operation*>::function_type; |
87 | | - using param_type = typename detail::unary_traits_imp<Operation*>::param_type; |
88 | | - using result_type = typename detail::unary_traits_imp<Operation*>::result_type; |
89 | | - using argument_type = typename detail::unary_traits_imp<Operation*>::argument_type; |
90 | | -}; // end unary_traits |
91 | | -_CCCL_SUPPRESS_DEPRECATED_POP |
92 | | - |
93 | | -_CCCL_SUPPRESS_DEPRECATED_PUSH |
94 | | -template <typename Result, typename Argument> |
95 | | -struct unary_traits<Result (*)(Argument)> |
96 | | -{ |
97 | | - using function_type = Result (*)(Argument); |
98 | | - using param_type = Result (*)(Argument); |
99 | | - using result_type = Result; |
100 | | - using argument_type = Argument; |
101 | | -}; // end unary_traits |
102 | | -_CCCL_SUPPRESS_DEPRECATED_POP |
103 | | - |
104 | | -_CCCL_SUPPRESS_DEPRECATED_PUSH |
105 | | -template <typename Operation> |
106 | | -struct binary_traits |
107 | | -{ |
108 | | - using function_type = typename detail::binary_traits_imp<Operation*>::function_type; |
109 | | - using param_type = typename detail::binary_traits_imp<Operation*>::param_type; |
110 | | - using result_type = typename detail::binary_traits_imp<Operation*>::result_type; |
111 | | - using first_argument_type = typename detail::binary_traits_imp<Operation*>::first_argument_type; |
112 | | - using second_argument_type = typename detail::binary_traits_imp<Operation*>::second_argument_type; |
113 | | -}; // end binary_traits |
114 | | -_CCCL_SUPPRESS_DEPRECATED_POP |
115 | | - |
116 | | -_CCCL_SUPPRESS_DEPRECATED_PUSH |
117 | | -template <typename Result, typename Argument1, typename Argument2> |
118 | | -struct binary_traits<Result (*)(Argument1, Argument2)> |
119 | | -{ |
120 | | - using function_type = Result (*)(Argument1, Argument2); |
121 | | - using param_type = Result (*)(Argument1, Argument2); |
122 | | - using result_type = Result; |
123 | | - using first_argument_type = Argument1; |
124 | | - using second_argument_type = Argument2; |
125 | | -}; // end binary_traits |
126 | | -_CCCL_SUPPRESS_DEPRECATED_POP |
127 | | - |
128 | 33 | _CCCL_SUPPRESS_DEPRECATED_PUSH |
129 | 34 | template <typename Predicate> |
130 | 35 | _CCCL_HOST_DEVICE unary_negate<Predicate> not1(const Predicate& pred) |
|
0 commit comments