Home | History | Annotate | Download | only in util.smartptr.shared.atomic
      1 //===----------------------------------------------------------------------===//
      2 //
      3 //                     The LLVM Compiler Infrastructure
      4 //
      5 // This file is dual licensed under the MIT and the University of Illinois Open
      6 // Source Licenses. See LICENSE.TXT for details.
      7 //
      8 //===----------------------------------------------------------------------===//
      9 
     10 // <memory>
     11 
     12 // shared_ptr
     13 
     14 // template <class T>
     15 // void
     16 // atomic_store(shared_ptr<T>* p, shared_ptr<T> r)
     17 
     18 #include <memory>
     19 #include <cassert>
     20 
     21 int main()
     22 {
     23 #if __has_feature(cxx_atomic)
     24     {
     25         std::shared_ptr<int> p;
     26         std::shared_ptr<int> r(new int(3));
     27         std::atomic_store(&p, r);
     28         assert(*p == *r);
     29     }
     30 #endif
     31 }
     32