because include/types.h has a 'using namespace std', the call to
::swap() had previously been selecting overloads from namespace std. but
once any other swap() functions are present in the global namespace,
argument-dependent lookup [1] will not consider those from std
for example, when common/sstring.hh has been included, its global swap()
function is the only overload considered, so calls to ::swap() result in
errors like this:
/home/cbodley/ceph/src/osd/osd_types.h: In member function ‘void ObjectModDesc::swap(ObjectModDesc&)’:
/home/cbodley/ceph/src/osd/osd_types.h:3135:56: error: no matching function for call to ‘swap(bool&, bool&)’
::swap(other.can_local_rollback, can_local_rollback);
^
/home/cbodley/ceph/src/common/sstring.hh:589:6: note: candidate: template<class char_type, class size_type, size_type max_size> void swap(basic_sstring<char_type, size_type, Max>&, basic_sstring<char_type, size_type, Max>&)
void swap(basic_sstring<char_type, size_type, max_size>& x,
^
/home/cbodley/ceph/src/common/sstring.hh:589:6: note: template argument deduction/substitution failed:
/home/cbodley/ceph/src/osd/osd_types.h:3135:56: note: mismatched types ‘basic_sstring<char_type, size_type, Max>’ and ‘bool’
::swap(other.can_local_rollback, can_local_rollback);
adding a `using std::swap;` to the calling scope and removing :: from
the call to `swap()` allows argument-dependent lookup to resolve the
overloads in both namespaces