facebook / folly

An open-source C++ library developed and used at Facebook.

Home Page:https://groups.google.com/forum/?fromgroups#!forum/facebook-folly

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Broken check for std::ranges?

rnurgaliyev opened this issue · comments

Hello!

I am very confused by the change introduced in 2cf8c88. According to https://en.cppreference.com/w/cpp/feature_test, #if defined(__cpp_lib_ranges) was a correct way to check if std::ranges is usable. I believe that #if __has_include(<ranges>) is not working as expected, since ranges.h is available in libfmt - a folly dependency. This code won't compile in C++17. And also it is not even done correctly in some places ("range" vs "ranges"):

#if __has_include(<range>)
static_assert(std::ranges::random_access_range<std::vector<int>>);
#endif