Open hj2000 opened 1 week ago
Can you explain why ranges::tranform can be compiled with c++20, but failed to be compiled with c++17?
ranges::tranform
#include <algorithm> #include <cmath> #include <iterator> #include <set> #include <range/v3/algorithm.hpp> int main () { std::vector<double> a{1.5,2.5,3.5}; std::set<double> b; std::ranges::transform( a, std::inserter( b, b.begin() ), []( double v ) -> double { return std::round( v ); } ); // compiles with c++20 ranges::transform( a, std::inserter( b, b.begin() ), []( double v ) -> double { return std::round( v ); } ); // compiles with c++20, but does not compile with c++17 return 0; }
gcc version: 14.1 range-v3 version: 0.12.0
Can you explain why
ranges::tranform
can be compiled with c++20, but failed to be compiled with c++17?gcc version: 14.1 range-v3 version: 0.12.0