c++: Probleme mit smart pointern