C++17 STL Cookbook
上QQ阅读APP看书,第一时间看更新

There's more...

The std::remove function also works on other containers. When used with std::array,  note that it does not support the second step of calling erase, because they do not have automatic size handling. Just because std::remove effectively only moves items around and does not perform their actual deletion, it can also be used on data structures such as arrays that do not support resizing. In the array case, one could overwrite the values past the new end iterator with sentinel values such as '\0' for strings, for example.