Skip to content

Commit 8bb7384

Browse files
committed
Use std::void_t (#66)
1 parent 66d2436 commit 8bb7384

File tree

5 files changed

+12
-18
lines changed

5 files changed

+12
-18
lines changed

include/cpp-sort/adapters/small_array_adapter.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015-2022 Morwenn
2+
* Copyright (c) 2015-2025 Morwenn
33
* SPDX-License-Identifier: MIT
44
*/
55
#ifndef CPPSORT_ADAPTERS_SMALL_ARRAY_ADAPTER_H_
@@ -32,7 +32,7 @@ namespace cppsort
3232
};
3333

3434
template<typename T>
35-
struct has_domain<T, void_t<typename T::domain>>:
35+
struct has_domain<T, std::void_t<typename T::domain>>:
3636
std::true_type
3737
{
3838
using domain = typename T::domain;

include/cpp-sort/adapters/stable_adapter.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016-2023 Morwenn
2+
* Copyright (c) 2016-2025 Morwenn
33
* SPDX-License-Identifier: MIT
44
*/
55
#ifndef CPPSORT_ADAPTERS_STABLE_ADAPTER_H_
@@ -259,7 +259,7 @@ namespace cppsort
259259
};
260260

261261
template<typename Sorter>
262-
struct stable_t_impl_type_or<Sorter, detail::void_t<typename Sorter::type>>
262+
struct stable_t_impl_type_or<Sorter, std::void_t<typename Sorter::type>>
263263
{
264264
using type = typename Sorter::type;
265265
};

include/cpp-sort/detail/raw_checkers.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016-2022 Morwenn
2+
* Copyright (c) 2016-2025 Morwenn
33
* SPDX-License-Identifier: MIT
44
*/
55
#ifndef CPPSORT_DETAIL_RAW_CHECKERS_H_
@@ -29,7 +29,7 @@ namespace detail
2929
{};
3030

3131
template<typename T>
32-
struct has_iterator_category<T, void_t<typename T::iterator_category>>:
32+
struct has_iterator_category<T, std::void_t<typename T::iterator_category>>:
3333
std::true_type
3434
{};
3535

@@ -61,7 +61,7 @@ namespace detail
6161
{};
6262

6363
template<typename T>
64-
struct has_is_always_stable<T, void_t<typename T::is_always_stable>>:
64+
struct has_is_always_stable<T, std::void_t<typename T::is_always_stable>>:
6565
std::true_type
6666
{};
6767

@@ -94,7 +94,7 @@ namespace detail
9494
{};
9595

9696
template<typename T>
97-
struct has_is_transparent<T, void_t<typename T::is_transparent>>:
97+
struct has_is_transparent<T, std::void_t<typename T::is_transparent>>:
9898
std::true_type
9999
{};
100100

include/cpp-sort/detail/type_traits.h

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,6 @@ namespace detail
5252
template<bool B, typename T=void>
5353
using enable_if_t = typename enable_if_impl<B>::template type<T>;
5454

55-
////////////////////////////////////////////////////////////
56-
// std::void_t from C++17
57-
58-
template<typename...>
59-
using void_t = void;
60-
6155
////////////////////////////////////////////////////////////
6256
// std::nonesuch from Library Fundamentals TS v2
6357

@@ -88,7 +82,7 @@ namespace detail
8882
template<typename...> class Op,
8983
typename... Args
9084
>
91-
struct detector<Default, void_t<Op<Args...>>, Op, Args...>
85+
struct detector<Default, std::void_t<Op<Args...>>, Op, Args...>
9286
{
9387
using value_t = std::true_type;
9488
using type = Op<Args...>;
@@ -154,12 +148,12 @@ namespace detail
154148
{};
155149

156150
template<typename Func, typename... Args>
157-
struct is_invocable_impl<void, void_t<invoke_result_t<Func, Args...>>, Func, Args...>:
151+
struct is_invocable_impl<void, std::void_t<invoke_result_t<Func, Args...>>, Func, Args...>:
158152
std::true_type
159153
{};
160154

161155
template<typename Ret, typename Func, typename... Args>
162-
struct is_invocable_impl<Ret, void_t<invoke_result_t<Func, Args...>>, Func, Args...>:
156+
struct is_invocable_impl<Ret, std::void_t<invoke_result_t<Func, Args...>>, Func, Args...>:
163157
std::is_convertible<invoke_result_t<Func, Args...>, Ret>
164158
{};
165159

include/cpp-sort/sorter_traits.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ namespace cppsort
281281
template<typename Sorter>
282282
struct bidir_at_best_tag<
283283
Sorter,
284-
void_t<typename sorter_traits<Sorter>::iterator_category>
284+
std::void_t<typename sorter_traits<Sorter>::iterator_category>
285285
>
286286
{
287287
using type = conditional_t<

0 commit comments

Comments
 (0)