class TestClass {
public:
TestClass(string s) {
}
};
When there is TestClass, I understand the difference between emplace and insert (emplace constructs in place while insert copies)
set<TestClass> test_set;
test_set.insert(TestClass("d"));
test_set.emplace("d");
However, if there is already a TestClass object, how are they different in terms of mechanism and preformance?
set<TestClass> test_set;
TestClass tc("e");
test_set.insert(tc);
test_set.emplace(tc);