|
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 <std::input_iterator 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 <std::input_iterator 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,19 +667,21 @@ 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 <std::input_iterator 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>> |
682 | | - explicit svector(const svector<T, N2, A, I2>& rhs); |
| 673 | + template <std::size_t N2, bool I2> |
| 674 | + explicit svector(const svector<T, N2, A, I2>& rhs) |
| 675 | + requires(N != N2); |
683 | 676 |
|
684 | 677 | svector& operator=(const svector& rhs); |
685 | 678 | svector& operator=(svector&& rhs) noexcept(std::is_nothrow_move_assignable<value_type>::value); |
686 | 679 | svector& operator=(const std::vector<T>& rhs); |
687 | 680 | svector& operator=(std::initializer_list<T> il); |
688 | 681 |
|
689 | | - template <std::size_t N2, bool I2, class = std::enable_if_t<N != N2, void>> |
690 | | - svector& operator=(const svector<T, N2, A, I2>& rhs); |
| 682 | + template <std::size_t N2, bool I2> |
| 683 | + svector& operator=(const svector<T, N2, A, I2>& rhs) |
| 684 | + requires(N != N2); |
691 | 685 |
|
692 | 686 | svector(const svector& other); |
693 | 687 | svector(svector&& other) noexcept(std::is_nothrow_move_constructible<value_type>::value); |
@@ -809,16 +803,17 @@ namespace xt |
809 | 803 | } |
810 | 804 |
|
811 | 805 | template <class T, std::size_t N, class A, bool Init> |
812 | | - template <class IT, class> |
| 806 | + template <std::input_iterator IT> |
813 | 807 | inline svector<T, N, A, Init>::svector(IT begin, IT end, const allocator_type& alloc) |
814 | 808 | : m_allocator(alloc) |
815 | 809 | { |
816 | 810 | assign(begin, end); |
817 | 811 | } |
818 | 812 |
|
819 | 813 | template <class T, std::size_t N, class A, bool Init> |
820 | | - template <std::size_t N2, bool I2, class> |
| 814 | + template <std::size_t N2, bool I2> |
821 | 815 | inline svector<T, N, A, Init>::svector(const svector<T, N2, A, I2>& rhs) |
| 816 | + requires(N != N2) |
822 | 817 | : m_allocator(rhs.get_allocator()) |
823 | 818 | { |
824 | 819 | assign(rhs.begin(), rhs.end()); |
@@ -876,8 +871,9 @@ namespace xt |
876 | 871 | } |
877 | 872 |
|
878 | 873 | template <class T, std::size_t N, class A, bool Init> |
879 | | - template <std::size_t N2, bool I2, class> |
| 874 | + template <std::size_t N2, bool I2> |
880 | 875 | inline svector<T, N, A, Init>& svector<T, N, A, Init>::operator=(const svector<T, N2, A, I2>& rhs) |
| 876 | + requires(N != N2) |
881 | 877 | { |
882 | 878 | m_allocator = std::allocator_traits<allocator_type>::select_on_container_copy_construction( |
883 | 879 | rhs.get_allocator() |
|
0 commit comments