This is an archive of the discontinued LLVM Phabricator instance.

Make the `<charconv>` header usable with C++11
ClosedPublic

Authored by mclow.lists on Mar 20 2019, 8:36 AM.

Details

Summary

We already support to_chars and from_chars back to C++14.
Tweak the code so that we can use it from C++11.

The motivation for this is D59178.
I really don't want *another* "integer to string" implementation in libc++.

Diff Detail

Event Timeline

mclow.lists created this revision.Mar 20 2019, 8:36 AM
lichray accepted this revision.Mar 20 2019, 9:08 AM
lichray added inline comments.
libcxx/test/support/charconv_test_helpers.h
125

Using auto here is fine.

134

Ditto.

This revision is now accepted and ready to land.Mar 20 2019, 9:08 AM
ldionne accepted this revision.Mar 20 2019, 9:11 AM

This is one acceptable reason to backport functionality to C++03 IMO. I'd rather have it be implementation details using reserved names, but this would add a lot of complexity.

This is one acceptable reason to backport functionality to C++03 IMO. I'd rather have it be implementation details using reserved names, but this would add a lot of complexity.

I'm not going back to C++03 here. Just C++11.

This is one acceptable reason to backport functionality to C++03 IMO. I'd rather have it be implementation details using reserved names, but this would add a lot of complexity.

I'm not going back to C++03 here. Just C++11.

Yeah, I don't know why I said that. But you get the point -- I'm talking about back porting at all, which I dislike.

ivafanas accepted this revision.Mar 20 2019, 10:16 AM
mclow.lists closed this revision.Mar 29 2019, 5:54 PM

I landed this already. Closing.