gnzlbg / static_vector

A dynamically-resizable vector with fixed capacity and embedded storage
https://gnzlbg.github.io/static_vector
167 stars 21 forks source link

update specs for swap() #42

Open akrzemi1 opened 5 years ago

akrzemi1 commented 5 years ago

Please, do not just apply this change. I just want to discuss this, as I am not sure myself what your goals are.

When you only hide this overload of std::swap in cases where T is not swappable the effect will be that the generic version of std::swap will become a viable candidate, and this generic swap does not require the T to be swappable. So instead, maybe you just want a hard error? If so, you can apply this commit. The note is taken from the specification of swap for std::array: http://eel.is/c++draft/array#members-5

The constraints for the member swap can be left as they are: there is no interaction with other overloads.

gnzlbg commented 5 years ago

cc @caseycarter