-
-
Save fabiogaluppo/e5e9355b40fd0e6e561f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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