Closed joaquintides closed 10 months ago
We should remove the 'lifting' for operator==
and operator!=
because only test suites do boost::operator==(x, y)
instead of the correct x == y
. For swap
, things are less clear because we had a function boost::swap
in Core so it's quite possible for code to have done boost::swap(x, y)
for unordered_set
or unordered_map
.
If we remove the using directive, this will probably stop compiling, or start doing who knows what.
If we remove the using directive, this will probably stop compiling, or start doing who knows what.
From what I can gather from boost::swap reference, ADL should kick in, so it seems safe to me to drop the lift. I've tested the following locally (on the fix/remove_lifted_ops
branch):
#include <boost/unordered/unordered_flat_map.hpp>
#include <boost/core/swap.hpp>
int main()
{
#pragma warning(disable : 4996)
boost::unordered_flat_map<int,int> fm1,fm2;
boost::swap(fm1,fm2);
}
and everything works fine. (BTW, the docs for boost::swap
do not indicate that the function is deprecated.)
It won't work if boost/core/swap.hpp isn't included, though.
Merging #218 (f4667f5) into develop (ea4fc5e) will increase coverage by
0.01%
. Report is 1 commits behind head on develop. The diff coverage isn/a
.
Opening the PR for discussion. I've removed all lifting
using
directives forswap
andoperator(==|!=)
, except in the case ofboost::unordered_[multi](map|set)
, and I wonder if we should go ahead and remove those too --I can't think of any legitimate use case where they could be needed.