From 9e69b80b10b13999271787cfe56424d7fe3db98b Mon Sep 17 00:00:00 2001 From: otakuto Date: Thu, 26 Jan 2017 06:41:23 +0900 Subject: [PATCH] support c++11 --- CMakeLists.txt | 4 ++-- main.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 658b2a1..cba6972 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ -cmake_minimum_required(VERSION 3.0.0) +cmake_minimum_required(VERSION 2.8.0) project(CrazyDiskInfo CXX) add_executable(CrazyDiskInfo main.cpp) -set(CMAKE_CXX_FLAGS "-Wall -std=c++14") +set(CMAKE_CXX_FLAGS "-Wall -std=c++11") SET_TARGET_PROPERTIES(CrazyDiskInfo PROPERTIES OUTPUT_NAME crazy) target_link_libraries(CrazyDiskInfo atasmart) target_link_libraries(CrazyDiskInfo ncursesw) diff --git a/main.cpp b/main.cpp index 59e2358..118cdde 100644 --- a/main.cpp +++ b/main.cpp @@ -161,7 +161,7 @@ Health attributeToHealth(Attribute const & attribute) Health smartToHealth(SMART const & smart) { - return attributeToHealth(*std::max_element(smart.attribute.cbegin(), smart.attribute.cend(), [](auto lhs, auto rhs) + return attributeToHealth(*std::max_element(smart.attribute.cbegin(), smart.attribute.cend(), [](Attribute const & lhs, Attribute const & rhs) { return static_cast(attributeToHealth(lhs)) < static_cast(attributeToHealth(rhs)); })); @@ -426,7 +426,7 @@ int main() } } } - std::sort(smartList.begin(), smartList.end(), [](auto lhs, auto rhs){return lhs.deviceName < rhs.deviceName;}); + std::sort(smartList.begin(), smartList.end(), [](SMART const & lhs, SMART const & rhs){return lhs.deviceName < rhs.deviceName;}); if (smartList.size() == 0) {