Replace usage of compound is_transparent type trait with singular usage of are_transparent

This commit is contained in:
Christian Mazakas
2021-12-17 09:47:12 -08:00
parent 9945ce7583
commit d8fe1a17cc
2 changed files with 18 additions and 22 deletions

View File

@ -701,18 +701,23 @@ namespace boost {
////////////////////////////////////////////////////////////////////////////
// Type checkers used for the transparent member functions added by C++20 and up
template <class, class, class = void>
struct is_transparent : public false_type
template <class, class = void> struct is_transparent : public false_type
{
};
template <class X, class T>
struct is_transparent<X, T,
template <class T>
struct is_transparent<T,
typename boost::make_void<typename T::is_transparent>::type>
: public true_type
{
};
template <class, class A, class B> struct are_transparent
{
static bool const value =
is_transparent<A>::value && is_transparent<B>::value;
};
////////////////////////////////////////////////////////////////////////////
// Explicitly call a destructor

View File

@ -432,8 +432,7 @@ namespace boost {
template <class Key>
typename boost::enable_if_c<
detail::is_transparent<Key, H>::value &&
detail::is_transparent<Key, P>::value &&
detail::are_transparent<Key, H, P>::value &&
!boost::is_convertible<Key, iterator>::value &&
!boost::is_convertible<Key, const_iterator>::value,
node_type>::type
@ -725,8 +724,7 @@ namespace boost {
template <class Key>
typename boost::enable_if_c<
detail::is_transparent<Key, H>::value &&
detail::is_transparent<Key, P>::value &&
detail::are_transparent<Key, H, P>::value &&
!boost::is_convertible<Key, iterator>::value &&
!boost::is_convertible<Key, const_iterator>::value,
size_type>::type
@ -774,8 +772,7 @@ namespace boost {
const_iterator find(const key_type&) const;
template <class Key>
typename boost::enable_if_c<detail::is_transparent<Key, H>::value &&
detail::is_transparent<Key, P>::value,
typename boost::enable_if_c<detail::are_transparent<Key, H, P>::value,
iterator>::type
find(const Key& key)
{
@ -785,8 +782,7 @@ namespace boost {
}
template <class Key>
typename boost::enable_if_c<detail::is_transparent<Key, H>::value &&
detail::is_transparent<Key, P>::value,
typename boost::enable_if_c<detail::are_transparent<Key, H, P>::value,
const_iterator>::type
find(const Key& key) const
{
@ -808,8 +804,7 @@ namespace boost {
size_type count(const key_type&) const;
template <class Key>
typename boost::enable_if_c<detail::is_transparent<Key, H>::value &&
detail::is_transparent<Key, P>::value,
typename boost::enable_if_c<detail::are_transparent<Key, H, P>::value,
size_type>::type
count(const Key& k) const
{
@ -828,8 +823,7 @@ namespace boost {
const key_type&) const;
template <class Key>
typename boost::enable_if_c<detail::is_transparent<Key, H>::value &&
detail::is_transparent<Key, P>::value,
typename boost::enable_if_c<detail::are_transparent<Key, H, P>::value,
std::pair<iterator, iterator> >::type
equal_range(const Key& key)
{
@ -842,8 +836,7 @@ namespace boost {
}
template <class Key>
typename boost::enable_if_c<detail::is_transparent<Key, H>::value &&
detail::is_transparent<Key, P>::value,
typename boost::enable_if_c<detail::are_transparent<Key, H, P>::value,
std::pair<const_iterator, const_iterator> >::type
equal_range(const Key& key) const
{
@ -1449,8 +1442,7 @@ namespace boost {
const_iterator find(const key_type&) const;
template <class Key>
typename boost::enable_if_c<detail::is_transparent<Key, H>::value &&
detail::is_transparent<Key, P>::value,
typename boost::enable_if_c<detail::are_transparent<Key, H, P>::value,
iterator>::type
find(const Key& key)
{
@ -1460,8 +1452,7 @@ namespace boost {
}
template <class Key>
typename boost::enable_if_c<detail::is_transparent<Key, H>::value &&
detail::is_transparent<Key, P>::value,
typename boost::enable_if_c<detail::are_transparent<Key, H, P>::value,
const_iterator>::type
find(const Key& key) const
{