Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
void unique(std::vector<std::string>&& ss)
{
ss.resize(std::distance(ss.begin(),
std::unique(ss.begin(), ss.end())));
for (auto& s : ss) std::cout << s << "\n";
}
std::vector<std::string> read_all_lines(std::istream& istr)
{
std::vector<std::string> temp;
std::string buffer;
while (std::getline(istr, buffer, '\n'))
{
temp.emplace_back(std::move(buffer));
}
return std::move(temp);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment