mirror of
https://github.com/boostorg/container.git
synced 2025-07-31 21:14:30 +02:00
Fixes #161: ("polymorphic_allocator(memory_resource*) non-standard extension causes headache")
This commit is contained in:
@@ -1338,6 +1338,14 @@ use [*Boost.Container]? There are several reasons for that:
|
||||
|
||||
[section:release_notes Release Notes]
|
||||
|
||||
[section:release_notes_boost_1_75_00 Boost 1.75 Release]
|
||||
|
||||
* New [classref boost::container::devector devector] container.
|
||||
* Fixed bugs/issues:
|
||||
* [@https://github.com/boostorg/container/issues/157 GitHub #157: ['"Add missing include"]].
|
||||
|
||||
[endsect]
|
||||
|
||||
[section:release_notes_boost_1_74_00 Boost 1.74 Release]
|
||||
|
||||
* Fixed bugs/issues:
|
||||
|
@@ -53,10 +53,9 @@ class polymorphic_allocator
|
||||
//! <b>Throws</b>: Nothing
|
||||
//!
|
||||
//! <b>Notes</b>: This constructor provides an implicit conversion from memory_resource*.
|
||||
//! Non-standard extension: if r is null m_resource is set to get_default_resource().
|
||||
polymorphic_allocator(memory_resource* r)
|
||||
: m_resource(r ? r : ::boost::container::pmr::get_default_resource())
|
||||
{}
|
||||
: m_resource(r)
|
||||
{ BOOST_ASSERT(r != 0); }
|
||||
|
||||
//! <b>Effects</b>: Sets m_resource to
|
||||
//! other.resource().
|
||||
|
@@ -25,9 +25,6 @@ void test_default_constructor()
|
||||
|
||||
void test_resource_constructor()
|
||||
{
|
||||
polymorphic_allocator<int> a(0);
|
||||
BOOST_TEST(a.resource() == get_default_resource());
|
||||
|
||||
derived_from_memory_resource d;
|
||||
polymorphic_allocator<int> b(&d);
|
||||
BOOST_TEST(&d == b.resource());
|
||||
|
Reference in New Issue
Block a user