1
0
Fork 0
mirror of https://github.com/otakuto/crazydiskinfo.git synced 2025-07-23 06:35:49 +00:00

support c++11

This commit is contained in:
otakuto 2017-01-26 06:41:23 +09:00
parent d39417c165
commit 9e69b80b10
2 changed files with 4 additions and 4 deletions

View file

@ -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)

View file

@ -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<int>(attributeToHealth(lhs)) < static_cast<int>(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)
{