How do I get the C++ 17 Headers

Hi,

I really like the new additions of C++17, but in MinGW -std=c++1z doesn't give me an error, but whenever I try to include a new header it says, the file couldn't be found. So where can I get them and where should I place them?

My MinGW/G++ version is

g++.exe (i686-posix-dwarf, Built by MinGW-W64 project) 6.1.0

Thanks,
Kim
Those that are available are experimental, but if you want to use them. The ones that you can use already came with your compiler. You just need to add the right command line argument to your compiler to use them.

Look at: https://gcc.gnu.org/projects/cxx-status.html#cxx1z
So what should I do, when I want to use std::optional? Shouldn't -std=c++1z be enough?
With 5.3 I get the same: fatal error: optional: No such file or directory
#include <optional> does not exist.
P.S : Why are you eager for C++17 features already?
Last edited on
A find for name "optional" in folder "/usr/include" of a GCC 5.2.1 installation finds a file named "optional" in a subfolder "experimental".

Therefore, I could probably write #include <experimental/optional>
keskiverto Thank you so much. Could have probably found that out myself...
Nooo! error: 'optional' is not a member of 'std'
std::optional<unsigned int> value; from std::optional<unsigned int> value;
Ah! std::experimental::optional<unsigned int> value;
Topic archived. No new replies allowed.