Commit 90ae95ed authored by Yiding Jia's avatar Yiding Jia Committed by Facebook Github Bot

Fix folly/Range.h with c++17 and libc++ again

Summary:
Avoid create StringViewType if value_type is not POD, as with libc++ there is a
static_assert in the class body which seems to fail.

Reviewed By: yfeldblum

Differential Revision: D13015696

fbshipit-source-id: 090e5cd3f5e21aa8c22ea893e894b38fd3d2a745
parent faa7f7fb
...@@ -496,8 +496,11 @@ class Range { ...@@ -496,8 +496,11 @@ class Range {
// At the moment the set of implicit target types consists of just // At the moment the set of implicit target types consists of just
// std::string_view (when it is available). // std::string_view (when it is available).
#if FOLLY_HAS_STRING_VIEW #if FOLLY_HAS_STRING_VIEW
using StringViewType = struct NotStringView {};
std::basic_string_view<std::remove_const_t<value_type>>; using StringViewType = std::conditional_t<
std::is_pod<std::remove_const_t<value_type>>::value,
std::basic_string_view<std::remove_const_t<value_type>>,
NotStringView>;
template <typename Target> template <typename Target>
using IsConstructibleViaStringView = StrictConjunction< using IsConstructibleViaStringView = StrictConjunction<
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment