API Reference > Other Classes > OdSmartPtr Template > OdSmartPtr Methods > attach Method > OdSmartPtr::attach Method (OdRxObject*)
OdSmartPtr::attach Method (OdRxObject*)
Syntax
C++
void attach(OdRxObject* pObject);
Parameters 
Description 
OdRxObject* pObject 
[in] Pointer to the specifed object to be assigned. 

Assigns the pointer of the specifed object to the smart pointer without incrementing its reference counter. 

 

The reference counter of the specified object is not incremented. 

If the smart pointer is currently referencing to another object, that object is released prior to the assignment.

Example of a Typified Smart Pointer

Copyright © 2002–2020. Open Design Alliance. All rights reserved.