xref: /llvm-project/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/shared_ptr/main.cpp (revision 0ac42fd26d738b2d7b2811fc995bd7cacf994144)
1 #include <memory>
2 #include <string>
3 
4 struct User {
5   int id = 30;
6   std::string name = "steph";
7 };
8 
main()9 int main() {
10   std::shared_ptr<int> sp_empty;
11   std::shared_ptr<int> sp_int = std::make_shared<int>(10);
12   std::shared_ptr<std::string> sp_str = std::make_shared<std::string>("hello");
13   std::shared_ptr<int> &sp_int_ref = sp_int;
14   std::shared_ptr<int> &&sp_int_ref_ref = std::make_shared<int>(10);
15   std::shared_ptr<User> sp_user = std::make_shared<User>();
16 
17   return 0; // break here
18 }
19