I propose that the following:
struct Foo {
int Method(int arg)
{
int Foo::record;
record = arg;
return arg + 4u;
}
};
behaves the same as:
struct Foo {
int record;
int Method(int arg)
{
record = arg;
return arg + 4u;
}
};
There are times when a method needs a simple variable such as a
counter or a boolean, and so we then need to add a member variable to
the class definition. I'm proposing that we can do all of this inside
the body of the method -- so long as the body of the method is inline
inside the class definition. I also propose that the variable "record"
would be inaccessible by other methods.
That's going down the "Python path" of making the code more
obscure and less maintainable IMHO...
|
|
|||||||
Le message ci-dessus,
ainsi que les documents l'accompagnant, sont destinés
uniquement aux personnes identifiées et peuvent contenir
des informations privilégiées, confidentielles ou ne
pouvant être divulguées. Si vous avez reçu ce message par
erreur, veuillez le détruire.This communication (and/or the attachments) is intended for named recipients only and may contain privileged or confidential information which is not to be disclosed. If you received this communication by mistake please destroy all copies. |
||||||||