rx-ranges icon indicating copy to clipboard operation
rx-ranges copied to clipboard

Explicitly include cmath for std::sqrt

Open jamesjer opened this issue 1 year ago • 0 comments

On a Fedora 42 Beta machine, building tests with g++ 15.0.1 and doctest 2.4.11 fails:

test_ranges.cpp: In member function ‘constexpr void {anonymous}::normalize::Range<Input>::sink(Out&) &&’:
test_ranges.cpp:784:32: error: ‘sqrt’ is not a member of ‘std’; did you mean ‘sort’? [-Wtemplate-body]
  784 |             auto length = std::sqrt(out | transform(square) | sum());
      |                                ^~~~
      |                                sort

Explicitly #include <cmath> to be sure that std::sqrt is defined.

jamesjer avatar Apr 04 '25 21:04 jamesjer