Boost logo

Boost :

From: Proton (matt_at_[hidden])
Date: 2022-08-18 02:16:09

> On Aug 17, 2022, at 12:29 PM, Gero Peterhoff via Boost <boost_at_[hidden]> wrote:
>> Gero,
>> Some of the checks you will find in the ccmath library seem common sense, but it is implemented to match the C++23 proposal (now standard) for constexpr cmath and cstdlib functionality. We used C++17 throughout to provide a clean solution with a reasonable language standard. If you look at the definition of BOOST_MATH_IS_CONSTANT_EVALUATED we are already using compiler intrinsics to allow this to be used without C++20s std::is_constant_evaluated. For non-trivial functionality C++11 would become extremely difficult to implement. C++14 would require code bloat that we can get around with if constexpr. Feel free to open up PRs and I will review your solutions.
>> Matt
> Hello Matt, Hello John,
> I wrote that it is possible to define workarounds. This even works with C++11 without having to fiddle on ccmath. But for that I need a few #define and the code has to be C++11-compatible (single return statement). In this way, constexpr boost::math functions can already be implemented if the compiler supports it. I have implemented a few functions for testing and would like to ask whether I can implement the remaining functions in this way. If this is not ok, please let me know exactly under which conditions this would have to be done.
> thx
> Gero
> _______________________________________________
> Unsubscribe & other changes:
> <OpenPGP_signature.sig>


No issues with any improvement that would allow any of the functions to be used in a constexpr context if available. Feel free to submit your PRs here: One thing to note in your example is the inclusion of several other boost headers. About a year ago we first introduced a standalone math module that has zero internal boost dependencies. MSVC has since incorporated this into their implementation of the STL for the math special functions. I can help you workaround the need for boost components.


Boost list run by bdawes at, gregod at, cpdaniel at, john at