From fa6cdb493165da26d8e6e282a32902db7e4bfe57 Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Sat, 29 Apr 2023 23:31:22 +0800 Subject: [PATCH] update: delete default constructor --- src/klotski_core/common_code/common_code.h | 2 +- src/klotski_core/raw_code/raw_code.h | 2 +- src/klotski_core/short_code/short_code.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/klotski_core/common_code/common_code.h b/src/klotski_core/common_code/common_code.h index 68c048d..e1b5201 100644 --- a/src/klotski_core/common_code/common_code.h +++ b/src/klotski_core/common_code/common_code.h @@ -79,7 +79,6 @@ public: class CommonCode { uint64_t code_; - CommonCode() = default; // unsafe initialize static inline uint64_t string_decode(const std::string &common_code); 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_; } /// CommonCode constructors + CommonCode() = delete; explicit CommonCode(uint64_t common_code); explicit CommonCode(RawCode &&raw_code) noexcept; explicit CommonCode(ShortCode &&short_code) noexcept; diff --git a/src/klotski_core/raw_code/raw_code.h b/src/klotski_core/raw_code/raw_code.h index 9b553ee..1b6473f 100644 --- a/src/klotski_core/raw_code/raw_code.h +++ b/src/klotski_core/raw_code/raw_code.h @@ -61,7 +61,6 @@ public: class RawCode { 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 extract(uint64_t common_code) noexcept; // common code -> raw code @@ -86,6 +85,7 @@ public: constexpr uint64_t unwrap() const noexcept { return code_; } /// RawCode constructors + RawCode() = delete; explicit RawCode(uint64_t raw_code); explicit RawCode(CommonCode &&common_code) noexcept; explicit RawCode(const CommonCode &common_code) noexcept; diff --git a/src/klotski_core/short_code/short_code.h b/src/klotski_core/short_code/short_code.h index c72eb62..a5ab30e 100644 --- a/src/klotski_core/short_code/short_code.h +++ b/src/klotski_core/short_code/short_code.h @@ -86,7 +86,6 @@ public: private: uint32_t code_; - ShortCode() = default; // unsafe initialize static Mode mode(); static bool fast_mode_available_; @@ -118,6 +117,7 @@ public: constexpr uint32_t unwrap() const noexcept { return code_; } /// ShortCode constructors + ShortCode() = delete; explicit ShortCode(uint32_t short_code); explicit ShortCode(std::string &&short_code); explicit ShortCode(CommonCode &&common_code) noexcept;