Skip to content

More conservative check for <string_view> availability. - #4

Merged
cmumford merged 1 commit into
masterfrom
cxx17
Sep 11, 2017
Merged

cmumford merged 1 commit into
masterfrom
cxx17

Conversation

@pwnall

@pwnall pwnall commented Sep 10, 2017

Copy link
Copy Markdown
Contributor

has_include(<string_view>) does not imply that the header can be included and will work. The assumption fails on MSVC and libc++ [1, 2]. Conversely, checking that __cplusplus > 201402L is not sufficient on its own either, as the toolchain on Mac OS 10.12 passes that check but does not contain a <string_view> header.

[1] https://crbug.com/759349
[2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79433

has_include(<string_view>) does not imply that the header can be
included and will work. The assumption fails on MSVC and libc++ [1, 2].
Conversely, checking that __cplusplus > 201402L is not sufficient on its
own either, as the toolchain on Mac OS 10.12 passes that check but does
not contain a <string_view> header.

[1] https://crbug.com/759349
[2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79433
@pwnall
pwnall requested a review from cmumford September 10, 2017 07:17
@cmumford
cmumford merged commit d0f929a into master Sep 11, 2017
@pwnall
pwnall deleted the cxx17 branch September 11, 2017 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants