Advertisement
Guest User

Untitled

a guest
Oct 11th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. class Strings
  2. {
  3.     std::string d_emptyString;
  4.  
  5.     std::string *d_str;
  6.  
  7.     ...
  8.  
  9.     private:
  10.         std::string &stringAt(size_t const idx) const;
  11. }
  12.  
  13. // ---------------------------------------------------- //
  14.  
  15. std::string &Strings::stringAt(size_t const idx) const
  16. {
  17.     if(idx < d_size)
  18.         return d_str[idx];
  19.     else
  20.         return d_emptyString;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement