Use CONSTDATA in function parse making compiler without constexpr support happy

This commit is contained in:
Alexandre Dupas 2017-01-07 18:50:57 +01:00 committed by Howard Hinnant
parent c6f3dd2832
commit 41093d05d8

12
date.h
View File

@ -5165,25 +5165,25 @@ parse(std::basic_istream<CharT, Traits>& is,
const CharT* command = nullptr;
auto modified = CharT{};
auto width = -1;
constexpr int not_a_year = 33000;
CONSTDATA int not_a_year = 33000;
int Y = not_a_year;
constexpr int not_a_century = not_a_year / 100;
CONSTDATA int not_a_century = not_a_year / 100;
int C = not_a_century;
constexpr int not_a_2digit_year = 100;
CONSTDATA int not_a_2digit_year = 100;
int y = not_a_2digit_year;
int m{};
int d{};
int j{};
constexpr int not_a_weekday = 7;
CONSTDATA int not_a_weekday = 7;
int wd = not_a_weekday;
constexpr int not_a_hour_12_value = 0;
CONSTDATA int not_a_hour_12_value = 0;
int I = not_a_hour_12_value;
hours h{};
minutes min{};
Duration s{};
int g = not_a_2digit_year;
int G = not_a_year;
constexpr int not_a_week_num = 100;
CONSTDATA int not_a_week_num = 100;
int V = not_a_week_num;
int U = not_a_week_num;
int W = not_a_week_num;