Skip to content

Commit

Permalink
Disable Wdeprecated-declarations when using deprecated allocator
Browse files Browse the repository at this point in the history
  • Loading branch information
igaztanaga committed Nov 28, 2024
1 parent 65dc4d1 commit 1f54321
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions include/boost/container/allocator_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -533,17 +533,35 @@ struct allocator_traits
inline static pointer priv_allocate(dtl::false_type, Allocator &a, size_type n, const_void_pointer)
{ return a.allocate(n); }

#if defined(BOOST_CONTAINER_GCC_COMPATIBLE_HAS_DIAGNOSTIC_IGNORED)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif

template<class T>
inline static void priv_destroy(dtl::true_type, Allocator &a, T* p) BOOST_NOEXCEPT_OR_NOTHROW
{ a.destroy(p); }

#if defined(BOOST_CONTAINER_GCC_COMPATIBLE_HAS_DIAGNOSTIC_IGNORED)
#pragma GCC diagnostic pop
#endif

template<class T>
inline static void priv_destroy(dtl::false_type, Allocator &, T* p) BOOST_NOEXCEPT_OR_NOTHROW
{ p->~T(); (void)p; }

#if defined(BOOST_CONTAINER_GCC_COMPATIBLE_HAS_DIAGNOSTIC_IGNORED)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif

inline static size_type priv_max_size(dtl::true_type, const Allocator &a) BOOST_NOEXCEPT_OR_NOTHROW
{ return a.max_size(); }

#if defined(BOOST_CONTAINER_GCC_COMPATIBLE_HAS_DIAGNOSTIC_IGNORED)
#pragma GCC diagnostic pop
#endif

inline static size_type priv_max_size(dtl::false_type, const Allocator &) BOOST_NOEXCEPT_OR_NOTHROW
{ return size_type(-1)/sizeof(value_type); }

Expand All @@ -553,6 +571,12 @@ struct allocator_traits
inline static const Allocator &priv_select_on_container_copy_construction(dtl::false_type, const Allocator &a) BOOST_NOEXCEPT_OR_NOTHROW
{ return a; }


#if defined(BOOST_CONTAINER_GCC_COMPATIBLE_HAS_DIAGNOSTIC_IGNORED)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif

#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
template<class T, class ...Args>
inline static void priv_construct(dtl::true_type, Allocator &a, T *p, BOOST_FWD_REF(Args) ...args)
Expand Down Expand Up @@ -598,6 +622,11 @@ struct allocator_traits

#endif // #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)

#if defined(BOOST_CONTAINER_GCC_COMPATIBLE_HAS_DIAGNOSTIC_IGNORED)
#pragma GCC diagnostic pop
#endif


template<class T>
inline static void priv_construct(dtl::false_type, Allocator &, T *p, const ::boost::container::default_init_t&)
{ ::new((void*)p, boost_container_new_t()) T; }
Expand Down

0 comments on commit 1f54321

Please sign in to comment.