yosh-matsuda / cpp-yyjson

Ultra-fast and intuitive C++ JSON reader/writer with yyjson backend
MIT License
57 stars 6 forks source link

error: 'transform' is not a member of 'std::ranges' #11

Closed stanlyshi closed 7 months ago

stanlyshi commented 7 months ago

When compiling in VS Code (Windows 11), an error occurred.

Compilation environment:

X:/VSCode/stktool/deps/cppyyjson/include/cpp_yyjson.hpp:3596:32: warning: unknown option after '#pragma GCC diagnostic' kind [-Wpragmas]
 3596 | #pragma GCC diagnostic ignored "-Wimplicit-float-conversion"
      |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
X:/VSCode/stktool/deps/cppyyjson/include/cpp_yyjson.hpp:3596:32: note: did you mean '-Wno-float-conversion'?
X:/VSCode/stktool/deps/cppyyjson/include/cpp_yyjson.hpp:3599:32: warning: unknown option after '#pragma GCC diagnostic' kind [-Wpragmas]
 3599 | #pragma GCC diagnostic ignored "-Wshorten-64-to-32"
      |                                ^~~~~~~~~~~~~~~~~~~~
X:/VSCode/stktool/deps/cppyyjson/include/cpp_yyjson.hpp: In static member function 'static auto yyjson::detail::default_caster<T>::from_json(const Json&)':
X:/VSCode/stktool/deps/cppyyjson/include/cpp_yyjson.hpp:3578:30: error: 'transform' is not a member of 'std::ranges'; did you mean 'transform_view'?
 3578 |                 std::ranges::transform(arr, std::back_inserter(result),
      |                              ^~~~~~~~~
      |                              transform_view
X:/VSCode/stktool/deps/cppyyjson/include/cpp_yyjson.hpp:3586:30: error: 'transform' is not a member of 'std::ranges'; did you mean 'transform_view'?
 3586 |                 std::ranges::transform(arr, std::ranges::begin(result),
      |                              ^~~~~~~~~
      |                              transform_view
make[2]: *** [CMakeFiles\model.dir\build.make:76: CMakeFiles/model.dir/test/model.cpp.obj] Error 1
make[1]: *** [CMakeFiles\Makefile2:255: CMakeFiles/model.dir/all] Error 2
make: *** [Makefile:155: all] Error 2