Skip to content

Commit

Permalink
Silence clang-tidy warning about casting through void
Browse files Browse the repository at this point in the history
  • Loading branch information
msimberg committed Nov 20, 2024
1 parent 2e9f39c commit e9a3fac
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1976,11 +1976,13 @@ namespace pika::concurrency::detail {

inline T* operator[](index_t idx) MOODYCAMEL_NOEXCEPT
{
// NOLINTNEXTLINE(bugprone-casting-through-void)
return static_cast<T*>(static_cast<void*>(elements)) +
static_cast<size_t>(idx & static_cast<index_t>(BLOCK_SIZE - 1));
}
inline T const* operator[](index_t idx) const MOODYCAMEL_NOEXCEPT
{
// NOLINTNEXTLINE(bugprone-casting-through-void)
return static_cast<T const*>(static_cast<void const*>(elements)) +
static_cast<size_t>(idx & static_cast<index_t>(BLOCK_SIZE - 1));
}
Expand Down

0 comments on commit e9a3fac

Please sign in to comment.