From 9f92916d1debbad1a72402e744ba15c5c51ebe09 Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Mon, 13 Jan 2020 11:24:48 +0900 Subject: [PATCH] fix: suppress -Wuseless-conversion `{integer} + 1` will automatically be an int, so static_cast(a+1) will be useless conversion. --- toml/datetime.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/toml/datetime.hpp b/toml/datetime.hpp index 01b513c..0d56e76 100644 --- a/toml/datetime.hpp +++ b/toml/datetime.hpp @@ -172,9 +172,9 @@ template std::basic_ostream& operator<<(std::basic_ostream& os, const local_date& date) { - os << std::setfill('0') << std::setw(4) << static_cast(date.year ) << '-'; - os << std::setfill('0') << std::setw(2) << static_cast(date.month + 1) << '-'; - os << std::setfill('0') << std::setw(2) << static_cast(date.day ); + os << std::setfill('0') << std::setw(4) << static_cast(date.year ) << '-'; + os << std::setfill('0') << std::setw(2) << static_cast(date.month) + 1 << '-'; + os << std::setfill('0') << std::setw(2) << static_cast(date.day ) ; return os; }