Skip to content

Commit 04afa24

Browse files
committed
DMABuffer: Override bool operator.
1 parent 0915df3 commit 04afa24

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/DMABuffer.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ template <class T, size_t A=__SCB_DCACHE_LINE_SIZE> class DMABuffer {
124124
assert(ptr && i < size());
125125
return ptr[i];
126126
}
127+
128+
operator bool() const {
129+
return (ptr != nullptr);
130+
}
127131
};
128132

129133
template <class T, size_t A=__SCB_DCACHE_LINE_SIZE> class DMABufferPool {

0 commit comments

Comments
 (0)