This might not be the right place for this post, but maybe I can get a
clarification on
what the C++ standard says.
g++ (GCC) 3.4.6 20060404 (Red Hat 3.4.6-3)
MS VC++ (2003): Version 7.1.3088
I have created a wrapper for the complex double so that I can forward
declare it
in other classes. Here is what I have had to do in my setters:
//-------------------------------------------------------------------------
inline
double ComplexDouble::real(double realPart)
//-------------------------------------------------------------------------
{
#ifdef WIN32
return impl_.real(realPart);
#else //LINUX
return ( impl_.real() = realPart );
#endif
}
//-------------------------------------------------------------------------
inline
double ComplexDouble::imag(double imagPart)
//-------------------------------------------------------------------------
{
#ifdef WIN32
return impl_.imag(imagPart);
#else //LINUX
return ( impl_.imag() = imagPart );
#endif
}
For some reason my version of g++ returns a writable reference as
opposed to passing the
parameter to set in as a method argument. I am not sure here but I
believe that VC++ is
implementing the standard correctly. Could this be a conflict with
the C standard or
something? In my experience, g++ usually wins the "closer to C++
standard" battles
but it does NOT appear to be the case here.
Thanks in advance,
Liam