Is fabsf part of the std namespace in C++11?

前端 未结 2 1339
梦如初夏
梦如初夏 2021-01-18 14:28

The page https://en.cppreference.com/w/cpp/numeric/math/fabs mentions that std::fabsf is available since C++11. However, when I use G++ 6.3.0 to compile even th

2条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-18 14:44

    It looks like cppreference is incorrect. It appears this was added for C++17 since it was added to the draft in 2016 with the title [numerics] Apply P0175 (C Synopses) and we can see p0175r1 does indeed add:

     float fabsf(float x);
    

    The libc++ status does not indicate a status for p0175r1 so that would indicate that it does not support these changes yet. I can't find a line item for the proposal in tjhe libstdc++ status page.

提交回复
热议问题