Strong & Weak pointer C++ implementation