bsl::shared_ptr::shared_ptr

Create a shared_ptr from the specified arguments.

Synopsis

Declared in <bslstl_sharedptr.h>

shared_ptr(
    element_type* ptr,
    BloombergLP::bslma::SharedPtrRep* rep);

Description

Create a shared pointer that takes ownership of the specified rep and refers to the modifiable object at the specified ptr address. The number of references to rep is NOT incremented. Note that if rep is a pointer to a class derived from BloombergLP::bslma::SharedPtrRep, the compiler will actually select the following (more general) constructor that has the same behavior: ` template <class COMPATIBLE_TYPE, class DELETER> shared_ptr(COMPATIBLE_TYPE *ptr, DELETER * deleter); `

Parameters

NameDescription
ptrpointer to the object to manage or refer to
repshared-pointer representation object