paleolimbot commented on code in PR #404:
URL: https://github.com/apache/arrow-nanoarrow/pull/404#discussion_r1576596132
##########
src/nanoarrow/nanoarrow.hpp:
##########
@@ -222,6 +221,9 @@ class Unique {
T* operator->() noexcept { return &data_; }
const T* operator->() const noexcept { return &data_; }
+ /// \brief Check for validity
+ explicit operator bool() const { return data_.release != nullptr; }
Review Comment:
Hmm...if `buffer->data` is null it is still perfectly valid to call
`ArrowBufferAppend()`, although it is also not holding on to any resources at
that point (other than the memory for the `ArrowBuffer` itself). I'm not sure
where that lines up in terms of C++ idioms (which I am very bad at spotting).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]