oop - why wasn't the idea of nested functions, implemented in older c++ standard? -
Nested functions are considered useless during the development of the older C ++ standard, because its use is basically covered Another concept like object-oriented programming; Or was it not implemented as a matter of simplification?
nested functions - be useful - see the stack frame of functions containing the need reference:
square fu () {zero triprip () {int i = 0; Zero dip () {// ...} int x = 12; For (i = 1; i & lt; 3; ++ i) {int z = 33; Dunk (); // ...}}}
Which value should access the debug ()?
Nobody? You have just duplicated the functionality of anonymous (anonymous) namespace, more or less.
Only me, because there is only one defined before the function?
Only for I and x, because they are in the field of SM Dip ()
? Is the compiler to ensure that the constructors of x
were already executed, or is this your job?
What about G?
, __auto_struct_Dip * stackContext) {// ...}
You have repeatedly duplicated the functionality of structs / classes and member functions, but on two inconsistent and non-exchangable paths. This is a very complexity for a suspicious advantage.
I've wished for local work many times, just because it will indicate a better scope where it is necessary. But with all the questions ... there are more useful things to throw more complexity on C ++.
Comments
Post a Comment