Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <numeric>
- #include <iostream>
- #include <string>
- #include <set>
- #include <vector>
- using namespace std;
- class SearchServer
- {
- public:
- explicit SearchServer(const string& str) {
- cout << "String "s << str << " has been converted to a set of stop words"s << endl;
- }
- template <typename StringCollection>
- explicit SearchServer(const StringCollection& splitted_string) : SearchServer([splitted_string]() -> string {return accumulate(splitted_string.begin(), splitted_string.end(), string{});})
- {
- cout << "Container has been converted to a string and sent to constructor"s << endl;
- }
- };
- int main() {
- SearchServer ss1("one two three"s);
- vector<string> in_v = {"four"s, "five"s, "six"s};
- SearchServer ss2(in_v);
- }
Advertisement
Add Comment
Please, Sign In to add comment