#C++ &-Referencing
07-Mar-90 11:35:02
Sb: #24393-#C++ &-Referencing
Fm: Bob Goldrich 73427,2414
To: John M. Dlugosz 74066,3717
John,
> The _TEMxx is the hidden parameter for the answer area. The caller
> tells the function where to put the result.
Is this "answer area" required when *not* using variadic functions? I have a
vector class which looks (more or less) like this:
class vector {
int x, y, z ;
public:
vector( int xx=0, int yy=0, int zz=0 ) ; // constructor
vector operator+( vector& v ) ; // addition
} ;
vector vector::operator+( vector &va )
{
return vector( x+va.x, y+va.y, z+va.z ) ;
}
Here operator+() returns a vector (structure). It seems that Zortech is
first stuffing the return value (vector) into one of these _TMP variables
and returning a pointer. My understanding is that this should not require an
answer area since it is not a variadic function, and that the return value
should be returned on the stack. Am I wrong? I can't write serious vector
math equations when the compiler keeps chewing up the data area with _TMPs.
BTW, I have called Zortech about this to ask, but everyone is out
promoting the product.
Sounds like your article is just what I need. I'll try to find it.
Thanks, Bob.