This is wrong. It won't even compile. You must use mem-initialization as you did in your previous example to initialize base classes. You should use it for data members otherwise you pointlessly default initialize members first only to assign them immediately afterwards. So the code is very much not the same.
And you should be passing string by const& otherwise you make pointless copies of the string.
This is wrong. It won't even compile. You must use mem-initialization as you did in your previous example to initialize base classes. You should use it for data members otherwise you pointlessly default initialize members first only to assign them immediately afterwards. So the code is very much not the same.
And you should be passing
stringbyconst&otherwise you make pointless copies of the string.Yeah
I just realized. I will make the correction right now. Thank you😊