| 365 | } |
| 366 | |
| 367 | class StringHolder { |
| 368 | public: |
| 369 | StringHolder(const std::string& s) : str_(s) {} |
| 370 | |
| 371 | void set(const std::string& s) { |
| 372 | str_ = s; |
| 373 | } |
| 374 | |
| 375 | std::string get() const { |
| 376 | return str_; |
| 377 | } |
| 378 | |
| 379 | std::string& get_ref() { |
| 380 | return str_; |
| 381 | } |
| 382 | |
| 383 | const std::string& get_const_ref() const { |
| 384 | return str_; |
| 385 | } |
| 386 | |
| 387 | private: |
| 388 | std::string str_; |
| 389 | }; |
| 390 | |
| 391 | class SharedPtrHolder { |
| 392 | public: |