Skip to content

Glossary: Data Structures and Algorithms in C++

Slice

Also written: slices, substr

A piece of a vector or string. Building one with std::vector(begin()+a, begin()+b) or std::string::substr copies it in O(k), so changing it doesn't change the original.

Where the book teaches it

Related terms

std::string_viewstd::span