diff options
author | 2024-04-11 16:33:28 -0400 | |
---|---|---|
committer | 2024-05-14 16:38:12 -0400 | |
commit | a7873cc66b57db38e688d9d4e95883683110846f (patch) | |
tree | d5cbd74b48b6c17d47db11b0eb2be689d38717df | |
parent | 08f13b72a0eb164fe87a8d6dc2f706e3dfa0768e (diff) |
FTL: Touch up Concat
- Silence warning about signedness change.
- Disable copying to prevent stray end_ pointer.
Bug: 185536303
Test: Build
Change-Id: Ief31910bd51e9582a576ace554a5f7bafe46bf02
-rw-r--r-- | include/ftl/concat.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/ftl/concat.h b/include/ftl/concat.h index e0774d39f3..7680bed5e8 100644 --- a/include/ftl/concat.h +++ b/include/ftl/concat.h @@ -57,7 +57,7 @@ struct Concat<N, T, Ts...> : Concat<N + details::StaticString<T>::N, Ts...> { template <std::size_t N> struct Concat<N> { static constexpr std::size_t max_size() { return N; } - constexpr std::size_t size() const { return end_ - buffer_; } + constexpr std::size_t size() const { return static_cast<std::size_t>(end_ - buffer_); } constexpr const char* c_str() const { return buffer_; } @@ -68,6 +68,8 @@ struct Concat<N> { protected: constexpr Concat() : end_(buffer_) {} + constexpr Concat(const Concat&) = delete; + constexpr void append() { *end_ = '\0'; } char buffer_[N + 1]; |