Member variables in a class are automatically initialized to their default values when an object of the class is created. Explicitly initializing them to the same default values is redundant and can clutter the code, making it harder to read and maintain.
To fix this issue, remove the unnecessary member initializations. This will make the code cleaner and more concise.
class Example {
int a;
float b;
std::string c;
public:
Example(): a{0}, b{0.0}, c{""} {}
};
class Example {
int a;
float b;
std::string c;
};