-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
bugSomething isn't workingSomething isn't workingcontainerContainer related taskContainer related taskp2higher priorityhigher priority
Description
Problem
swap in the Vector is defined inside the class as a friend function. This enables ADL, that is, the function will be found through the unqualified swap(a, b) call. However, for the qualified call bmb::swap(a, b) the compiler will use general swap definition through moves.
Possible solution
Declare swap as a template friend function inside the Vector, then define it after the class definition. After that, the compiler will always choose proper swap version for both qualified and unqualified calls.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingcontainerContainer related taskContainer related taskp2higher priorityhigher priority