From a5398197a81a3290942644efba720a63cad4734b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Omn=C3=A8s?= Date: Thu, 6 Jun 2024 14:25:43 +0200 Subject: [PATCH] Use constexpr instead of enum to eliminate warnings (#2144) --- .../include/antares/solver/variable/constants.h | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/solver/variable/include/antares/solver/variable/constants.h b/src/solver/variable/include/antares/solver/variable/constants.h index 89f9dcf70e..cea6298346 100644 --- a/src/solver/variable/include/antares/solver/variable/constants.h +++ b/src/solver/variable/include/antares/solver/variable/constants.h @@ -27,16 +27,13 @@ namespace Solver { namespace Variable { -enum Constant -{ - maxHoursInAYear = 8785, - maxDaysInAYear = 7 * 53 + 1, // 366, - maxWeeksInAYear = 53, - maxHoursInADay = 24, - maxMonths = 12, - maxDaysInAWeek = 7, - maxHoursInAWeek = 24 * 7, // 168, -}; +constexpr unsigned int maxHoursInAYear = 8785; +constexpr unsigned int maxDaysInAYear = 7 * 53 + 1; // 366, +constexpr unsigned int maxWeeksInAYear = 53; +constexpr unsigned int maxHoursInADay = 24; +constexpr unsigned int maxMonths = 12; +constexpr unsigned int maxDaysInAWeek = 7; +constexpr unsigned int maxHoursInAWeek = 24 * 7; // 168 template struct PrecisionToPrintfFormat