@@ -48,7 +48,7 @@ for_each_until_true(Tuple&& t, Function f, std::integral_constant<size_t, I>)
48
48
*
49
49
* \tparam Tuple The tuple to iterate through
50
50
* \tparam Function A callable that is invoked for every tuple element and returns a
51
- * boolean indicating whether to coninute iteration or not
51
+ * boolean indicating whether to continue iteration or not
52
52
*
53
53
* \remark Implementation taken from
54
54
* https://stackoverflow.com/questions/26902633/how-to-iterate-over-a-stdtuple-in-c-11
@@ -72,14 +72,18 @@ struct tuple_contains_type_impl<T, std::tuple<Us...>>
72
72
} // namespace detail
73
73
74
74
/* *
75
- * \brief Checks whether a tuple contains a specified type
76
- *
77
- * \tparam T a type to check for
75
+ * \brief If the \Tuple contains the type \p T then provides the member constant value
76
+ * equal true. For any other type, value is false.
77
+ * *
78
+ * \tparam T a type to check
78
79
* \tparam Tuple a tuple in which to check for the type
79
80
*
80
81
*/
81
82
template <typename T, typename Tuple>
82
- using tuple_contains_type = typename detail::tuple_contains_type_impl<T, Tuple>::type;
83
+ using tuple_contains_type = detail::tuple_contains_type_impl<T, Tuple>;
84
+
85
+ template <typename T, typename Tuple>
86
+ constexpr bool tuple_contains_type_v = detail::tuple_contains_type_impl<T, Tuple>::value;
83
87
84
88
namespace detail {
85
89
@@ -89,6 +93,14 @@ struct filter_tuple_values_impl {
89
93
typename std::conditional<Predicate<TupleElements>::value, std::tuple<TupleElements>, std::tuple<>>::
90
94
type ()...));
91
95
96
+ /* *
97
+ * \brief Checks whether a tuple contains a specified type
98
+ *
99
+ * \tparam TupleElements the elments of the tuple you want to filter
100
+ * \param std::tuple<TupleElements...> a tuple of the elements you want to filter
101
+ * \return a tuple containing the filtered elements
102
+ *
103
+ */
92
104
auto
93
105
operator ()(const std::tuple<TupleElements...>& in)
94
106
{
@@ -108,10 +120,10 @@ struct filter_tuple_values_impl {
108
120
} // namespace detail
109
121
110
122
/* *
111
- * \brief Filters elements of a tuple based on the predicate/condition
123
+ * \brief Filters elements of \p Tuple based on the provided predicate/condition
112
124
*
113
125
* \tparam Predicate A trait which takes a tuple element as parameter and defines a
114
- * boolean member value which dictates whether to filter the tuple element or not
126
+ * boolean member \p value which dictates whether to filter the tuple element or not
115
127
* \tparam Tuple a tuple to filter
116
128
*
117
129
*/
0 commit comments