-
Notifications
You must be signed in to change notification settings - Fork 48
Open
Description
optional.hpp seems to rely only on the C++ standard version in use to choose between the std::in_place facility from the standard library or its own implementation.
However, simply compiling in C++17 mode doesn't guarantee that the standard library contains these facilities. For instance, this detection technique fails on Ubuntu 16.04 when compiling with clang-5.0 (and the default libstdc++):
$ clang++-5.0 -xc++ -std=c++17 -ferror-limit=5 -c -o /dev/null - <<< '#include "optional.hpp"'
In file included from <stdin>:1:
./optional.hpp:94:12: error: no member named 'in_place' in namespace 'std'
using std::in_place;
~~~~~^
./optional.hpp:95:12: error: no member named 'in_place_type' in namespace 'std'
using std::in_place_type;
~~~~~^
./optional.hpp:96:12: error: no member named 'in_place_index' in namespace 'std'
using std::in_place_index;
~~~~~^
./optional.hpp:97:12: error: no member named 'in_place_t' in namespace 'std'
using std::in_place_t;
~~~~~^
./optional.hpp:98:12: error: no member named 'in_place_type_t' in namespace 'std'
using std::in_place_type_t;
~~~~~^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
6 errors generated.
kedestin, agauniyal, mgood7123, erikw, nikage and 3 more
Metadata
Metadata
Assignees
Labels
No labels