B
Bhushit Joshipura
It is illegal in g++ to default argument #6 to argument #5. I get an
error
[bhushit@x1-6-00-c0-49-b3-8a-c5 constantsum]$ g++ -g ../../surface.cpp
.../../../segments/segment.cpp
.../../../segments/geodesic-geodesic-state.cpp
.../../../segments/circular-circular-state.cpp *.cpp
ysumsphere.cpp:33: `where_00_ends' was not declared in this scope
for the code
Ysumsphere::Ysumsphere ( int x_min, int x_max, int y_min, int y_max,
int where_00_ends, int where_0max_ends = where_00_ends ) {
....
}
Definition : Monkeying
"Being able to express default arguments in terms of explicit
arguments"
My questions:
1. By the time the compiler sees arg #6, arg #5 is already seen. Why
does it fuss?
2. I can see cases in which Monkeying prevents unwanted assumptions
about explicit arguments. Do I miss a lesson in designing?
3. I fail to see anything fundamentally wrong with Monkeying. It is
just a matter of adding some more code to prologue of a function code.
Does it conflict with some absence of specification of order of
evaluation of arguments in C++?
4.I am sure I am neither the first nor the last to need this. How to
solve the situation the best? I do not want to put this burden on the
user of the class.
Any help appreciated.
-Bhushit
error
[bhushit@x1-6-00-c0-49-b3-8a-c5 constantsum]$ g++ -g ../../surface.cpp
.../../../segments/segment.cpp
.../../../segments/geodesic-geodesic-state.cpp
.../../../segments/circular-circular-state.cpp *.cpp
ysumsphere.cpp:33: `where_00_ends' was not declared in this scope
for the code
Ysumsphere::Ysumsphere ( int x_min, int x_max, int y_min, int y_max,
int where_00_ends, int where_0max_ends = where_00_ends ) {
....
}
Definition : Monkeying
"Being able to express default arguments in terms of explicit
arguments"
My questions:
1. By the time the compiler sees arg #6, arg #5 is already seen. Why
does it fuss?
2. I can see cases in which Monkeying prevents unwanted assumptions
about explicit arguments. Do I miss a lesson in designing?
3. I fail to see anything fundamentally wrong with Monkeying. It is
just a matter of adding some more code to prologue of a function code.
Does it conflict with some absence of specification of order of
evaluation of arguments in C++?
4.I am sure I am neither the first nor the last to need this. How to
solve the situation the best? I do not want to put this burden on the
user of the class.
Any help appreciated.
-Bhushit