Reputation: 8386
I feel like this should be very easy, but I am unable to find an applicable question.
X
is a shared_ptr<shared_ptr<Item> >
.
I have a function that accepts a shared_ptr<Item>
How do I get that inner pointer? I can't just do X ->
, and X->get()
will return an Item*
Upvotes: 0
Views: 59
Reputation: 254501
As with a normal pointer, you access a shared pointer's target by dereferencing it:
f(*X);
Upvotes: 3