mstorsjo / llvm-mingw

An LLVM/Clang/LLD based mingw-w64 toolchain
Other
1.97k stars 188 forks source link

error: no member named 'join_with' in namespace 'std::ranges::views' #428

Open Ioannis-Markos-Angelidakis opened 5 months ago

Ioannis-Markos-Angelidakis commented 5 months ago

Isn't std::views::join_with implemented ? Works with gcc 14 and std=c++23

#include <print>
#include <ranges>
#include <string>

std::int32_t main() {
    std::string str = R"(%userprofile%\Doc\do\%\%%)";

    auto first_split = str | std::views::split('%') 
                                  | std::views::take(2) 
                                  | std::views::join 
                                  | std::ranges::to<std::string>();

    auto second_split = str | std::views::split('%') 
                                    | std::views::drop(2) 
                                    | std::views::join_with('%')
                                    | std::ranges::to<std::string>();

    std::string path = first_split +  second_split;

    std::print("{}\n{}", first_split, second_split);
}
mstorsjo commented 5 months ago

See https://libcxx.llvm.org/Status/Cxx23.html - it looks like views::join_with is still in progress.