libcxx

libcxx mirror with random patches
git clone https://git.neptards.moe/neptards/libcxx.git
Log | Files | Refs

arrow.pass.cpp (713B)


      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 // T* operator->() const;
     15 
     16 #include <memory>
     17 #include <utility>
     18 #include <cassert>
     19 
     20 int main()
     21 {
     22     const std::shared_ptr<std::pair<int, int> > p(new std::pair<int, int>(3, 4));
     23     assert(p->first == 3);
     24     assert(p->second == 4);
     25     p->first = 5;
     26     p->second = 6;
     27     assert(p->first == 5);
     28     assert(p->second == 6);
     29 }