Note: Using these functions to do the actual retain/release in the .cpp file so that RefPtr<T> can be used for forward referenced types. 

We could do the actual retain/release inline and have type correctness (avoiding the cast to const void*) but it means client code must include the header files for all the types used in RefPtr<T>, which may have an unacceptable impact on build times and introduce more cross header dependencies. Instead we accept the loss of type information here and try to verify the type of the pointer in the .cpp file in debug (using dynamic_cast<>) as a tradeoff for less dependencies in header files using RefPtr<T>.