Skip to content

Commit 36c5755

Browse files
authored
Merge pull request #460 from Ethan-y-free/fix/modules-static-inline
fix: remove static from header-inline helpers for C++20 module compatibility
2 parents 76c1635 + adef7b6 commit 36c5755

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

‎concurrentqueue.h‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ namespace details
479479
};
480480
template<std::size_t size> struct hash_32_or_64 : public _hash_32_or_64<(size > 4)> { };
481481

482-
static inline size_t hash_thread_id(thread_id_t id)
482+
inline size_t hash_thread_id(thread_id_t id)
483483
{
484484
static_assert(sizeof(thread_id_t) <= 8, "Expected a platform where thread IDs are at most 64-bit values");
485485
#if defined(__GNUC__) && !defined(__clang__)
@@ -494,7 +494,7 @@ namespace details
494494
}
495495

496496
template<typename T>
497-
static inline bool circular_less_than(T a, T b)
497+
inline bool circular_less_than(T a, T b)
498498
{
499499
static_assert(std::is_integral<T>::value && !std::numeric_limits<T>::is_signed, "circular_less_than is intended to be used only with unsigned integer types");
500500
return static_cast<T>(a - b) > static_cast<T>(static_cast<T>(1) << (static_cast<T>(sizeof(T) * CHAR_BIT - 1)));
@@ -503,14 +503,14 @@ namespace details
503503
}
504504

505505
template<typename U>
506-
static inline char* align_for(char* ptr)
506+
inline char* align_for(char* ptr)
507507
{
508508
const std::size_t alignment = std::alignment_of<U>::value;
509509
return ptr + (alignment - (reinterpret_cast<std::uintptr_t>(ptr) % alignment)) % alignment;
510510
}
511511

512512
template<typename T>
513-
static inline T ceil_to_pow_2(T x)
513+
inline T ceil_to_pow_2(T x)
514514
{
515515
static_assert(std::is_integral<T>::value && !std::numeric_limits<T>::is_signed, "ceil_to_pow_2 is intended to be used only with unsigned integer types");
516516

@@ -527,15 +527,15 @@ namespace details
527527
}
528528

529529
template<typename T>
530-
static inline void swap_relaxed(std::atomic<T>& left, std::atomic<T>& right)
530+
inline void swap_relaxed(std::atomic<T>& left, std::atomic<T>& right)
531531
{
532532
T temp = left.load(std::memory_order_relaxed);
533533
left.store(right.load(std::memory_order_relaxed), std::memory_order_relaxed);
534534
right.store(temp, std::memory_order_relaxed);
535535
}
536536

537537
template<typename T>
538-
static inline T const& nomove(T const& x)
538+
inline T const& nomove(T const& x)
539539
{
540540
return x;
541541
}
@@ -562,7 +562,7 @@ namespace details
562562
};
563563

564564
template<typename It>
565-
static inline auto deref_noexcept(It& it) MOODYCAMEL_NOEXCEPT -> decltype(*it)
565+
inline auto deref_noexcept(It& it) MOODYCAMEL_NOEXCEPT -> decltype(*it)
566566
{
567567
return *it;
568568
}

0 commit comments

Comments
 (0)