diff --git a/BUILDING.md b/BUILDING.md index 40d50e52..e4d27052 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -5,7 +5,7 @@ please consult http://www.qt.io and for SQLite please see https://sqlite.org/. Please note that all versions after 3.9.1 will require: * Qt 5.5 or later, however we advise you to use 5.7 or later -* A C++ compiler with support for C++11 or later +* A C++ compiler with support for C++14 or later Without these or with older versions you won't be able to compile DB Browser for Sqlite anymore. This applies to all platforms. However, most likely you won't diff --git a/CMakeLists.txt b/CMakeLists.txt index a4ea0251..4061a35d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,8 +24,8 @@ if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "Release") endif() -add_definitions(-std=c++11) -set(CMAKE_CXX_STANDARD 11) +add_definitions(-std=c++14) +set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED True) # Fix behavior of CMAKE_CXX_STANDARD when targeting macOS. diff --git a/src/sql/sqlitetypes.h b/src/sql/sqlitetypes.h index c7a7d97e..355047de 100644 --- a/src/sql/sqlitetypes.h +++ b/src/sql/sqlitetypes.h @@ -27,16 +27,9 @@ bool compare_ci(const T& a, const T& b) { // Note: This function does not have to be (actually it must not be) fully UTF-8 aware because SQLite itself is not either. - if(a.length() != b.length()) - return false; - return std::equal(a.begin(), a.end(), b.begin(), [](unsigned char c1, unsigned char c2) { + return std::equal(a.begin(), a.end(), b.begin(), b.end(), [](unsigned char c1, unsigned char c2) { return std::tolower(c1) == std::tolower(c2); }); - - // TODO Replace the entire code above by the following once we have enabled C++14 support - /*return std::equal(a.begin(), a.end(), b.begin(), b.end(), [](unsigned char c1, unsigned char c2) { - return std::tolower(c1) == std::tolower(c2); - });*/ } template diff --git a/src/src.pro b/src/src.pro index 2eac0ae0..6dd0f752 100644 --- a/src/src.pro +++ b/src/src.pro @@ -8,7 +8,7 @@ CONFIG += debug_and_release CONFIG += qt CONFIG += warn_on -QMAKE_CXXFLAGS += -std=c++11 +QMAKE_CXXFLAGS += -std=c++14 # create a unittest option CONFIG(unittest) {