...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Return shared ownership of a new, dynamically allocated memory resource.
Defined in header <boost/json/storage_ptr.hpp>
template< class U, class... Args> friend storage_ptr make_shared_resource( Args&&... args);
This function dynamically allocates a new memory resource as if by operator new
that uses shared ownership. The lifetime of the memory resource will be
extended until the last storage_ptr
which points to it
is destroyed.
std::is_base_of< memory_resource, T >::value == true
Same as new T( std::forward<Args>(args)... )
.
Strong guarantee.
Type |
Description |
---|---|
|
The type of memory resource to create. |
Name |
Description |
---|---|
|
Parameters forwarded to the constructor of |
Convenience header <boost/json.hpp>