src: more cleanups; NFCI
This commit is contained in:
@@ -48,23 +48,33 @@ private:
|
||||
#include "xspan_impl_common.h"
|
||||
public:
|
||||
// constructors from pointers
|
||||
CSelf(pointer first) : ptr(makePtr(first)), base(nullptr), size_in_bytes(0) {}
|
||||
CSelf(pointer first) : ptr(makePtr(first)), base(nullptr), size_in_bytes(0) {
|
||||
assertInvariants();
|
||||
}
|
||||
|
||||
// constructors
|
||||
CSelf(const Self &other)
|
||||
: ptr(other.ensurePtr()), base(other.base), size_in_bytes(other.size_in_bytes) {}
|
||||
: ptr(other.ensurePtr()), base(other.base), size_in_bytes(other.size_in_bytes) {
|
||||
assertInvariants();
|
||||
}
|
||||
template <class U>
|
||||
CSelf(const CSelf<U> &other, SPAN_REQUIRES_CONVERTIBLE_A)
|
||||
: ptr(other.ensurePtr()), base(other.base), size_in_bytes(other.size_in_bytes) {}
|
||||
: ptr(other.ensurePtr()), base(other.base), size_in_bytes(other.size_in_bytes) {
|
||||
assertInvariants();
|
||||
}
|
||||
|
||||
// constructors from Span friends
|
||||
template <class U>
|
||||
CSelf(const Span<U> &other, SPAN_REQUIRES_CONVERTIBLE_A)
|
||||
: ptr(other.ensurePtr()), base(other.base), size_in_bytes(other.size_in_bytes) {}
|
||||
: ptr(other.ensurePtr()), base(other.base), size_in_bytes(other.size_in_bytes) {
|
||||
assertInvariants();
|
||||
}
|
||||
#if SPAN_CONFIG_ENABLE_SPAN_CONVERSION
|
||||
template <class U>
|
||||
CSelf(const PtrOrSpanOrNull<U> &other, SPAN_REQUIRES_CONVERTIBLE_A)
|
||||
: ptr(other.ensurePtr()), base(other.base), size_in_bytes(other.size_in_bytes) {}
|
||||
: ptr(other.ensurePtr()), base(other.base), size_in_bytes(other.size_in_bytes) {
|
||||
assertInvariants();
|
||||
}
|
||||
#endif
|
||||
|
||||
// assignment from Span friends
|
||||
@@ -107,6 +117,7 @@ public:
|
||||
#undef CSelf
|
||||
};
|
||||
|
||||
// raw_bytes overload
|
||||
template <class T>
|
||||
inline T *raw_bytes(const PtrOrSpan<T> &a, size_t size_in_bytes) {
|
||||
return a.raw_bytes(size_in_bytes);
|
||||
|
||||
Reference in New Issue
Block a user