Commit 56b7145a authored by Mark OLESEN's avatar Mark OLESEN Committed by Andrew Heather
Browse files

STYLE: move bitSet '~' member operator to be a global operator instead

parent 1788bce0
......@@ -513,10 +513,6 @@ public:
//- Move assignment
inline bitSet& operator=(bitSet&& bitset);
//- Complement operator.
// Return a copy of the existing set with all its bits flipped.
inline bitSet operator~() const;
//- Bitwise-AND all the bits in other with the bits in this bitset.
// The operands may have dissimilar sizes without affecting the size
// of the set.
......@@ -576,6 +572,9 @@ Ostream& operator<<(Ostream& os, const bitSet& bitset);
Ostream& operator<<(Ostream& os, const InfoProxy<bitSet>& info);
//- Bitset complement, returns a copy of the bitset with all its bits flipped
inline bitSet operator~(const bitSet& bitset);
//- Bitwise-AND of two bitsets.
// See bitSet::operator&= for more details.
inline bitSet operator&(const bitSet& a, const bitSet& b);
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -663,14 +663,6 @@ inline Foam::bitSet& Foam::bitSet::operator=(bitSet&& bitset)
}
inline Foam::bitSet Foam::bitSet::operator~() const
{
bitSet result(*this);
result.flip();
return result;
}
inline Foam::bitSet& Foam::bitSet::operator&=(const bitSet& other)
{
return andEq(other);
......@@ -697,6 +689,14 @@ inline Foam::bitSet& Foam::bitSet::operator-=(const bitSet& other)
// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
inline Foam::bitSet Foam::operator~(const bitSet& bitset)
{
bitSet result(bitset);
result.flip();
return result;
}
inline Foam::bitSet Foam::operator&(const bitSet& a, const bitSet& b)
{
bitSet result(a);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment