Using a modern approach with C++