#include // std::cout #include // std::copy #include // std::set #include "Student.hpp" int main () { Student students[] = { Student("Peter_Pan", 1234), Student("Tinker_Bell", 1235) }; std::cerr << "----- Init set -----" << std::endl; std::set myset; for(int i=0; i<2; i++) { myset.insert(students[i]); // copy-constructor, insert first myset.insert(students[i]); // copy-constructor, insert last } myset.emplace("Mickey_Mouse", 1237); // argument construct, insert last std::cerr << "-------------------------\n"; std::cerr << "myset contains:"; for (std::set::iterator it = myset.begin(); it!=myset.end(); ++it) std::cerr << ' ' << *it; std::cerr << std::endl; std::cerr << "-------------------------\n"; return 0; }