User Tools

Site Tools


cpp:stl:container_common_functions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
cpp:stl:container_common_functions [2023/05/29 16:03] – [Β. Ένθεση σε set, unordered set] gthanoscpp:stl:container_common_functions [2023/05/29 16:21] – [Αναζήτηση σε associative container και unordered associative container] gthanos
Line 39: Line 39:
  
 </code> </code>
 +
 +<WRAP tip 80% center round>
 +Η διαφορά ανάμεσα στις μεθόδους //insert// και //emplace// είναι η εξής: 
 +  * Στη μέθοδο //insert// παρέχουμε ένα αντικείμενο και η μέθοδος κατασκευάζει ένα αντίγραφο του μέσω του κατασκευαστή αντιγραφέα (copy-constructor) της κλάσης //Student//.
 +  * Στη μέθοδο //empace// παρέχουμε τα ορίσματα μέσω των οποίων κατασκευάζεται ένα αντικείμενο τύπου Student, μέσω του κατασκευαστή ''Student(const char *name, int aem);''.
 +</WRAP>
  
 ==== Β. Ένθεση σε set, unordered set ==== ==== Β. Ένθεση σε set, unordered set ====
Line 269: Line 275:
   if(it != myset.end()) {   if(it != myset.end()) {
     myset.erase (it);     myset.erase (it);
-    std::cout << "'buiscuits' erased\n";+    std::cout << "'biscuits' erased\n";
   }   }
   else    else 
-    std::cout << "'buiscuits' not found\n";+    std::cout << "'biscuits' not found\n";
      
   print_set(myset);   print_set(myset);
cpp/stl/container_common_functions.txt · Last modified: 2023/05/30 19:18 by gthanos