************************************************************************************** Status of C++17 features relevant to EECS 381 Projects in MSVS, Xcode, and g++ 9.1.0 Last updated: 8/15/19 ************************************************************************************** The web has many "feature charts" of C++11/14/17 implementation status of various compilers & libraries, but these are often out of date and lacking in detail. This document describes the status of things relevant to the course projects. Let me know if you discover anything relevant to this document to help me keep it up to date. g++ using gcc 9.1.0 with -std=c++17 is the "standard" environment for the course; it is available both on CAEN and is what the autograder uses. Unless specifically stated otherwise, everything presented, recommended, or required in the course compiles and runs correctly in gcc/g++ 9.1.0. But some noteworthy things that work are pointed out. Problems are prefixed with ---, noteworthy things that work with +++ If the document says something doesn't work, it means it won't compile - a fatal error results. ======== Later versions of MSVS ============ This needs to be updated - those of you using recent versions of MSVS, please let me know what you experience. ---------- Using Both MSVS and g++ ----------------- Use conditional compilation with the preprocessor to have your code automatically adapt to the platform by detecting the presence of a preprocessor variable defined only in the MSVS implementation. For example, to use the same code file in both MSVS and g++, put in the following #if statements: #ifdef _MSC_VER put in here code you only want to use in MSVS #endif or #ifndef _MSC_VER put in here code you only want to use in non-MSVS environment, like CAEN g++ or Xcode #endif or #ifdef _MSC_VER put in here code you only want to use in MSVS #elseif put in here code you only want to use in non-MSVS environment, like CAEN g++ or Xcode #endif ======== XCode 10x, LLVM compiler 6 or later, C++17, and libc++ ======== +++ The current release of the LLVM is supposed to be c++17 feature complete. So you can assume that everything works like it should unless we learn otherwise. --- While the LLVM compiler is supposed to mimic gcc in terms of its options, the special option used in Project 2, -fno-elide-constructors, was not working correctly in the earlier versions of Xcode, and may not still. However, even if it is now working, the effect of the option is not guaranteed to match in all details what gcc would do, so you should use CAEN g++ 9.1.0 to test the String monitoring behavior of your program for a match to the samples.