Skip to content

Commit

Permalink
fixed_string: fix operator!= && fix compile error on clang 12 trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
PragmaTwice committed Jan 16, 2021
1 parent 546f9d2 commit aff6145
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions include/protopuf/fixed_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ namespace pp {
return true;
}

template <typename CharT, std::size_t N, std::size_t M>
constexpr auto operator!=(const basic_fixed_string<CharT, N> &l, const basic_fixed_string<CharT, M> &r) {
return !(l == r);
}

template <typename CharT, std::size_t N, std::size_t M>
constexpr auto operator<=>(const basic_fixed_string<CharT, N> &l, const basic_fixed_string<CharT, M> &r) {
for (std::size_t i = 0; i < std::min(N, M); ++i) {
Expand Down Expand Up @@ -103,7 +108,7 @@ namespace pp {

template <std::size_t N>
constexpr decltype(auto) get() const {
return constant<value<N>>{};
return constant<constant_get<N, v...>>{};
}
};

Expand All @@ -120,7 +125,7 @@ namespace pp {

template <std::size_t N>
constexpr decltype(auto) get() const {
return constant<value<N>>{};
return constant<constant_get<N, v...>>{};
}
};

Expand Down

0 comments on commit aff6145

Please sign in to comment.