I’m currently experimenting with the advertised support for C++17 in 4.22 but running into a number of issues getting a build together.
I’m building from the “release” branch of the github version in VS2017. My current test is rather simple, as follows:
Create a new blank C++ project.
Add the following lines to the constructors in both Target.cs files:
BuildEnvironment = TargetBuildEnvironment.Unique;
CppStandard = CppStandardVersion.Cpp17;
- Put in some C++17-only features as dummy code, like creating an std::variant or using an if constexpr.
What I’m noticing is that the entire engine is being rebuilt against the C++17 standard, which seems to break a number of the engine libraries. Some are just warnings, like OpenExr using the since-removed “register” keyword, or multiple libraries using conditional noexcepts (which were also removed in C++17). Some are breaking changes, however. ArraySampleKey.h uses the since-removed std::binary_function and std::unary_function structs, which will no longer compile under C++17.
The 4.22 announcement is pretty light on details on how to use C++17 beyond adding the CppStandard line I included above to your project. Is there more to it that I’m missing? Has someone out there successfully gotten a full source build running on a project that uses C++17 code and features?
Any help would be appreciated. Thanks!