|
1 | 1 | /* |
2 | | - * Copyright (c) 2016-2022 Morwenn |
| 2 | + * Copyright (c) 2016-2025 Morwenn |
3 | 3 | * SPDX-License-Identifier: MIT |
4 | 4 | */ |
5 | 5 |
|
@@ -29,37 +29,6 @@ namespace cppsort |
29 | 29 | { |
30 | 30 | namespace detail |
31 | 31 | { |
32 | | - //////////////////////////////////////////////////////////// |
33 | | - // C++17 std::destroy and friends |
34 | | - |
35 | | - template<typename T> |
36 | | - auto destroy_at(T* ptr) |
37 | | - -> void |
38 | | - { |
39 | | - // TODO: implement if needed |
40 | | - static_assert(not std::is_array<T>::value, "destroy_at() does no handle arrays"); |
41 | | - ptr->~T(); |
42 | | - } |
43 | | - |
44 | | - template<typename ForwardIterator> |
45 | | - auto destroy(ForwardIterator first, ForwardIterator last) |
46 | | - -> void |
47 | | - { |
48 | | - for (; first != last; ++first) { |
49 | | - detail::destroy_at(std::addressof(*first)); |
50 | | - } |
51 | | - } |
52 | | - |
53 | | - template<typename ForwardIterator, typename Size> |
54 | | - auto destroy_n(ForwardIterator first, Size n) |
55 | | - -> void |
56 | | - { |
57 | | - for (; n > 0; --n) { |
58 | | - detail::destroy_at(std::addressof(*first)); |
59 | | - ++first; |
60 | | - } |
61 | | - } |
62 | | - |
63 | 32 | //////////////////////////////////////////////////////////// |
64 | 33 | // Deleter for ::operator new(std::size_t) |
65 | 34 |
|
@@ -122,7 +91,7 @@ namespace detail |
122 | 91 | constexpr auto operator()(T* pointer) noexcept |
123 | 92 | -> void |
124 | 93 | { |
125 | | - detail::destroy_n(pointer, size); |
| 94 | + std::destroy_n(pointer, size); |
126 | 95 | } |
127 | 96 |
|
128 | 97 | // Number of allocated objects to destroy |
|
0 commit comments