Blitz logo

Blitz Devel :

From: Todd Veldhuizen (tveldhui_at_[hidden])
Date: 1998-07-30 14:58:38


Steve Karmesin wrote:
> The issue here is that on at least one platform (Intel) the files like
> <cstring> exist, but they don't put their contents in std::. Yes, this is
> dumb.

This has been a major headache recently for Blitz, and POOMA 2
will run into the same problem: where are math functions located?

Blitz currently has the current monstrosity:

#if defined(BZ_MATH_FN_IN_NAMESPACE_STD)
  #define BZ_MATHFN_SCOPE(x) std::x
#elif defined(BZ_NAMESPACES)
  #define BZ_MATHFN_SCOPE(x) ::x
#else
  #define BZ_MATHFN_SCOPE(x) x
#endif

and then "cos" becomes "BZ_MATHFN_SCOPE(cos)". Erk.

The reason: some compilers put math functions in <cmath> and std::.
Others put them in the global namespace. Other compilers don't
have namespaces at all.

To make matters worse, some compilers put complex math
functions in std:: and scalar math functions in the
global namespace. So Blitz also needs a BZ_COMPLEX_MATHFN_SCOPE..
yes, it's hideous.

I vote we put ourselves in cryogenic storage until this mess
gets sorted out.

Cheers,
Todd