is this correct usage for a smart_ptr

I was wondering if the following code is correct.

1
2
3
4
5
6
  void ofxDGlobalTangibleList::addTangible(ofxDTangibleBase *t) {
    
    shared_ptr<ofxDTangibleBase> sp(t);
    addTangible(sp);
    
}


I have another method called addTangible that accepts shared_ptr<ofxDTangibleBase>.
I wonder in the method above, does a copy of ofxDTangibleBase gets created or not?
And does the shared_ptr still exists when the method goes out of scope.
I know shared_ptr are a bit different, like your not suppose to reference them for example.
Topic archived. No new replies allowed.