Compiling with C++17 in VS2017

#1

I can build Cinder 0.9.1 (and projects using it) with VS2017 and the v141 toolset. However, there is a further issue… Has anyone tried to use VS2017 in C++17 mode (using the /std:c++17 or /std:c++latest flags)? In C++17, some standard library features have been removed (not just deprecated!), and so Cinder’s existing Boost (1.60) version won’t work. For example, Boost uses std::binary_function in boost/utility/compare_pointees.hpp, and this template was removed in C++17. (Same goes for std::unary_function). I notice that even in the latest version of Cinder on GitHub, Boost 1.60 is still in use. Are there plans to update Cinder to a more recent version of Boost?

Thanks,
Glen.

#2

I think the move is towards not shipping with boost at all for newer compiler toolsets, and only keep boost headers / binaries for the toolsets that we still need to support and don’t yet have <filesystem> or <system>. We’ve been working to reduce our dependencies and we’re just about there, ci::JsonTree being pretty much the only thing left (btw, I just opened an issue about its future removal).

I think if you wanted to go and update the boost submodule to latest on your end you could without issues, you wouldn’t need to link to boost libraries on windows with toolset v140 or higher siice they aren’t used.

#3

Thanks, I’ll give that a try. The issue is I’m also using some other Boost functionality in my own apps (including some compiled libraries). It might work, though – the good thing is that some of my own Boost dependencies can be replaced by std functionality in C++17 (e.g. boost::optional and variant can be replaced by std::optional and variant).

I think I tried on an earlier occasion (a year or more ago) to swap in a newer version of Boost and ran into a mess of problems, but I’ll give it another try if you think there are in fact few Cinder dependencies on it (BTW is your statement true even in 0.9.1, or just current?).

Thanks!