| 21 | { |
| 22 | public: |
| 23 | void |
| 24 | testBoostPmr() |
| 25 | { |
| 26 | using allocator_type = container::pmr::polymorphic_allocator<value>; |
| 27 | |
| 28 | // pass polymorphic_allocator |
| 29 | // where storage_ptr is expected |
| 30 | { |
| 31 | monotonic_resource mr; |
| 32 | value jv( allocator_type{&mr} ); |
| 33 | object o( allocator_type{&mr} ); |
| 34 | array a( allocator_type{&mr} ); |
| 35 | string s( allocator_type{&mr} ); |
| 36 | } |
| 37 | { |
| 38 | monotonic_resource mr; |
| 39 | allocator_type a(&mr); |
| 40 | |
| 41 | boost::container::pmr::vector<value> v1(a); |
| 42 | v1.resize(3); |
| 43 | BOOST_TEST(v1[1].storage().get() == &mr); |
| 44 | |
| 45 | std::vector<value, allocator_type> v2(3, {}, a); |
| 46 | BOOST_TEST(v2[1].storage().get() == &mr); |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | // These are here instead of the type-specific |
| 51 | // test TUs, so that we only need to link to |