QCalendar: Make SystemId constructors with one argument explicit
This avoids unwanted type conversions. Pick-to: 6.2 Change-Id: Ie57e80da615c6bc162224fa3816fc21a47ab4b00 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>bb10
parent
0235c02178
commit
4679209120
|
|
@ -135,8 +135,9 @@ public:
|
|||
const size_t id;
|
||||
friend class QCalendarBackend;
|
||||
constexpr bool isInEnum() const { return id <= size_t(QCalendar::System::Last); }
|
||||
constexpr SystemId(QCalendar::System e) : id(size_t(e)) {}
|
||||
constexpr SystemId(size_t i) : id(i) {}
|
||||
constexpr explicit SystemId(QCalendar::System e) : id(size_t(e)) { }
|
||||
constexpr explicit SystemId(size_t i) : id(i) { }
|
||||
|
||||
public:
|
||||
constexpr SystemId() : id(~size_t(0)) {}
|
||||
constexpr size_t index() const noexcept { return id; }
|
||||
|
|
|
|||
Loading…
Reference in New Issue