DPtr< T > Class Template Reference

#include <dptr.h>

+ Inheritance diagram for DPtr< T >:

Public Member Functions

 DPtr (const DPtr &other)
 
const DPtroperator= (const DPtr &other)
 

Detailed Description

template<class T>
class DPtr< T >

RAII wrapper for implementing d-pointers. The resulting object can be copied through normal copy construction and assignment. Additionally it is compatible with all implicitly generated functions. (Note that implicitly generated functions are inlined so adding one to your class later will break your ABI.)

Use in your class declaration is fairly standard except that T should be the type of the class it is contained in. In your implementation file you will need to specialize PrivData<T> (which can be done with the DClass<T> macro). Additionally every member of this class must be specialized in the implementation file, which will usually be done with DPointered(T) or DPointeredNoCopy(T). The implementation of these functions is fairly trivial so they could be specialized manually as a way out of the previously mentioned ABI breakage.

Definition at line 54 of file dptr.h.


The documentation for this class was generated from the following file: