File tree 3 files changed +4
-4
lines changed
3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -544,7 +544,7 @@ class BlockingConcurrentQueue
544
544
// Returns true if the underlying atomic variables used by
545
545
// the queue are lock-free (they should be on most platforms).
546
546
// Thread-safe.
547
- static bool is_lock_free ()
547
+ static constexpr bool is_lock_free ()
548
548
{
549
549
return ConcurrentQueue::is_lock_free ();
550
550
}
Original file line number Diff line number Diff line change @@ -1314,7 +1314,7 @@ class ConcurrentQueue
1314
1314
// Returns true if the underlying atomic variables used by
1315
1315
// the queue are lock-free (they should be on most platforms).
1316
1316
// Thread-safe.
1317
- static bool is_lock_free ()
1317
+ static constexpr bool is_lock_free ()
1318
1318
{
1319
1319
return
1320
1320
details::static_is_lock_free<bool >::value == 2 &&
Original file line number Diff line number Diff line change @@ -3643,9 +3643,9 @@ class ConcurrentQueueTests : public TestClass<ConcurrentQueueTests>
3643
3643
3644
3644
// is_lock_free()
3645
3645
{
3646
- bool lockFree = ConcurrentQueue<Foo, Traits>::is_lock_free ();
3646
+ constexpr bool lockFree = ConcurrentQueue<Foo, Traits>::is_lock_free ();
3647
3647
#if defined(__amd64__) || defined(_M_X64) || defined(__x86_64__) || defined(_M_IX86) || defined(__i386__) || defined(_M_PPC) || defined(__powerpc__)
3648
- ASSERT_OR_FAIL (lockFree);
3648
+ static_assert (lockFree, " is_lock_free should be true " );
3649
3649
#else
3650
3650
(void )lockFree;
3651
3651
#endif
You can’t perform that action at this time.
0 commit comments