- Use newly added is_constructible to implement portably constructible_with_allocator_suffix/constructible_with_allocator_prefix

This commit is contained in:
Ion Gaztañaga
2025-11-29 21:51:31 +01:00
parent 5039410be5
commit fdf6b37b67

View File

@@ -32,6 +32,7 @@
#include <boost/container/detail/variadic_templates_tools.hpp>
#endif
#include <boost/move/utility_core.hpp>
#include <boost/container/detail/is_constructible.hpp>
namespace boost { namespace container {
@@ -79,29 +80,43 @@ namespace dtl {
template <class T, class InnerAlloc, class ...Args>
struct is_constructible_with_allocator_prefix
: constructible_with_allocator_prefix<T>
: boost::container::is_constructible<T, allocator_arg_t, InnerAlloc, Args...>
{};
template <class T, class InnerAlloc, class ...Args>
struct is_constructible_with_allocator_suffix
: constructible_with_allocator_suffix<T>
: boost::container::is_constructible<T, Args..., InnerAlloc>
{};
#else // #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
#else // !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
template <class T, class InnerAlloc, BOOST_MOVE_CLASSDFLT9>
struct is_constructible_with_allocator_prefix
template<class T, class InnerAlloc, BOOST_MOVE_CLASSDFLT9, class = void>
struct is_constructible_with_allocator_prefix;
: constructible_with_allocator_prefix<T>
{};
template <class T, class InnerAlloc, BOOST_MOVE_CLASSDFLT9>
struct is_constructible_with_allocator_suffix
template<class T, class InnerAlloc, BOOST_MOVE_CLASSDFLT9, class = void>
struct is_constructible_with_allocator_suffix;
: constructible_with_allocator_suffix<T>
{};
#endif // #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
#define BOOST_INTRUSIVE_IS_CONSTRUCTIBLE_WITH_ALLOCATOR(N) \
template <typename T, class InnerAlloc BOOST_MOVE_I##N BOOST_MOVE_CLASS##N>\
struct is_constructible_with_allocator_prefix\
<T, InnerAlloc BOOST_MOVE_I##N BOOST_MOVE_TARG##N>\
: boost::container::is_constructible<T, allocator_arg_t, InnerAlloc BOOST_MOVE_I##N BOOST_MOVE_TARG##N>\
{};\
\
template <typename T, class InnerAlloc BOOST_MOVE_I##N BOOST_MOVE_CLASS##N>\
struct is_constructible_with_allocator_suffix\
<T, InnerAlloc BOOST_MOVE_I##N BOOST_MOVE_TARG##N>\
: boost::container::is_constructible<T BOOST_MOVE_I##N BOOST_MOVE_TARG##N, InnerAlloc>\
{};\
//
BOOST_MOVE_ITERATE_0TO8(BOOST_INTRUSIVE_IS_CONSTRUCTIBLE_WITH_ALLOCATOR)
#undef BOOST_INTRUSIVE_IS_CONSTRUCTIBLE_WITH_ALLOCATOR
#endif // #if !defined(BOOST_NO_SFINAE_EXPR)
#endif //if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)