Your approach is not flexible. When you have getter / setter for each variable, that means you donβt have to rewrite your set method if you add something to your class.
This is not good, because you cannot use const and non-const getters (which are rarely used, but can sometimes be useful).
You cannot copy links, so your class is not copied.
In addition, referring to the initialization in your class, this is additional memory, and if we are talking about, for example, a vertex class (although I think it should not be a class in fact), this can be a disaster.
[Everything that follows is completely subjective]
The goal of getters and setters, in my opinion, is not a simple modification, but to encapsulate a sequence of actions that leads to a change in value or returns a value (which we consider as a visible result).
The personal structure in the case of your example will be more efficient, because it wraps the POD data and logically "structures" it.
Costantino rupert
source share