SHOW:
|
|
- or go back to the newest paste.
| 1 | class ImmutableString | |
| 2 | {
| |
| 3 | public: | |
| 4 | ImmutableString substring(std::size_t pos, std::size_t len) | |
| 5 | {
| |
| 6 | return ImmutableString( | |
| 7 | - | std::shared_ptr<char[]>(m_data.get() + pos, m_data), |
| 7 | + | std::shared_ptr<char[]>(m_data, m_data.get() + pos), |
| 8 | len | |
| 9 | ); | |
| 10 | } | |
| 11 | ||
| 12 | private: | |
| 13 | std::shared_ptr<char[]> m_data; | |
| 14 | std::size_t m_length; | |
| 15 | }; |