-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
extract() <=> data buffer is owning #610
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine to me (with minor suggestions). But I am really starting to be confused by in
out
owning
and friends, we should really write some high-level documentation for this together with the whole structured binding stuff.
include/kamping/result.hpp
Outdated
/// @brief Helper for implementing the extract_* functions in \ref MPIResult. Is \c true if the passed buffer type owns | ||
/// its underlying storage and is an output buffer. | ||
template <typename Buffer> | ||
inline constexpr bool is_extractable = Buffer::is_owning& Buffer::is_out_buffer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inline constexpr bool is_extractable = Buffer::is_owning& Buffer::is_out_buffer; | |
inline constexpr bool is_extractable = Buffer::is_owning && Buffer::is_out_buffer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this located in this header? I think this should be part of DataBuffer
.
Nevermind, it makes sense with the specialization for ResultCategoryNotUsed
. Still, I think we should have Buffer::is_extractable
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be in the internal
namespace?
DataBuffer::extract() is now available if only if DataBuffer::is_owning, i.e. the data buffer owns its underlying storage.
The distinction between in/out buffers is now made in the result object and is (somewhat) decoupled from the existence of the extract() member function.
First step for enabling structured-binding ready result objects.