From 50c4fdd96587d8e501760f6ab4224ccdfea40eca Mon Sep 17 00:00:00 2001 From: Kochin Ivan Date: Tue, 16 Nov 2021 20:21:02 +0300 Subject: [PATCH] Use custom constant iterator to get rid of forbidden constant allocator Signed-off-by: Kochin Ivan --- test/common/concepts_common.h | 11 +++++------ test/tbb/test_parallel_sort.cpp | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/test/common/concepts_common.h b/test/common/concepts_common.h index c3781270d4e..0ca66048a92 100644 --- a/test/common/concepts_common.h +++ b/test/common/concepts_common.h @@ -256,6 +256,11 @@ namespace parallel_sort_value { using NonMoveAssignableValue = ParallelSortValue; using NonComparableValue = ParallelSortValue; } // namespace parallel_sort_value +template +class ConstantIT { + T data{}; + const T& operator* () const { return data; } +}; namespace container_based_sequence { template @@ -272,12 +277,6 @@ using NoEnd = ContainerBasedSequence; template using CustomValueCBS = ContainerBasedSequence; -template -class ConstantIT { - T data{}; - const T& operator* () const { return data; } -}; - struct ConstantCBS { ConstantIT begin() const { return ConstantIT{}; } ConstantIT end() const { return ConstantIT{}; } diff --git a/test/tbb/test_parallel_sort.cpp b/test/tbb/test_parallel_sort.cpp index d4428f12ded..132792488a0 100644 --- a/test/tbb/test_parallel_sort.cpp +++ b/test/tbb/test_parallel_sort.cpp @@ -238,10 +238,10 @@ void test_psort_iterator_constraints() { static_assert(can_call_parallel_sort_with_iterator::iterator>); static_assert(!can_call_parallel_sort_with_iterator>); static_assert(!can_call_parallel_sort_with_iterator>); - static_assert(!can_call_parallel_sort_with_iterator>); static_assert(!can_call_parallel_sort_with_iterator>); static_assert(!can_call_parallel_sort_with_iterator>); static_assert(!can_call_parallel_sort_with_iterator>); + static_assert(!can_call_parallel_sort_with_iterator>); static_assert(can_call_parallel_sort_with_iterator_and_compare, CorrectCompare>); static_assert(can_call_parallel_sort_with_iterator_and_compare::iterator, CorrectCompare>);