Repository navigation
Replies: 3 comments 1 reply
|
|
0 replies
|
Example from @pdimov: for this type struct my_buf
{
unsigned char data[ 4 ];
operator mutable_buffer() noexcept { return { data, 4 }; }
operator const_buffer const noexcept { return { data, 4 } };
unsigned char* begin() noexcept { return data; }
unsigned char* end() noexcept { return data + 4; }
// etc
};
|
0 replies
|
Here is the proposed renaming.
The idea is that operations that only see the flat sequence of bytes are prefixed with |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Rename
beginandendtobuffer_beginandbuffer_end. They do a different thing thanstd::begin/std::end; they should not suggest otherwise.Rename
buffer_sizetobuffer_byte_count(orbuffer_total_bytes). The current name incorrectly implies the value ofstd::distance(capy::buffer_begin(B), std::buffer_end(B)). Alternatively, only if users express interest in the feature, reintroduce it asbuffer_sequence_size.Remove
buffer_length. It is never used and easily implemented withstd::distance(capy::buffer_begin(B), std::buffer_end(B)). According to the authors, it only exists to suggest whatbuffer_sizeis not doing.All reactions