From the course: Introducing Functional Programming in C++

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

Enabling C++ 17

Enabling C++ 17 - C++ Tutorial

From the course: Introducing Functional Programming in C++

Start my 1-month free trial

Enabling C++ 17

- [Instructor] To get the most functional features, we're going to build our code for C++ 17. We won't always need it, but it doesn't hurt to have it available. Each of the three big compilers, Microsoft, Clang and GCC has excellent C++ 17 support. Here are the command line flags to activate it. If you use CMake to build your programs, then it's easy to add C++ 17 support, simply add the line set CMake CXX standard space 17 near the top of your CMake list dot text file. That's all it takes. Let's build an actual C++ 17 program and pay attention to the command line options this time. Let's open Visual Studio Code we're going to go file, new and we'll begin by saying pound include and this is going to be iostream. Next we'll add a space and then we're going to have a name space and our usage here is going to be a little bit silly but it will test a compiler C++ 17 feature so we're going to say A colon colon, that's the scope resolution operator, B colon colon, C. This is C++ 17's nested…

Contents