Ranges algorithm in LLVM 14 libc++

Viewed 83

I have this snippet.

#include <algorithm>
#include <vector>

int main() {
    std::vector<int> v1 = {1, 2, 3};
    std::vector<int> v2 = {4, 5, 6};

    return std::ranges::equal(v1, v2);
}

I compile it with GCC 10 (Debian stable) and everything's alright:

$ g++ -std=c++20 test.cpp -o test
<compiles fine>

I compile it with Clang 14 and libc++14 (Debian stable, installed from packages from apt.llvm.org):

$ clang++-14 -std=c++20 -stdlib=libc++ test.cpp -o test
test.cpp:8:25: error: no member named 'equal' in namespace 'std::ranges'
    return std::ranges::equal(v1, v2);
           ~~~~~~~~~~~~~^
1 error generated.

Same for a lot of other things. Is libc++ support for the ranges library really so behind or am I missing something?

1 Answers
Related