diff --git a/build/premake/premake5.lua b/build/premake/premake5.lua index fe27c0d5da..80722258f4 100644 --- a/build/premake/premake5.lua +++ b/build/premake/premake5.lua @@ -199,11 +199,11 @@ function project_set_build_flags() -- being used as a DLL (which is currently not the case in 0ad) defines { "LIB_STATIC_LINK" } - -- Enable C++14 standard. + -- Enable C++17 standard. filter "action:vs*" - buildoptions { "/std:c++14" } + buildoptions { "/std:c++17" } filter "action:not vs*" - buildoptions { "-std=c++14" } + buildoptions { "-std=c++17" } filter {} -- various platform-specific build flags diff --git a/libraries/osx/build-osx-libs.sh b/libraries/osx/build-osx-libs.sh index 0e10ad0cf5..da518aa572 100755 --- a/libraries/osx/build-osx-libs.sh +++ b/libraries/osx/build-osx-libs.sh @@ -86,7 +86,7 @@ if [[ $MIN_OSX_VERSION && ${MIN_OSX_VERSION-_} ]]; then fi CFLAGS="$CFLAGS $C_FLAGS -fvisibility=hidden" -CXXFLAGS="$CXXFLAGS $C_FLAGS -stdlib=libc++ -std=c++14 -msse4.1" +CXXFLAGS="$CXXFLAGS $C_FLAGS -stdlib=libc++ -std=c++17 -msse4.1" OBJCFLAGS="$OBJCFLAGS $C_FLAGS" OBJCXXFLAGS="$OBJCXXFLAGS $C_FLAGS" @@ -427,6 +427,7 @@ then --without-libtiff --without-sdl --without-x + --disable-stc --disable-webview --disable-webkit --disable-webviewwebkit diff --git a/source/tools/atlas/AtlasUI/General/Observable.cpp b/source/tools/atlas/AtlasUI/General/Observable.cpp index 8895a848fb..0aa50020fa 100644 --- a/source/tools/atlas/AtlasUI/General/Observable.cpp +++ b/source/tools/atlas/AtlasUI/General/Observable.cpp @@ -23,8 +23,8 @@ void ObservableScopedConnections::Add(const ObservableConnection& conn) { // Clean up any disconnected connections that might be left in here m_Conns.erase( - remove_if(m_Conns.begin(), m_Conns.end(), - not1(std::mem_fun_ref(&ObservableConnection::connected))), + std::remove_if(m_Conns.begin(), m_Conns.end(), + std::not_fn(std::mem_fn(&ObservableConnection::connected))), m_Conns.end() ); @@ -35,5 +35,5 @@ void ObservableScopedConnections::Add(const ObservableConnection& conn) ObservableScopedConnections::~ObservableScopedConnections() { // Disconnect all connections that we hold - for_each(m_Conns.begin(), m_Conns.end(), std::mem_fun_ref(&ObservableConnection::disconnect)); + for_each(m_Conns.begin(), m_Conns.end(), std::mem_fn(&ObservableConnection::disconnect)); } diff --git a/source/tools/atlas/AtlasUI/General/Observable.h b/source/tools/atlas/AtlasUI/General/Observable.h index a78dbdc809..7f0ae95a3d 100644 --- a/source/tools/atlas/AtlasUI/General/Observable.h +++ b/source/tools/atlas/AtlasUI/General/Observable.h @@ -39,15 +39,9 @@ variable_to_be_watched.NotifyObservers(); */ -#include -#include -#if BOOST_VERSION >= 104000 -# include +#include typedef boost::signals2::connection ObservableConnection; typedef boost::signals2::scoped_connection ObservableScopedConnection; -#else -# error Atlas requires Boost 1.40 or later -#endif template class Observable : public T { @@ -63,7 +57,7 @@ public: template ObservableConnection RegisterObserver(int order, void (C::*callback) (const T&), C* obj) { - return m_Signal.connect(order, boost::bind(std::mem_fun(callback), obj, _1)); + return m_Signal.connect(order, std::bind(std::mem_fn(callback), obj, std::placeholders::_1)); } ObservableConnection RegisterObserver(int order, void (*callback) (const T&)) @@ -135,7 +129,7 @@ public: template ObservableConnection RegisterObserver(int order, void (C::*callback) (T*), C* obj) { - return m_Signal.connect(order, boost::bind(std::mem_fun(callback), obj, _1)); + return m_Signal.connect(order, std::bind(std::mem_fn(callback), obj, std::placeholders::_1)); } ObservableConnection RegisterObserver(int order, void (*callback) (T*))