1 //===----------------------------------------------------------------------===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 // <memory> 10 11 // shared_ptr 12 13 // T* operator->() const; 14 15 #include <memory> 16 #include <utility> 17 #include <cassert> 18 19 int main() 20 { 21 const std::shared_ptr<std::pair<int, int> > p(new std::pair<int, int>(3, 4)); 22 assert(p->first == 3); 23 assert(p->second == 4); 24 p->first = 5; 25 p->second = 6; 26 assert(p->first == 5); 27 assert(p->second == 6); 28 } 29