Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libc++] __cpp_lib_ranges is defined without all views being available #70557

Open
philnik777 opened this issue Oct 28, 2023 · 4 comments
Open
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. ranges Issues related to `<ranges>`

Comments

@philnik777
Copy link
Contributor

We've but views::join behind _LIBCPP_ENABLE_EXPERIMENTAL, but we didn't put __cpp_lib_ranges behind _LIBCPP_ENABLE_EXPERIMENTAL.

@philnik777 philnik777 added libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. ranges Issues related to `<ranges>` labels Oct 28, 2023
@changkhothuychung
Copy link
Contributor

I am not sure how difficult this can be, but if there is some instruction I would like to take this one.

@ldionne
Copy link
Member

ldionne commented Dec 1, 2023

I would suggest closing this without any resolution -- we're about to take join_view out of experimental state with #66033.

@frederick-vs-ja
Copy link
Contributor

frederick-vs-ja commented Dec 12, 2023

Maybe related: __cpp_lib_ranges is currently defined as 202207L but std::ranges::range_adaptor_closure is not yet implemented.

@h-2
Copy link
Member

h-2 commented Dec 28, 2023

Maybe related: __cpp_lib_ranges is currently defined as 202207L but std::ranges::range_adaptor_closure is not yet implemented.

I have just run into this 😭

I previously had:

#if defined(__cpp_lib_ranges) && __cpp_lib_ranges >= 202202L
template <typename T>
using range_adaptor_closure = std::ranges::range_adaptor_closure<T>;
#elif defined(__GLIBCXX__)
template <typename T>
    requires(std::is_class_v<T> && std::same_as<T, std::remove_cv_t<T>>)
struct range_adaptor_closure : std::ranges::views::__adaptor::_RangeAdaptorClosure
{};
#elif defined(_LIBCPP_VERSION)
template <typename T>
using range_adaptor_closure = std::__range_adaptor_closure<T>;
#else
#    error "Requires modern standard library or older libstdc++ or libc++."
#endif

Now, I will need to add more checks...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. ranges Issues related to `<ranges>`
Projects
None yet
Development

No branches or pull requests

5 participants