API Reference > Other Classes > OdSmartPtr Template > OdSmartPtr Methods > attach Method > OdSmartPtr::attach Method (T*)
OdSmartPtr::attach Method (T*)
Syntax
C++
void attach(const T* pObject);
Parameters 
Description 
const T* 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.