I want to use the C++17 std::optional
but it seems to be absent in clang:
> cat test.cxx
#include <optional>
int main(int, char **) {
return 0;
}
> $CXX --version | head -n1
clang version 6.0.0 (trunk 317775)
> $CXX -std=c++17 test.cxx
test.cxx:1:10: fatal error: 'optional' file not found
#include <optional>
^~~~~~~~~~
1 error generated.
As you can see I am using a rather new version of clang and, as far as I know, clang 6 should have complete C++17 support. On first glance it looks like this is an clang issue, especially because including <experimental/optional>
works fine, but maybe it is me who is missing something. Do you have any ideas?
Thanks