Re: [capy] the Buffer nomenclature

Vinnie Falco via Boost <[email protected]> Sun, 21 Jun 2026 17:43:13 -0700
Newsgroups gmane.comp.lib.boost.devel
Message-ID <CA+EzHGfJoXu1qCDiDoWrK0Q6_WnPr2u6ZVG33mMXTQHXKWQQNw@mail.gmail.com>
On Sun, Jun 21, 2026 at 6:35 AM Andrzej Krzemienski via Boost <
[email protected]> wrote:

> 1. A contiguous region of memory whose lifetime is managed by the
> programmer.
>

Capy doesn't give this a name but C++ does. It is whatever the programmer
used. It could be unique_ptr, could be a raw pointer, could be a vector,
and so on.


> 2. We have a view-like handle providing access to this region of memory.
>

const_buffer and mutable_buffer. We should avoid overthinking this. And
there's a reason its not span, before anyone asks. And you can read about
that here:

*The Span Reflex*
*When Concrete Thinking Blocks Compositional Design*
https://www.vinniefalco.com/p/the-span-reflex-when-concrete-thinking


> 3. When a read or write operation needs access to space for buffering, it
> is given a "structure" of handles that together give access to all of the
> memory available for buffering.
>

No that's not right. Asio got many things correct and we proudly take from
it what works. Capy inherits ConstBufferSequence and MutableBufferSequence
directly from Asio. These are ranges-style views, except they are buffer
oriented instead of byte oriented. And each buffer in the sequence can have
a different size, which is why they do not fit perfectly into the
std::ranges taxonomy. This is also explained in "The Span Reflex."

This naming has been very confusing to me, and the library design only started
> to make sense for me, when I mentally used a different naming:
>

Everyone is going to have their own opinion on the name, everyone is going
to be confused by any naming which is not theirs. The role of the library
is to pick something. We picked something.

Best
_______________________________________________
Boost mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://lists.boost.org/mailman3/lists/boost.lists.boost.org/
Archived at: https://lists.boost.org/archives/list/[email protected]/message/4CULZH2IRAS62MZZVNFFWSRWLKXN6TJH/