mirror of
https://github.com/boostorg/container.git
synced 2026-07-06 03:10:45 +02:00
Fixes #334 ("Wrong overload resolution protection in implementation of P2363R5") and adds tests with transparent comparator for associative containers.
This commit is contained in:
+12
-3
@@ -532,19 +532,19 @@ bool test_heterogeneous_lookup_by_partial_key()
|
||||
|
||||
}}}
|
||||
|
||||
template<class VoidAllocatorOrContainer>
|
||||
template<class VoidAllocatorOrContainer, bool Transparent = false>
|
||||
struct GetSetContainer
|
||||
{
|
||||
template<class ValueType>
|
||||
struct apply
|
||||
{
|
||||
typedef flat_set < ValueType
|
||||
, std::less<ValueType>
|
||||
, typename dtl::if_c<Transparent, test::less_transparent, std::less<ValueType> >::type
|
||||
, typename boost::container::dtl::container_or_allocator_rebind<VoidAllocatorOrContainer, ValueType>::type
|
||||
> set_type;
|
||||
|
||||
typedef flat_multiset < ValueType
|
||||
, std::less<ValueType>
|
||||
, typename dtl::if_c<Transparent, test::less_transparent, std::less<ValueType> >::type
|
||||
, typename boost::container::dtl::container_or_allocator_rebind<VoidAllocatorOrContainer, ValueType>::type
|
||||
> multiset_type;
|
||||
};
|
||||
@@ -733,6 +733,15 @@ int main()
|
||||
std::cout << "Error in set_test<new_allocator<void> >" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (0 != test::set_test
|
||||
< GetSetContainer<new_allocator<void>, true>::apply<test::movable_and_copyable_int>::set_type
|
||||
, MyStdSet
|
||||
, GetSetContainer<new_allocator<void>, true>::apply<test::movable_and_copyable_int>::multiset_type
|
||||
, MyStdMultiSet>()) {
|
||||
std::cout << "Error in set_test<new_allocator<void> >>, transparent" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user