Use std::make_shared
:
auto p = std::make_shared<Node_names>(process);
This works for types with constructors with an arbitrary number of parameters.
Note that this is the recommended default way to create shared_ptr
s with managed objects. See Why should you almost always use make_shared to create an object to be owned by shared_ptrs?.