cubiomes icon indicating copy to clipboard operation
cubiomes copied to clipboard

generator.h can't be included from c++20 and above

Open TheBjoel2 opened this issue 7 months ago • 0 comments

Including this header and building (g++ -std=c++20 file.cpp) the code results in an error:

In file included from cubiomes/noise.h:5,
                 from cubiomes/layers.h:4,
                 from cubiomes/generator.h:4,
                 from test.cpp:1:
/usr/include/c++/15.1.1/math.h:183:12: error: ‘constexpr double std::lerp(double, double, double)’ conflicts with a previous declaration
  183 | using std::lerp;
      |            ^~~~
In file included from cubiomes/noise.h:4:
cubiomes/rng.h:347:22: note: previous declaration ‘double lerp(double, double, double)’
  347 | static inline double lerp(double part, double from, double to)
      |                      ^~~~

std::lerp reference

TheBjoel2 avatar May 18 '25 17:05 TheBjoel2