Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ch13/ex13_31.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ void swap(HasPtr& lhs, HasPtr& rhs)
{
lhs.swap(rhs);
}
//Function swap(HasPtr&, HasPtr&) is actually never used. The notice is printed because '=' is called, and 'sort' doesn't call swap(HasPtr&, HasPtr&) at all.
//I saw a comment that might be the reason:
//swap(HasPtr&, HasPtr&) is used in quicksort, but 'sort' won't use quicksort when there are not enough elements in the container(insertionsort is used instead).

bool operator<(const HasPtr& lhs, const HasPtr& rhs)
{
Expand Down