Skip to content

Commit bf33b7b

Browse files
Move to C++14: Move to std::get<type>(..) instead of xsimd::detail::get
1 parent 73452be commit bf33b7b

File tree

3 files changed

+6
-33
lines changed

3 files changed

+6
-33
lines changed

include/xsimd/arch/xsimd_neon.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ namespace xsimd
169169
return_type<U> apply(U rhs) const noexcept
170170
{
171171
using func_type = return_type<U> (*)(U);
172-
auto func = xsimd::detail::get<func_type>(m_func);
172+
auto func = std::get<func_type>(m_func);
173173
return func(rhs);
174174
}
175175
};
@@ -183,7 +183,7 @@ namespace xsimd
183183
return_type<U> apply(U lhs, U rhs) const noexcept
184184
{
185185
using func_type = return_type<U> (*)(U, U);
186-
auto func = xsimd::detail::get<func_type>(m_func);
186+
auto func = std::get<func_type>(m_func);
187187
return func(lhs, rhs);
188188
}
189189
};
@@ -1866,7 +1866,7 @@ namespace xsimd
18661866
U apply(comp_return_type<U> cond, U lhs, U rhs) const noexcept
18671867
{
18681868
using func_type = U (*)(comp_return_type<U>, U, U);
1869-
auto func = xsimd::detail::get<func_type>(m_func);
1869+
auto func = std::get<func_type>(m_func);
18701870
return func(cond, lhs, rhs);
18711871
}
18721872
};
@@ -2886,7 +2886,7 @@ namespace xsimd
28862886
R apply(U rhs) const noexcept
28872887
{
28882888
using func_type = R (*)(U);
2889-
auto func = xsimd::detail::get<func_type>(m_func);
2889+
auto func = std::get<func_type>(m_func);
28902890
return func(rhs);
28912891
}
28922892
};
@@ -2915,7 +2915,7 @@ namespace xsimd
29152915
V apply(U rhs) const noexcept
29162916
{
29172917
using caster_type = bitwise_caster_impl<V, T...>;
2918-
auto caster = xsimd::detail::get<caster_type>(m_caster);
2918+
auto caster = std::get<caster_type>(m_caster);
29192919
return caster.apply(rhs);
29202920
}
29212921
};

include/xsimd/arch/xsimd_neon64.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1241,7 +1241,7 @@ namespace xsimd
12411241
V apply(float64x2_t rhs) const
12421242
{
12431243
using func_type = V (*)(float64x2_t);
1244-
auto func = xsimd::detail::get<func_type>(m_func);
1244+
auto func = std::get<func_type>(m_func);
12451245
return func(rhs);
12461246
}
12471247
};

include/xsimd/types/xsimd_utils.hpp

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -280,33 +280,6 @@ namespace xsimd
280280
}
281281
}
282282

283-
/***********************************
284-
* Backport of std::get from C++14 *
285-
***********************************/
286-
287-
namespace detail
288-
{
289-
template <class T, class... Types, size_t I, size_t... Is>
290-
inline const T& get_impl(const std::tuple<Types...>& t, std::is_same<T, T>, std::index_sequence<I, Is...>) noexcept
291-
{
292-
return std::get<I>(t);
293-
}
294-
295-
template <class T, class U, class... Types, size_t I, size_t... Is>
296-
inline const T& get_impl(const std::tuple<Types...>& t, std::is_same<T, U>, std::index_sequence<I, Is...>) noexcept
297-
{
298-
using tuple_elem = typename std::tuple_element<I + 1, std::tuple<Types...>>::type;
299-
return get_impl<T>(t, std::is_same<T, tuple_elem>(), std::index_sequence<Is...>());
300-
}
301-
302-
template <class T, class... Types>
303-
inline const T& get(const std::tuple<Types...>& t) noexcept
304-
{
305-
using tuple_elem = typename std::tuple_element<0, std::tuple<Types...>>::type;
306-
return get_impl<T>(t, std::is_same<T, tuple_elem>(), std::make_index_sequence<sizeof...(Types)>());
307-
}
308-
}
309-
310283
/*********************************
311284
* Backport of void_t from C++17 *
312285
*********************************/

0 commit comments

Comments
 (0)