#include <list>
#include <vector>
#include <string>
#include <set>
#include <iostream>
#include <iterator>
#include <functional>
template <typename C1, typename C2>
void assign(C1& target, const C2& source)
{
using std::begin; using std::end;
target.assign(begin(source), end(source));
}
template <typename C>
void print(const C& c)
{
for (auto& e : c)
std::cout << e << '\n';
std::cout << '\n';
}
int main()
{
std::vector<std::string> v;
std::list<const char*> list = { "aaa", "bbb", "ccc" };
std::set<const char*, std::less<std::string>> set = { "one", "two", "three", "four" };
const char* array[] = { "one", "two", "three", "four" };
assign(v, list);
print(v);
assign(v, set);
print(v);
assign(v, array);
print(v);
}
I2luY2x1ZGUgPGxpc3Q+CiNpbmNsdWRlIDx2ZWN0b3I+CiNpbmNsdWRlIDxzdHJpbmc+CiNpbmNsdWRlIDxzZXQ+CiNpbmNsdWRlIDxpb3N0cmVhbT4KI2luY2x1ZGUgPGl0ZXJhdG9yPgojaW5jbHVkZSA8ZnVuY3Rpb25hbD4KCnRlbXBsYXRlIDx0eXBlbmFtZSBDMSwgdHlwZW5hbWUgQzI+CnZvaWQgYXNzaWduKEMxJiB0YXJnZXQsIGNvbnN0IEMyJiBzb3VyY2UpCnsKICAgIHVzaW5nIHN0ZDo6YmVnaW47IHVzaW5nIHN0ZDo6ZW5kOwogICAgdGFyZ2V0LmFzc2lnbihiZWdpbihzb3VyY2UpLCBlbmQoc291cmNlKSk7Cn0KCnRlbXBsYXRlIDx0eXBlbmFtZSBDPgp2b2lkIHByaW50KGNvbnN0IEMmIGMpCnsKICAgIGZvciAoYXV0byYgZSA6IGMpCiAgICAgICAgc3RkOjpjb3V0IDw8IGUgPDwgJ1xuJzsKCiAgICBzdGQ6OmNvdXQgPDwgJ1xuJzsKfQoKaW50IG1haW4oKQp7CiAgICBzdGQ6OnZlY3RvcjxzdGQ6OnN0cmluZz4gdjsKICAgIHN0ZDo6bGlzdDxjb25zdCBjaGFyKj4gbGlzdCA9IHsgImFhYSIsICJiYmIiLCAiY2NjIiB9OwogICAgc3RkOjpzZXQ8Y29uc3Qg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