Browse Source

fix: constexpr compile errors

master
Dnomd343 1 month ago
parent
commit
6d5a52be13
  1. 2
      src/core/common_code/common_code.h
  2. 2
      src/core/common_code/internal/common_code.inl
  3. 2
      src/core/group/group.h
  4. 4
      src/core/group/internal/group_union.inl
  5. 2
      src/core/raw_code/internal/raw_code.inl
  6. 2
      src/core/raw_code/raw_code.h

2
src/core/common_code/common_code.h

@ -102,7 +102,7 @@ public:
// ------------------------------------------------------------------------------------- //
/// Get the original u64 code.
[[nodiscard]] uint64_t unwrap() const;
[[nodiscard]] constexpr uint64_t unwrap() const;
/// Convert CommonCode to RawCode.
[[nodiscard]] RawCode to_raw_code() const;

2
src/core/common_code/internal/common_code.inl

@ -41,7 +41,7 @@ inline std::ostream& operator<<(std::ostream &out, const CommonCode self) {
// ----------------------------------------------------------------------------------------- //
inline uint64_t CommonCode::unwrap() const {
constexpr uint64_t CommonCode::unwrap() const {
return code_;
}

2
src/core/group/group.h

@ -125,7 +125,7 @@ public:
static constexpr GroupUnion from_raw_code(codec::RawCode raw_code);
/// Create GroupUnion from ShortCode.
static constexpr GroupUnion from_short_code(codec::ShortCode short_code);
static GroupUnion from_short_code(codec::ShortCode short_code);
/// Create GroupUnion from CommonCode.
static constexpr GroupUnion from_common_code(codec::CommonCode common_code);

4
src/core/group/internal/group_union.inl

@ -43,7 +43,7 @@ constexpr std::optional<GroupUnion> GroupUnion::create(const uint_fast8_t type_i
#ifndef KLSK_NDEBUG
inline std::ostream& operator<<(std::ostream &out, GroupUnion self) {
out << self.type_id_;
out << static_cast<int>(self.type_id_);
return out;
}
#endif
@ -58,7 +58,7 @@ constexpr GroupUnion GroupUnion::from_raw_code(const codec::RawCode raw_code) {
return unsafe_create(type_id(raw_code));
}
constexpr GroupUnion GroupUnion::from_short_code(const codec::ShortCode short_code) {
inline GroupUnion GroupUnion::from_short_code(const codec::ShortCode short_code) {
return from_common_code(short_code.to_common_code());
}

2
src/core/raw_code/internal/raw_code.inl

@ -27,7 +27,7 @@ inline RawCode::operator uint64_t() const {
return code_;
}
inline uint64_t RawCode::unwrap() const {
constexpr uint64_t RawCode::unwrap() const {
return code_;
}

2
src/core/raw_code/raw_code.h

@ -101,7 +101,7 @@ public:
// ------------------------------------------------------------------------------------- //
/// Get the original u64 code.
[[nodiscard]] uint64_t unwrap() const;
[[nodiscard]] constexpr uint64_t unwrap() const;
/// Convert RawCode to CommonCode.
[[nodiscard]] CommonCode to_common_code() const;

Loading…
Cancel
Save