fix a bunch of clang-tidy warnings

fixed a couple actual real bugs (missing returns 
in operator=, wrong implicit bool conversion).

mostly added a bunch of explicit ctor.
This commit is contained in:
Mathias Agopian
2018-08-10 20:11:37 -07:00
committed by Mathias Agopian
parent 9ac432d530
commit a4851ed835
33 changed files with 81 additions and 75 deletions

View File

@@ -81,7 +81,7 @@ public:
using StringLiteral = const char[N];
template <size_t N>
StaticString(StringLiteral<N> const& other) noexcept
StaticString(StringLiteral<N> const& other) noexcept // NOLINT(google-explicit-constructor)
: mString(other),
mLength(size_type(N - 1)) {
}
@@ -91,14 +91,13 @@ public:
mLength(size_type(length)) {
}
template<size_t N>
StaticString& operator=(StringLiteral<N> const& other) noexcept {
mString = other;
mLength = size_type(N - 1);
return *this;
}
const_pointer c_str() const noexcept { return mString; }
const_pointer data() const noexcept { return mString; }
size_type size() const noexcept { return mLength; }