The C++ reference website * https://en.cppreference.com/w/cpp/experimental/optional * https://en.cppreference.com/w/cpp/utility/optional says that 1. std::experimental::optional is defined in the header <experimental/optional> before c++17 2, std::optional is defined in the header <optional> since c++17. The experimental/optional header is missing in 12.2-STABLE r365688 and > #include <experimental/optional> > > typedef std::experimental::optional<int> x; fails to compile with -std=c++14, or any other flags. This causes the port graphics/py-open3d-python r507372 failure: http://beefy6.nyi.freebsd.org/data/121amd64-default/548931/logs/errors/py37-open3d-python-0.2_4.log
The experimental headers are named "experimental", because they can change, or be removed, at *any* time, and developers are not allowed to rely on them explicitly. Upstream only provides these temporarily as a way to experiment with new features before they are finalized, but software should never be shipped if it has a hard dependency on them.
(In reply to Dimitry Andric from comment #1) I was under the impression that 'experimental' headers are equally defined in the C++ standard, and on https://en.cppreference.com/, with the difference that they are renamed, removed, or redesigned in later standard revisions. This is why they are documented on https://en.cppreference.com/ like any permanent C++ feature. And you are saying that 'experimental' are optional altogether and can be missing entirely. Yuri