Browse Source

fix: `explicit` limit for class convert

legacy
Dnomd343 2 years ago
parent
commit
a8b2d7a57e
  1. 2
      src/klotski/common_code/common_code.h
  2. 2
      src/klotski/raw_code/raw_code.h
  3. 2
      src/klotski/short_code/short_code.h

2
src/klotski/common_code/common_code.h

@ -68,8 +68,8 @@ namespace klotski {
static bool check(uint64_t common_code); static bool check(uint64_t common_code);
/// Operators of CommonCode /// Operators of CommonCode
constexpr operator uint64_t() const { return code; }
bool operator==(const CommonCode &common_code) const; bool operator==(const CommonCode &common_code) const;
constexpr explicit operator uint64_t() const { return code; }
friend std::ostream& operator<<(std::ostream &out, const CommonCode &self); friend std::ostream& operator<<(std::ostream &out, const CommonCode &self);
/// Export functions /// Export functions

2
src/klotski/raw_code/raw_code.h

@ -50,7 +50,7 @@ namespace klotski {
/// Operators of RawCode /// Operators of RawCode
bool operator==(const RawCode &raw_code) const; bool operator==(const RawCode &raw_code) const;
constexpr operator uint64_t() const { return code; } constexpr explicit operator uint64_t() const { return code; }
friend std::ostream& operator<<(std::ostream &out, const RawCode &self); friend std::ostream& operator<<(std::ostream &out, const RawCode &self);
/// Export functions /// Export functions

2
src/klotski/short_code/short_code.h

@ -40,8 +40,8 @@ namespace klotski {
static bool check(uint32_t short_code); static bool check(uint32_t short_code);
/// Operators of ShortCode /// Operators of ShortCode
constexpr operator uint32_t() const { return code; }
bool operator==(const ShortCode &short_code) const; bool operator==(const ShortCode &short_code) const;
constexpr explicit operator uint32_t() const { return code; }
friend std::ostream& operator<<(std::ostream &out, const ShortCode &self); friend std::ostream& operator<<(std::ostream &out, const ShortCode &self);
/// Export functions /// Export functions

Loading…
Cancel
Save