Where are std::sinf( float ) etc.
Ed Smith-Rowland
3dw4rd@verizon.net
Tue Jan 10 01:52:00 GMT 2006
Jonathan Wakely wrote:
>On Thu, Dec 29, 2005 at 07:41:56PM -0500, Ed Smith-Rowland wrote:
>
>
>>My suggestion was NOT to add TR1 math functions to c_std/std_cmath.h but
>>rather to create a new tr1/std_cmath.h with the TR1 math functions and
>>all the overloads in a manner very similar to what is in
>>c_std/std_cmath.h but in a separate location and under namespace
>>std::tr1::.
>>
>>
>
>I think the new header should be called tr1/cmath because the headers
>in the tr1 directory do not get the special processing that renames
>std/std_cfoo.h to cfoo (see the target stamp-std in include/Makefile.am)
>
>
Sounds good to me. I was going to put the special functions there in a
cmath.
>regards,
>
>jon
>
>
>
>
The more I think about these suffixed functions the less I like them. I
never liked them per se but I thought they were helpful for C++ to C99
migration. But now that I think of it, I don't see how std::sinf helps
that much. Why not have the suffixed math fuctions in the global
namespace (where C99 has them, essentially) and leave the usual
overloads in std?
I guess this is a standards / comp.lang.c++ issue.
C++ has namespaces for a reason. It seems a shame to bring c99 style
programming into namespace std.
Why can't the special functions in TR1 just have overloads and if, at a
later date, the C99 folks want to sync up with C++ just add the suffixed
::cyl_bessel_jf( float ) to the global namespace and have the real
std::cyl_bessel_j in std (after it graduates from std::tr1 of course :-)).
Maybe/probably I'm missing something.
Ed Smith-Rowland
More information about the Libstdc++
mailing list