|
25 | 25 |
|
26 | 26 | namespace xt
|
27 | 27 | {
|
28 |
| - |
29 |
| - namespace detail |
30 |
| - { |
31 |
| - template <class It> |
32 |
| - using require_input_iter = typename std::enable_if< |
33 |
| - std::is_convertible<typename std::iterator_traits<It>::iterator_category, std::input_iterator_tag>::value>::type; |
34 |
| - } |
35 |
| - |
36 | 28 | template <class C>
|
37 | 29 | struct is_contiguous_container : std::true_type
|
38 | 30 | {
|
@@ -64,7 +56,7 @@ namespace xt
|
64 | 56 | explicit uvector(size_type count, const allocator_type& alloc = allocator_type());
|
65 | 57 | uvector(size_type count, const_reference value, const allocator_type& alloc = allocator_type());
|
66 | 58 |
|
67 |
| - template <class InputIt, class = detail::require_input_iter<InputIt>> |
| 59 | + template <input_iterator_concept InputIt> |
68 | 60 | uvector(InputIt first, InputIt last, const allocator_type& alloc = allocator_type());
|
69 | 61 |
|
70 | 62 | uvector(std::initializer_list<T> init, const allocator_type& alloc = allocator_type());
|
@@ -277,7 +269,7 @@ namespace xt
|
277 | 269 | }
|
278 | 270 |
|
279 | 271 | template <class T, class A>
|
280 |
| - template <class InputIt, class> |
| 272 | + template <input_iterator_concept InputIt> |
281 | 273 | inline uvector<T, A>::uvector(InputIt first, InputIt last, const allocator_type& alloc)
|
282 | 274 | : m_allocator(alloc)
|
283 | 275 | , p_begin(nullptr)
|
@@ -675,18 +667,18 @@ namespace xt
|
675 | 667 |
|
676 | 668 | svector(const std::vector<T>& vec);
|
677 | 669 |
|
678 |
| - template <class IT, class = detail::require_input_iter<IT>> |
| 670 | + template <input_iterator_concept IT> |
679 | 671 | svector(IT begin, IT end, const allocator_type& alloc = allocator_type());
|
680 | 672 |
|
681 |
| - template <std::size_t N2, bool I2, class = std::enable_if_t<N != N2, void>> |
| 673 | + template <std::size_t N2, bool I2> requires (N != N2) |
682 | 674 | explicit svector(const svector<T, N2, A, I2>& rhs);
|
683 | 675 |
|
684 | 676 | svector& operator=(const svector& rhs);
|
685 | 677 | svector& operator=(svector&& rhs) noexcept(std::is_nothrow_move_assignable<value_type>::value);
|
686 | 678 | svector& operator=(const std::vector<T>& rhs);
|
687 | 679 | svector& operator=(std::initializer_list<T> il);
|
688 | 680 |
|
689 |
| - template <std::size_t N2, bool I2, class = std::enable_if_t<N != N2, void>> |
| 681 | + template <std::size_t N2, bool I2> requires (N != N2) |
690 | 682 | svector& operator=(const svector<T, N2, A, I2>& rhs);
|
691 | 683 |
|
692 | 684 | svector(const svector& other);
|
@@ -809,15 +801,15 @@ namespace xt
|
809 | 801 | }
|
810 | 802 |
|
811 | 803 | template <class T, std::size_t N, class A, bool Init>
|
812 |
| - template <class IT, class> |
| 804 | + template <input_iterator_concept IT> |
813 | 805 | inline svector<T, N, A, Init>::svector(IT begin, IT end, const allocator_type& alloc)
|
814 | 806 | : m_allocator(alloc)
|
815 | 807 | {
|
816 | 808 | assign(begin, end);
|
817 | 809 | }
|
818 | 810 |
|
819 | 811 | template <class T, std::size_t N, class A, bool Init>
|
820 |
| - template <std::size_t N2, bool I2, class> |
| 812 | + template <std::size_t N2, bool I2> requires (N != N2) |
821 | 813 | inline svector<T, N, A, Init>::svector(const svector<T, N2, A, I2>& rhs)
|
822 | 814 | : m_allocator(rhs.get_allocator())
|
823 | 815 | {
|
@@ -876,7 +868,7 @@ namespace xt
|
876 | 868 | }
|
877 | 869 |
|
878 | 870 | template <class T, std::size_t N, class A, bool Init>
|
879 |
| - template <std::size_t N2, bool I2, class> |
| 871 | + template <std::size_t N2, bool I2> requires (N != N2) |
880 | 872 | inline svector<T, N, A, Init>& svector<T, N, A, Init>::operator=(const svector<T, N2, A, I2>& rhs)
|
881 | 873 | {
|
882 | 874 | m_allocator = std::allocator_traits<allocator_type>::select_on_container_copy_construction(
|
|
0 commit comments