diff --git a/include/boost/unordered/detail/implementation.hpp b/include/boost/unordered/detail/implementation.hpp index 1dd11ecb..4ee11748 100644 --- a/include/boost/unordered/detail/implementation.hpp +++ b/include/boost/unordered/detail/implementation.hpp @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include @@ -618,39 +619,6 @@ namespace boost { #endif -//////////////////////////////////////////////////////////////////////////// -// Type checkers used for the transparent member functions added by C++20 and up - - template struct is_transparent : public false_type - { - }; - - template - struct is_transparent::type> - : public true_type - { - }; - - template struct are_transparent - { - static bool const value = - is_transparent::value && is_transparent::value; - }; - - template struct transparent_non_iterable - { - typedef typename UnorderedMap::hasher hash; - typedef typename UnorderedMap::key_equal key_equal; - typedef typename UnorderedMap::iterator iterator; - typedef typename UnorderedMap::const_iterator const_iterator; - - static bool const value = - are_transparent::value && - !boost::is_convertible::value && - !boost::is_convertible::value; - }; - //////////////////////////////////////////////////////////////////////////// // Explicitly call a destructor diff --git a/include/boost/unordered/detail/type_traits.hpp b/include/boost/unordered/detail/type_traits.hpp new file mode 100644 index 00000000..3d7dcf67 --- /dev/null +++ b/include/boost/unordered/detail/type_traits.hpp @@ -0,0 +1,59 @@ +// Copyright (C) 2022 Christian Mazakas +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNORDERED_DETAIL_TYPE_TRAITS_HPP +#define BOOST_UNORDERED_DETAIL_TYPE_TRAITS_HPP + +#include +#if defined(BOOST_HAS_PRAGMA_ONCE) +#pragma once +#endif + +#include +#include +#include + +namespace boost { + namespace unordered { + namespace detail { + //////////////////////////////////////////////////////////////////////////// + // Type checkers used for the transparent member functions added by C++20 + // and up + + template + struct is_transparent : public boost::false_type + { + }; + + template + struct is_transparent::type> + : public boost::true_type + { + }; + + template struct are_transparent + { + static bool const value = + is_transparent::value && is_transparent::value; + }; + + template struct transparent_non_iterable + { + typedef typename UnorderedMap::hasher hash; + typedef typename UnorderedMap::key_equal key_equal; + typedef typename UnorderedMap::iterator iterator; + typedef typename UnorderedMap::const_iterator const_iterator; + + static bool const value = + are_transparent::value && + !boost::is_convertible::value && + !boost::is_convertible::value; + }; + } // namespace detail + } // namespace unordered +} // namespace boost + +#endif // BOOST_UNORDERED_DETAIL_TYPE_TRAITS_HPP