P
pauldepstein
Is it o.k. (from the point of view of both style and legality) for
functions to call on overloaded versions of themselves?
For example, I want to be able to do two things to my object which is
called node.
I want to be able to assign coordinates to it where the coordinates
correspond to specific integers; I also want coordinates assigned
based on the intrinsic properties of the node (independent of any other
specific integers.)
So I have code void set_coords( int x_coord, int y_coord)
{
}
Can I then introduce code
void set_coords()
{ int x;
int y;
x = .........;
y = ...;
set_coords(x, y);
} ?
My apologies if this sort of thing is done all the time -- as a novice,
I've never seen it.
If someone wants to say "Well, go ahead and try it!", then please note
that I also need to know whether this is considered o.k. from a style
perspective. It's obviously important to use clear conventions that
don't confuse others.
Thank you,
Paul Epstein
functions to call on overloaded versions of themselves?
For example, I want to be able to do two things to my object which is
called node.
I want to be able to assign coordinates to it where the coordinates
correspond to specific integers; I also want coordinates assigned
based on the intrinsic properties of the node (independent of any other
specific integers.)
So I have code void set_coords( int x_coord, int y_coord)
{
}
Can I then introduce code
void set_coords()
{ int x;
int y;
x = .........;
y = ...;
set_coords(x, y);
} ?
My apologies if this sort of thing is done all the time -- as a novice,
I've never seen it.
If someone wants to say "Well, go ahead and try it!", then please note
that I also need to know whether this is considered o.k. from a style
perspective. It's obviously important to use clear conventions that
don't confuse others.
Thank you,
Paul Epstein