Switch to C++17

This commit is contained in:
Matthias Hochsteger 2019-07-10 12:57:19 +02:00
parent b848bdc237
commit c3a7fc2aab
2 changed files with 3 additions and 8 deletions

View File

@ -6,7 +6,7 @@ if(WIN32)
# we are linking to object libraries on Windows
cmake_minimum_required(VERSION 3.12)
else(WIN32)
cmake_minimum_required(VERSION 3.1.3)
cmake_minimum_required(VERSION 3.8)
endif(WIN32)
if(NOT WIN32)
@ -216,7 +216,7 @@ macro(get_dll_from_lib dll_path lib_path)
get_filename_component(lib_name ${lib} name)
endmacro()
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
if(WIN32)
get_WIN32_WINNT(ver)
add_definitions(-D_WIN32_WINNT=${ver} -DWNT -DWNT_WINDOW -DNOMINMAX)

View File

@ -429,16 +429,11 @@ namespace netgen
T * p = new T[nsize];
size_t mins = (nsize < size) ? nsize : size;
// memcpy (p, data, mins * sizeof(T));
#if defined(__GNUG__) && __GNUC__ < 5 && !defined(__clang__)
for (size_t i = 0; i < mins; i++) p[i] = move(data[i]);
#else
if (std::is_trivially_copyable<T>::value)
if constexpr(std::is_trivially_copyable<T>::value)
memcpy (p, data, sizeof(T)*mins);
else
for (size_t i = 0; i < mins; i++) p[i] = move(data[i]);
#endif
if (ownmem)
delete [] data;