Browse Source

update: delete default constructor

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

2
src/klotski_core/common_code/common_code.h

@ -79,7 +79,6 @@ public:
class CommonCode { class CommonCode {
uint64_t code_; uint64_t code_;
CommonCode() = default; // unsafe initialize
static inline uint64_t string_decode(const std::string &common_code); static inline uint64_t string_decode(const std::string &common_code);
static inline std::string string_encode(uint64_t common_code, bool shorten) noexcept; static inline std::string string_encode(uint64_t common_code, bool shorten) noexcept;
@ -100,6 +99,7 @@ public:
constexpr uint64_t unwrap() const noexcept { return code_; } constexpr uint64_t unwrap() const noexcept { return code_; }
/// CommonCode constructors /// CommonCode constructors
CommonCode() = delete;
explicit CommonCode(uint64_t common_code); explicit CommonCode(uint64_t common_code);
explicit CommonCode(RawCode &&raw_code) noexcept; explicit CommonCode(RawCode &&raw_code) noexcept;
explicit CommonCode(ShortCode &&short_code) noexcept; explicit CommonCode(ShortCode &&short_code) noexcept;

2
src/klotski_core/raw_code/raw_code.h

@ -61,7 +61,6 @@ public:
class RawCode { class RawCode {
uint64_t code_; uint64_t code_;
RawCode() = default; // unsafe initialize
static inline uint64_t compact(uint64_t raw_code) noexcept; // raw code -> common code static inline uint64_t compact(uint64_t raw_code) noexcept; // raw code -> common code
static inline uint64_t extract(uint64_t common_code) noexcept; // common code -> raw code static inline uint64_t extract(uint64_t common_code) noexcept; // common code -> raw code
@ -86,6 +85,7 @@ public:
constexpr uint64_t unwrap() const noexcept { return code_; } constexpr uint64_t unwrap() const noexcept { return code_; }
/// RawCode constructors /// RawCode constructors
RawCode() = delete;
explicit RawCode(uint64_t raw_code); explicit RawCode(uint64_t raw_code);
explicit RawCode(CommonCode &&common_code) noexcept; explicit RawCode(CommonCode &&common_code) noexcept;
explicit RawCode(const CommonCode &common_code) noexcept; explicit RawCode(const CommonCode &common_code) noexcept;

2
src/klotski_core/short_code/short_code.h

@ -86,7 +86,6 @@ public:
private: private:
uint32_t code_; uint32_t code_;
ShortCode() = default; // unsafe initialize
static Mode mode(); static Mode mode();
static bool fast_mode_available_; static bool fast_mode_available_;
@ -118,6 +117,7 @@ public:
constexpr uint32_t unwrap() const noexcept { return code_; } constexpr uint32_t unwrap() const noexcept { return code_; }
/// ShortCode constructors /// ShortCode constructors
ShortCode() = delete;
explicit ShortCode(uint32_t short_code); explicit ShortCode(uint32_t short_code);
explicit ShortCode(std::string &&short_code); explicit ShortCode(std::string &&short_code);
explicit ShortCode(CommonCode &&common_code) noexcept; explicit ShortCode(CommonCode &&common_code) noexcept;

Loading…
Cancel
Save