Repository navigation
Replies: 5 comments 3 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
};
|
|
Here is the proposed renaming.
The idea is that operations that only see the flat sequence of bytes are prefixed with |
|
The revised renaming proposal, after the recent library changes:
Again, the goal: distinguish functions operating on the byte sequence from the functions operating on buffer sequence. |
|
A more modest renaming proposal after feedback from Vinnie. This preserves all ASIO and Networking TS names and at the same time introduces some order:
And then the prefix system is teachable:
|
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