RandLib icon indicating copy to clipboard operation
RandLib copied to clipboard

Some of the functions declared constexpr are not cross-compilable

Open nyoungbq opened this issue 2 years ago • 1 comments

I don't know if this is directly pertinent to you, depending on what platforms you want to support. If it's not feel free to close the issue.

There are a multitude of places throughout the code base that use the identifier constexpr, but make calls to std::pow, std::log, and std::sqrt in the definitions. These are not actually defined as constexpr in the c++ standard (see this stackoverflow post) and as such any standard compiler other than GCC will throw errors when trying to compile the library.

I have made a workaround for this on my personal fork of this repository using a few header only files from the kthohr/gcem library. I don't know if you want to bring in external libraries but it is at least worth looking at if you need a launch point. Likewise, you are welcome to review my fork for reference. If you want I will be happy to open a pull request from that fork here, but there are significant modifications to the structuring and include paths on mine (It's currently a work in progress).

nyoungbq avatar May 23 '23 16:05 nyoungbq