Browse Source

feat: allow direct conversion without `unwrap`

master
Dnomd343 2 years ago
parent
commit
9804a26cb4
  1. 1
      src/common_code/common_code.h
  2. 4
      src/main.cc
  3. 1
      src/raw_code/raw_code.h
  4. 1
      src/short_code/short_code.h

1
src/common_code/common_code.h

@ -12,6 +12,7 @@ class ShortCode;
class CommonCode {
public:
static bool check(uint64_t common_code);
explicit operator uint64_t() const { return code; }
friend std::ostream& operator<<(std::ostream &out, const CommonCode &self);
/// Export functions

4
src/main.cc

@ -15,7 +15,7 @@
int main() {
BasicRanges::build();
// BasicRanges::build();
// std::cout << "wait 3s" << std::endl;
// sleep(3);
@ -26,7 +26,7 @@ int main() {
// AllCases::build();
auto f = FastCal();
auto ret = f.solve(RawCode::from_common_code("1a9bf0c").unwrap());
auto ret = f.solve((uint64_t)RawCode::from_common_code("1a9bf0c"));
// auto f = FastCal(RawCode::from_common_code("1a9bf0c").unwrap());
// auto ret = f.solve();

1
src/raw_code/raw_code.h

@ -10,6 +10,7 @@ class CommonCode;
class RawCode {
public:
static bool check(uint64_t raw_code);
explicit operator uint64_t() const { return code; }
friend std::ostream& operator<<(std::ostream &out, const RawCode &self);
/// Export functions

1
src/short_code/short_code.h

@ -15,6 +15,7 @@ public:
static void speed_up(enum Mode mode);
static bool check(uint32_t short_code);
explicit operator uint32_t() const { return code; }
friend std::ostream& operator<<(std::ostream &out, const ShortCode &self);
/// Export functions

Loading…
Cancel
Save