-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Use vendored version of <experimental/optional> #13049
Conversation
37314c1
to
62c0d62
Compare
/cc @mollymerp: it looks like there's a crash in the pattern implementation: the mapbox-gl-native/src/mbgl/renderer/layers/render_line_layer.cpp Lines 159 to 160 in d21c126
|
} | ||
|
||
constexpr T const& value() const& { | ||
return initialized() ? contained_val() : (throw bad_optional_access("bad optional access"), contained_val()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the GNU implementation it's calling
// XXX Does not belong here.
inline void
__throw_bad_optional_access(const char* __s)
{ _GLIBCXX_THROW_OR_ABORT(bad_optional_access(__s)); }
that optionally aborts instead of throwing, can we also keep this in the vendored implementation ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pozdnyakov do you know of a (non-STL-specific) version that does this? I've checked both https://github.com/martinmoene/optional-lite and https://github.com/akrzemi1/Optional, and they both don't have accommodations for disabling exceptions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried https://github.com/martinmoene/optional-lite in https://github.com/mapbox/mapbox-gl-native/compare/optional2, and it's significantly smaller for Android, but larger for iOS.
https://github.com/TartanLlama/optional doesn't have a nothrow version either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would Chromium-based version fit us?
https://chromium.googlesource.com/chromium/src/+/lkgr/base/optional.h
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kkaefer when do you anticipate this landing? Asking since this fix will be needed to upgrade to clang++ 7 on OS X too (mapbox/vtshaver#21), which now includes the latest libc++ that drops |
is there an eta for landing this PR? This would help moving forward to upgrade NDK to 18 in #12972 |
725deae
to
54b562a
Compare
<experimental/optional> is not available anymore in newer STL versions, e.g. according to libc++'s TS deprecation policy: https://libcxx.llvm.org/TS_deprecation.html
<experimental/optional>
is not available anymore in newer versions of libc++, according to libc++'s TS deprecation policy: https://libcxx.llvm.org/TS_deprecation.html. This unblocks support for the Android NDK 18: #12972 (comment)