QBitArray: move a few methods more into the class body
This reduces the size of the header. I renamed the arguments for fill() because "size" would shadow a member function. Change-Id: I85b3fc2dd45c4693be13fffd1795b706b92e0965 Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>bb10
parent
b3958d26ca
commit
6bd2358105
|
|
@ -69,9 +69,9 @@ public:
|
|||
return cl;
|
||||
}
|
||||
|
||||
bool at(qsizetype i) const;
|
||||
bool at(qsizetype i) const { return testBit(i); }
|
||||
QBitRef operator[](qsizetype i);
|
||||
bool operator[](qsizetype i) const;
|
||||
bool operator[](qsizetype i) const { return testBit(i); }
|
||||
|
||||
QBitArray &operator&=(const QBitArray &);
|
||||
QBitArray &operator|=(const QBitArray &);
|
||||
|
|
@ -81,7 +81,8 @@ public:
|
|||
inline bool operator==(const QBitArray &other) const { return d == other.d; }
|
||||
inline bool operator!=(const QBitArray &other) const { return d != other.d; }
|
||||
|
||||
inline bool fill(bool val, qsizetype size = -1);
|
||||
bool fill(bool aval, qsizetype asize = -1)
|
||||
{ *this = QBitArray((asize < 0 ? this->size() : asize), aval); return true; }
|
||||
void fill(bool val, qsizetype first, qsizetype last);
|
||||
|
||||
inline void truncate(qsizetype pos) { if (pos < size()) resize(pos); }
|
||||
|
|
@ -96,15 +97,11 @@ public:
|
|||
inline DataPtr &data_ptr() { return d.data_ptr(); }
|
||||
};
|
||||
|
||||
inline bool QBitArray::fill(bool aval, qsizetype asize)
|
||||
{ *this = QBitArray((asize < 0 ? this->size() : asize), aval); return true; }
|
||||
|
||||
Q_CORE_EXPORT QBitArray operator&(const QBitArray &, const QBitArray &);
|
||||
Q_CORE_EXPORT QBitArray operator|(const QBitArray &, const QBitArray &);
|
||||
Q_CORE_EXPORT QBitArray operator^(const QBitArray &, const QBitArray &);
|
||||
|
||||
inline bool QBitArray::operator[](qsizetype i) const { return testBit(i); }
|
||||
inline bool QBitArray::at(qsizetype i) const { return testBit(i); }
|
||||
|
||||
class Q_CORE_EXPORT QBitRef
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue