Skip to content

Commit fecddc1

Browse files
committed
Update small_vector.hpp
1 parent 582d2e1 commit fecddc1

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/utility/small_vector.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -305,15 +305,15 @@ namespace gapp::detail
305305
constexpr small_vector_buffer() noexcept {}; // NOLINT(*default)
306306
constexpr ~small_vector_buffer() noexcept {}; // NOLINT(*default)
307307

308-
constexpr auto begin() noexcept { return static_cast<T*>(data_); }
309-
constexpr auto begin() const noexcept { return static_cast<T*>(data_); }
308+
constexpr auto begin() noexcept { return std::begin(data_); }
309+
constexpr auto begin() const noexcept { return std::begin(data_); }
310310

311-
constexpr auto end() noexcept { return static_cast<T*>(data_) + Size; }
312-
constexpr auto end() const noexcept { return static_cast<T*>(data_) + Size; }
311+
constexpr auto end() noexcept { return std::end(data_); }
312+
constexpr auto end() const noexcept { return std::end(data_); }
313313

314-
constexpr std::size_t size() const noexcept { return Size; }
314+
constexpr std::size_t size() const noexcept { return std::size(data_); }
315315
private:
316-
union { mutable T data_[Size]; };
316+
union { char dummy_ = {}; T data_[Size]; }; // NOLINT(*arrays)
317317
};
318318

319319

0 commit comments

Comments
 (0)