Fixes #334 ("Wrong overload resolution protection in implementation of P2363R5") and adds tests with transparent comparator for associative containers.

This commit is contained in:
Ion Gaztañaga
2026-03-22 17:26:15 +01:00
parent 0f99763ea7
commit ce12d2aec5
6 changed files with 88 additions and 33 deletions
+12 -3
View File
@@ -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;
}
}
////////////////////////////////////