mirror of
https://github.com/BlackMATov/meta.hpp.git
synced 2025-12-15 11:52:08 +07:00
fix new clang-tidy warnings: cppcoreguidelines-pro-bounds-pointer-arithmetic
https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/pro-bounds-pointer-arithmetic.html
This commit is contained in:
@@ -911,7 +911,9 @@ namespace meta_hpp::detail
|
|||||||
template < typename... Args >
|
template < typename... Args >
|
||||||
T& emplace_back(Args&&... args) {
|
T& emplace_back(Args&&... args) {
|
||||||
META_HPP_ASSERT(end_ < capacity_ && "full vector");
|
META_HPP_ASSERT(end_ < capacity_ && "full vector");
|
||||||
return *std::construct_at(end_++, std::forward<Args>(args)...);
|
T& result = *std::construct_at(end_, std::forward<Args>(args)...);
|
||||||
|
++end_; // NOLINT(*-pointer-arithmetic)
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] std::size_t get_size() const noexcept {
|
[[nodiscard]] std::size_t get_size() const noexcept {
|
||||||
|
|||||||
@@ -48,7 +48,9 @@ namespace meta_hpp::detail
|
|||||||
template < typename... Args >
|
template < typename... Args >
|
||||||
T& emplace_back(Args&&... args) {
|
T& emplace_back(Args&&... args) {
|
||||||
META_HPP_ASSERT(end_ < capacity_ && "full vector");
|
META_HPP_ASSERT(end_ < capacity_ && "full vector");
|
||||||
return *std::construct_at(end_++, std::forward<Args>(args)...);
|
T& result = *std::construct_at(end_, std::forward<Args>(args)...);
|
||||||
|
++end_; // NOLINT(*-pointer-arithmetic)
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] std::size_t get_size() const noexcept {
|
[[nodiscard]] std::size_t get_size() const noexcept {
|
||||||
|
|||||||
Reference in New Issue
Block a user