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 21, 2024
1 parent 0b5128c commit 25fb91f
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 25fb91f

Please sign in to comment.