Re: [AD] C++ fix math

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Friday 09 August 2002 08:20, Hein Zelle wrote:
> The problem is that we're not defining an operator like that, but a
> function which is also present in the standard C library, without a
> namespace (if I remember correctly).

If you #include <math.h>, then it is not in a namespace; if you #include 
<cmath>, then it is in namespace std[1].

Another solution to this dilemma would be to put the fix class in its 
own namespace; that way, you have to either qualify uses to fix or put 
'using' statements in your code. I still prefer Eric's solution, 
though, since it seems to break the least code.

[1] The C++ Programming Language, 3rd edition, section 16.1.2.

Bye for now,
- -- 
Laurence Withers,  lwithers@xxxxxxxxxx
(GnuPG 04A646EA) http://www.lwithers.demon.co.uk/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9U7oNUdhclgSmRuoRAtdOAJ9RfYgxsKgB321aYqUd/pmEnmxSJQCfeI2l
YkqHu6NEC2H6QKcnvN4abLA=
=BrTU
-----END PGP SIGNATURE-----



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/