diff --git a/include/date/date.h b/include/date/date.h index b152ca1..8e1be13 100644 --- a/include/date/date.h +++ b/include/date/date.h @@ -4493,8 +4493,7 @@ inline std::pair weekday_names() { - using namespace std; - static const string nm[] = + static const std::string nm[] = { "Sunday", "Monday", @@ -4511,15 +4510,14 @@ weekday_names() "Fri", "Sat" }; - return make_pair(nm, nm+sizeof(nm)/sizeof(nm[0])); + return std::make_pair(nm, nm+sizeof(nm)/sizeof(nm[0])); } inline std::pair month_names() { - using namespace std; - static const string nm[] = + static const std::string nm[] = { "January", "February", @@ -4546,20 +4544,19 @@ month_names() "Nov", "Dec" }; - return make_pair(nm, nm+sizeof(nm)/sizeof(nm[0])); + return std::make_pair(nm, nm+sizeof(nm)/sizeof(nm[0])); } inline std::pair ampm_names() { - using namespace std; - static const string nm[] = + static const std::string nm[] = { "AM", "PM" }; - return make_pair(nm, nm+sizeof(nm)/sizeof(nm[0])); + return std::make_pair(nm, nm+sizeof(nm)/sizeof(nm[0])); } template diff --git a/include/date/tz.h b/include/date/tz.h index 71c37e6..49e4320 100644 --- a/include/date/tz.h +++ b/include/date/tz.h @@ -1963,10 +1963,9 @@ std::basic_ostream& to_stream(std::basic_ostream& os, const CharT* fmt, const utc_time& t) { - using namespace std; using namespace std::chrono; - using CT = typename common_type::type; - const string abbrev("UTC"); + using CT = typename std::common_type::type; + const std::string abbrev("UTC"); CONSTDATA seconds offset{0}; auto ls = is_leap_second(t); auto tp = sys_time{t.time_since_epoch() - ls.second}; @@ -1992,16 +1991,15 @@ from_stream(std::basic_istream& is, const CharT* fmt, utc_time& tp, std::basic_string* abbrev = nullptr, std::chrono::minutes* offset = nullptr) { - using namespace std; using namespace std::chrono; - using CT = typename common_type::type; + using CT = typename std::common_type::type; minutes offset_local{}; auto offptr = offset ? offset : &offset_local; fields fds{}; fds.has_tod = true; from_stream(is, fmt, fds, abbrev, offptr); if (!fds.ymd.ok()) - is.setstate(ios::failbit); + is.setstate(std::ios::failbit); if (!is.fail()) { bool is_60_sec = fds.tod.seconds() == seconds{60}; @@ -2012,7 +2010,7 @@ from_stream(std::basic_istream& is, const CharT* fmt, tmp += seconds{1}; if (is_60_sec != is_leap_second(tmp).first || !fds.tod.in_conventional_range()) { - is.setstate(ios::failbit); + is.setstate(std::ios::failbit); return is; } tp = time_point_cast(tmp);