Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9256ba68 authored by Atneya Nair's avatar Atneya Nair
Browse files

FixedString fix operator== conversion ambiguities

Test: atest fixedstring_tests
Bug: 311679534
Change-Id: I2ae00bb5f0de43e487065a95306b415dd8ed5d39
parent bd55f8b8
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -101,10 +101,15 @@ struct FixedString
        return strncmp(c_str(), s, capacity() + 1) == 0;
    }

    bool operator==(std::string_view s) const {
    bool operator==(const std::string_view s) const {
        return size() == s.size() && memcmp(data(), s.data(), size()) == 0;
    }

    template <uint32_t N_>
    bool operator==(const FixedString<N_>& s) const {
        return operator==(s.asStringView());
    }

    // operator not-equals
    template <typename T>
    bool operator!=(const T& other) const {