Fixes #161: ("polymorphic_allocator(memory_resource*) non-standard extension causes headache")

This commit is contained in:
Ion Gaztañaga
2020-08-31 13:37:11 +02:00
parent 438813726b
commit 0b297019ec
3 changed files with 10 additions and 6 deletions
@@ -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().