basic c++ constructor snippet