Compile LMMS using C++17

This replaces `set(CMAKE_CXX_STANDARD 14)` by `set(CMAKE_CXX_STANDARD 17)`
wherever it is required.

Additionally:

* raise `CMAKE_MINIMUM_REQUIRED(VERSION ...)` to `3.8` (the minimum
  that supports C++17)
* `stdshims.h` is now unused and thus removed
This commit is contained in:
Johannes Lorenz
2021-08-22 18:06:20 +02:00
committed by Johannes Lorenz
parent fd18305fba
commit 8a9a2fae62
9 changed files with 11 additions and 44 deletions

View File

@@ -1,30 +0,0 @@
//! Shims for std:: functions that aren't available in the current C++ versions
//! we target.
#ifndef STDSHIMS_H
#define STDSHIMS_H
#include <type_traits>
#include <utility>
#if (__cplusplus >= 201703L || _MSC_VER >= 1914)
#ifndef _MSC_VER
#warning "This part of this file should now be removed! The functions it provides are part of the C++17 standard."
#endif
using std::as_const;
#else
/// Shim for http://en.cppreference.com/w/cpp/utility/as_const
template <typename T>
constexpr typename std::add_const<T>::type& as_const(T& t) noexcept
{
return t;
}
template <typename T>
void as_const(const T&&) = delete;
#endif
#endif // include guard