I am working on some specialty template library, trying to write a template class that will not allow a constant type.
I've only come up with the following:
Expand|Select|Wrap|Line Numbers
- template <class T>
- class X
- {
- private:
- T* pObj;
- public:
- X(T* pObj)
- : pObj(pObj)
- {
- #ifndef NDEBUG
- *(this->pObj)=*pObj;
- #endif
- }
- };
Is there a simpler way?
Adrian