You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cppalliance/capy#262 removes the slice CPO machinery
(`capy::prefix`, `capy::sans_prefix`, `capy::remove_prefix`,
`capy::remove_suffix`, `capy::keep_prefix`, `capy::slice_of<>`)
and the `capy::const_buffer_pair` / `capy::mutable_buffer_pair`
aliases. boost::http migrates to the replacements:
- `capy::const_buffer_pair` / `capy::mutable_buffer_pair` -->
`std::array<capy::const_buffer, 2>` /
`std::array<capy::mutable_buffer, 2>`.
- `capy::prefix(seq, n)` returning a 2-element buffer pair -->
local helper `prefix_pair(seq, n)` in `src/parser.cpp` that
constructs the trimmed array directly. Retained for the call
sites that consume the result as a std::array (i.e. assigning
to a parser member or passing to `filter::process`).
- For one parser site where the result is consumed by
`capy::buffer_copy`, the migration uses `capy::buffer_slice`
directly: `auto chunk = capy::buffer_slice(cb0_.data(), 0, n);`
then `buffer_copy(target, chunk.data())`. Demonstrates the
by-value buffer_slice's idiomatic use; the slice owns its
buffer-sequence copy and works with the prvalue `cb0_.data()`.
- `capy::remove_prefix(pair, n)` / `capy::remove_suffix(pair, n)`
on 2-element buffer pairs --> local helpers
`trim_prefix_pair` / `trim_suffix_pair` in `src/serializer.cpp`.
Retained for `out_prepare()`'s in-place std::array trim.
- `capy::remove_prefix(buf, n)` on a single buffer -->
`buf += n` (member operator already provided by capy).
- `capy::sans_prefix(seq, n)` --> `capy::buffer_slice(seq, n)`
(returns a Slice exposing the buffer sequence via `.data()`).
In iterative consumption loops, advance an existing slice in
place via `slice.remove_prefix(n)`.
- `filter::process` now takes
`boost::span<const capy::mutable_buffer>` and
`std::array<capy::const_buffer, 2>` directly, and drives the
loop using `capy::buffer_slice` internally.
- Test serializer.cpp's `read_some` builds a slice in one
expression via `capy::buffer_slice(sr.prepare().value(), 0, 256)`
and iterates `.data()`. Since capy's buffer_slice captures its
underlying buffer sequence by value, the prvalue `sr.prepare()
.value()` is safe — the slice owns its own copy.
Coordinated with capy PR cppalliance/capy#262. Merge order:
this PR lands before cppalliance#262 (so http remains buildable against
capy's \`develop\` during the brief window).
0 commit comments