From f3ee822cc6ea7edc5b87eeb57aad73c8a6c0bfdb Mon Sep 17 00:00:00 2001 From: Martchus Date: Fri, 11 Sep 2015 22:01:26 +0200 Subject: [PATCH] make constructor explicit --- chrono/datetime.h | 8 ++++---- chrono/timespan.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/chrono/datetime.h b/chrono/datetime.h index a6a89bc..f124db9 100644 --- a/chrono/datetime.h +++ b/chrono/datetime.h @@ -56,8 +56,8 @@ enum class DatePart class LIB_EXPORT DateTime { public: - constexpr DateTime(); - constexpr DateTime(uint64 ticks); + explicit constexpr DateTime(); + explicit constexpr DateTime(uint64 ticks); static DateTime fromDate(int year = 1, int month = 1, int day = 1); static DateTime fromTime(int hour = 0, int minute = 0, int second = 0, double millisecond = 0.0); static DateTime fromDateAndTime(int year = 1, int month = 1, int day = 1, int hour = 0, int minute = 0, int second = 0, double millisecond = 0.0); @@ -160,7 +160,7 @@ inline DateTime DateTime::fromDateAndTime(int year, int month, int day, int hour } /*! - * Gets the number of ticks that represent the value of the current DateTime class. + * Gets the number of ticks which represent the value of the current instance. */ constexpr inline uint64 DateTime::totalTicks() const { @@ -168,7 +168,7 @@ constexpr inline uint64 DateTime::totalTicks() const } /*! - *Gets the year component of the date represented by this instance. + * Gets the year component of the date represented by this instance. */ inline int DateTime::year() const { diff --git a/chrono/timespan.h b/chrono/timespan.h index ea715e2..cd68a4f 100644 --- a/chrono/timespan.h +++ b/chrono/timespan.h @@ -28,8 +28,8 @@ class LIB_EXPORT TimeSpan { friend class DateTime; public: - constexpr TimeSpan(); - constexpr TimeSpan(int64 ticks); + explicit constexpr TimeSpan(); + explicit constexpr TimeSpan(int64 ticks); static constexpr TimeSpan fromMilliseconds(double milliseconds); static constexpr TimeSpan fromSeconds(double seconds);