Such as:
Struct SProto
{
Private:
Int32 id_;
Int32 idx_;
Int32 day_;
Int32 plan_.
Int32 need_;
Int32 x_;
Int32 y_;
}
This configuration type, don't want to external can change its value, then how many functions to do? If members more?
So c + + and is worth to change places, is to increase a way, external read-only mode, it will save you write users read the function of the time,
CodePudding user response:
You can in the get function with one parameter, the parameters selected for which members,The key value
CodePudding user response:
Don't want to write their own compiler generally has its own complement the function of the code, click on the variable, and then press ALT + ENTER keyboard will appear intelligent window, choose the filling line, or, as the upstairs said, through a function, construct a mapping table, can also be outputCodePudding user response:
The proposal is worth thinking aboutCodePudding user response:
Public:Const
Or directly to this period of memory mapped out,
CodePudding user response:
Now, the compiler function and a strongCodePudding user response:
Can use the macro definition# define pridata (type, name, refix) \
Privata: \
Type the name=value; \
Public: \
Type refix# # name () \
{\
return name; \
}
CodePudding user response: