[libcxx-dev] Using optional before C++17

Shoaib Meenai via libcxx-dev libcxx-dev at lists.llvm.org
Fri Mar 29 13:19:36 PDT 2019


Hi,

We have a codebase that’s built with C++14 and was using <experimental/optional> to use std::optional. This no longer works with libc++ 7 onwards, since <experimental/optional> was removed per the TS deprecation policy.

We can’t use <optional> because that’s limited to C++17 and above. We’re working on upgrading our codebase, but it’ll take time :) I’m wondering if there’s any solution available that’ll work pre-C++17. Our current plan was to overlay our own <experimental/optional> that’s a copy of the one from libc++ 6, but some sort of solution in the library itself would be ideal.

I recall there being some past discussion about this, but I can’t find it right now. Looking forward to any suggestions here.

Thanks,
Shoaib
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/libcxx-dev/attachments/20190329/9236ed1c/attachment.html>


More information about the libcxx-dev mailing list