Ne serait-ce pas envisageable d'afficher un warning grace aux classes de traits ou carrément une enum définie dans chaque conteneur ?You should always prefer a member function over an algorithm if good performance is the goal. The problem is, you have to know that a member function exists that has significantly better performance for a certain container. No warning or error message appears if you use the remove() algorithm for a list.
Partager