Go to the source code of this file.
 | 
|   | TEST_CASE ("atomic_is_lock_free std::shared_ptr compatibility", "[shared_ptr][atomic]") | 
|   | 
|   | TEST_CASE ("atomic_load works in the same thread", "[shared_ptr][atomic]") | 
|   | 
|   | TEST_CASE ("atomic_load_explicit works in the same thread", "[shared_ptr][atomic]") | 
|   | 
|   | TEST_CASE ("atomic_store works in the same thread", "[shared_ptr][atomic]") | 
|   | 
|   | TEST_CASE ("atomic_store_explicit works in the same thread", "[shared_ptr][atomic]") | 
|   | 
|   | TEST_CASE ("atomic_exchange works in the same thread", "[shared_ptr][atomic]") | 
|   | 
|   | TEST_CASE ("atomic_exchange_explicit works in the same thread", "[shared_ptr][atomic]") | 
|   | 
|   | TEST_CASE ("atomic_compare_exchange_weak works in the same thread", "[shared_ptr][atomic]") | 
|   | 
|   | TEST_CASE ("atomic_compare_exchange_weak works in the same thread, compares " "pointer, not value", "[shared_ptr][atomic]") | 
|   | 
|   | TEST_CASE ("atomic_compare_exchange_strong works in the same thread", "[shared_ptr][atomic]") | 
|   | 
|   | TEST_CASE ("atomic_compare_exchange_strong works in the same thread, compares " "pointer, not value", "[shared_ptr][atomic]") | 
|   | 
|   | TEST_CASE ("atomic_compare_exchange_weak_explicit works in the same thread", "[shared_ptr][atomic]") | 
|   | 
|   | TEST_CASE ("atomic_compare_exchange_strong_explicit works in the same thread, " "compares pointer, not value", "[shared_ptr][atomic]") | 
|   | 
◆ TEST_CASE() [1/13]
      
        
          | TEST_CASE  | 
          ( | 
          "atomic_is_lock_free std::shared_ptr compatibility"  | 
          ,  | 
        
        
           | 
           | 
          ""  | 
          [shared_ptr][atomic]  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Definition at line 9 of file shared_ptr_atomic.cpp.
   11     const auto std_p = std::make_shared<int>(42);
    12     const auto p = throwing::make_shared<int>(42);
 bool atomic_is_lock_free(shared_ptr< T > const *p)
Determines whether atomic access to the shared pointer pointed-to by p is lock-free. 
 
 
 
 
◆ TEST_CASE() [2/13]
      
        
          | TEST_CASE  | 
          ( | 
          "atomic_load works in the same thread"  | 
          ,  | 
        
        
           | 
           | 
          ""  | 
          [shared_ptr][atomic]  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Definition at line 16 of file shared_ptr_atomic.cpp.
   17     const auto p = throwing::make_shared<int>(42);
 shared_ptr< T > atomic_load(const shared_ptr< T > *p)
Equivalent to atomic_load_explicit(p, std::memory_order_seq_cst) 
 
 
 
 
◆ TEST_CASE() [3/13]
      
        
          | TEST_CASE  | 
          ( | 
          "atomic_load_explicit works in the same thread"  | 
          ,  | 
        
        
           | 
           | 
          ""  | 
          [shared_ptr][atomic]  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Definition at line 22 of file shared_ptr_atomic.cpp.
   24     const auto p = throwing::make_shared<int>(42);
 shared_ptr< T > atomic_load_explicit(const shared_ptr< T > *p, std::memory_order mo)
Returns the shared pointer pointed-to by p. 
 
 
 
 
◆ TEST_CASE() [4/13]
      
        
          | TEST_CASE  | 
          ( | 
          "atomic_store works in the same thread"  | 
          ,  | 
        
        
           | 
           | 
          ""  | 
          [shared_ptr][atomic]  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Definition at line 29 of file shared_ptr_atomic.cpp.
   30     const auto p1 = throwing::make_shared<int>(1);
    31     auto p2 = throwing::make_shared<int>(2);
 void atomic_store(shared_ptr< T > *p, shared_ptr< T > r)
Equivalent to atomic_store_explicit(p, r, memory_order_seq_cst) 
 
 
 
 
◆ TEST_CASE() [5/13]
      
        
          | TEST_CASE  | 
          ( | 
          "atomic_store_explicit works in the same thread"  | 
          ,  | 
        
        
           | 
           | 
          ""  | 
          [shared_ptr][atomic]  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Definition at line 37 of file shared_ptr_atomic.cpp.
   39     const auto p1 = throwing::make_shared<int>(1);
    40     auto p2 = throwing::make_shared<int>(2);
 void atomic_store_explicit(shared_ptr< T > *p, shared_ptr< T > r, std::memory_order mo)
Stores the shared pointer r in the shared pointer pointed-to by p atomically, effectively executing p...
 
 
 
 
◆ TEST_CASE() [6/13]
      
        
          | TEST_CASE  | 
          ( | 
          "atomic_exchange works in the same thread"  | 
          ,  | 
        
        
           | 
           | 
          ""  | 
          [shared_ptr][atomic]  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Definition at line 46 of file shared_ptr_atomic.cpp.
   47     const auto p1 = throwing::make_shared<int>(1);
    48     auto p2 = throwing::make_shared<int>(2);
 shared_ptr< T > atomic_exchange(shared_ptr< T > *p, shared_ptr< T > r)
Equivalent to atomic_exchange(p, r, memory_order_seq_cst) 
 
 
 
 
◆ TEST_CASE() [7/13]
      
        
          | TEST_CASE  | 
          ( | 
          "atomic_exchange_explicit works in the same thread"  | 
          ,  | 
        
        
           | 
           | 
          ""  | 
          [shared_ptr][atomic]  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Definition at line 54 of file shared_ptr_atomic.cpp.
   56     const auto p1 = throwing::make_shared<int>(1);
    57     auto p2 = throwing::make_shared<int>(2);
 shared_ptr< T > atomic_exchange_explicit(shared_ptr< T > *p, shared_ptr< T > r, std::memory_order mo)
Stores the shared pointer r in the shared pointer pointed to by p and returns the value formerly poin...
 
 
 
 
◆ TEST_CASE() [8/13]
      
        
          | TEST_CASE  | 
          ( | 
          "atomic_compare_exchange_weak works in the same thread"  | 
          ,  | 
        
        
           | 
           | 
          ""  | 
          [shared_ptr][atomic]  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Definition at line 63 of file shared_ptr_atomic.cpp.
   65     auto p = throwing::make_shared<int>(1);
    67     auto desired = throwing::make_shared<int>(2);
 bool atomic_compare_exchange_weak(shared_ptr< T > *p, shared_ptr< T > *expected, shared_ptr< T > desired)
Equivalent to atomic_compare_exchange_weak_explicit(p, expected, desired, std::memory_order_seq_cst, std::memory_order_seq_cst) 
 
 
 
 
◆ TEST_CASE() [9/13]
      
        
          | TEST_CASE  | 
          ( | 
          "atomic_compare_exchange_weak works in the same  | 
          thread,  | 
        
        
           | 
           | 
          compares " "  | 
          pointer,  | 
        
        
           | 
           | 
          not value"  | 
          ,  | 
        
        
           | 
           | 
          ""  | 
          [shared_ptr][atomic]  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Definition at line 73 of file shared_ptr_atomic.cpp.
   76     auto p = throwing::make_shared<int>(1);
    77     auto expected = throwing::make_shared<int>(1);
    78     auto desired = throwing::make_shared<int>(3);
    81     REQUIRE(*expected == 1);
 bool atomic_compare_exchange_weak(shared_ptr< T > *p, shared_ptr< T > *expected, shared_ptr< T > desired)
Equivalent to atomic_compare_exchange_weak_explicit(p, expected, desired, std::memory_order_seq_cst, std::memory_order_seq_cst) 
 
 
 
 
◆ TEST_CASE() [10/13]
      
        
          | TEST_CASE  | 
          ( | 
          "atomic_compare_exchange_strong works in the same thread"  | 
          ,  | 
        
        
           | 
           | 
          ""  | 
          [shared_ptr][atomic]  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Definition at line 84 of file shared_ptr_atomic.cpp.
   86     auto p = throwing::make_shared<int>(1);
    88     auto desired = throwing::make_shared<int>(2);
 bool atomic_compare_exchange_strong(shared_ptr< T > *p, shared_ptr< T > *expected, shared_ptr< T > desired)
Equivalent to atomic_compare_exchange_strong_explicit(p, expected, desired, std::memory_order_seq_cst...
 
 
 
 
◆ TEST_CASE() [11/13]
      
        
          | TEST_CASE  | 
          ( | 
          "atomic_compare_exchange_strong works in the same  | 
          thread,  | 
        
        
           | 
           | 
          compares " "  | 
          pointer,  | 
        
        
           | 
           | 
          not value"  | 
          ,  | 
        
        
           | 
           | 
          ""  | 
          [shared_ptr][atomic]  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Definition at line 94 of file shared_ptr_atomic.cpp.
   97     auto p = throwing::make_shared<int>(1);
    98     auto expected = throwing::make_shared<int>(1);
    99     auto desired = throwing::make_shared<int>(3);
   102     REQUIRE(*expected == 1);
 bool atomic_compare_exchange_strong(shared_ptr< T > *p, shared_ptr< T > *expected, shared_ptr< T > desired)
Equivalent to atomic_compare_exchange_strong_explicit(p, expected, desired, std::memory_order_seq_cst...
 
 
 
 
◆ TEST_CASE() [12/13]
      
        
          | TEST_CASE  | 
          ( | 
          "atomic_compare_exchange_weak_explicit works in the same thread"  | 
          ,  | 
        
        
           | 
           | 
          ""  | 
          [shared_ptr][atomic]  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Definition at line 105 of file shared_ptr_atomic.cpp.
  107     auto p = throwing::make_shared<int>(1);
   109     auto desired = throwing::make_shared<int>(2);
   112                                                   std::memory_order_seq_cst,
   113                                                   std::memory_order_seq_cst));
 bool atomic_compare_exchange_weak_explicit(shared_ptr< T > *p, shared_ptr< T > *expected, shared_ptr< T > desired, std::memory_order success, std::memory_order failure)
Compares the shared pointers pointed-to by p and expected. If they are equivalent (store the same poi...
 
 
 
 
◆ TEST_CASE() [13/13]
      
        
          | TEST_CASE  | 
          ( | 
          "atomic_compare_exchange_strong_explicit works in the same  | 
          thread,  | 
        
        
           | 
           | 
          " "compares  | 
          pointer,  | 
        
        
           | 
           | 
          not value"  | 
          ,  | 
        
        
           | 
           | 
          ""  | 
          [shared_ptr][atomic]  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Definition at line 117 of file shared_ptr_atomic.cpp.
  120     auto p = throwing::make_shared<int>(1);
   121     auto expected = throwing::make_shared<int>(1);
   122     auto desired = throwing::make_shared<int>(3);
   125             &p, &expected, desired, std::memory_order_seq_cst,
   126             std::memory_order_seq_cst));
   127     REQUIRE(*expected == 1);
 bool atomic_compare_exchange_strong_explicit(shared_ptr< T > *p, shared_ptr< T > *expected, shared_ptr< T > desired, std::memory_order success, std::memory_order failure)
Compares the shared pointers pointed-to by p and expected. If they are equivalent (store the same poi...