#pragma once template struct NiPointer { NiPointer& operator=(const NiPointer& acRhs) { if (object != acRhs.object) { if (acRhs.object) acRhs.object->IncRef(); if (object) object->DecRef(); object = acRhs.object; } return *this; } NiPointer& operator=(T* aRhs) { if (object != aRhs) { if (aRhs) aRhs->IncRef(); if (object) object->DecRef(); object = aRhs; } return *this; } T* object; };