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 // Type checkers used for the transparent member functions added by C++20 and up
template <class, class, class = void> template <class, class = void> struct is_transparent : public false_type
struct is_transparent : public false_type
{ {
}; };
template <class X, class T> template <class T>
struct is_transparent<X, T, struct is_transparent<T,
typename boost::make_void<typename T::is_transparent>::type> typename boost::make_void<typename T::is_transparent>::type>
: public true_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 // Explicitly call a destructor

View File

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