Cow< T > — the typed bonded copy-on-write access handle (RFC_BONDED_COW_HANDLE §12), top of sceon's CowPtr -> AtomicCow -> Cow< T > hierarchy. A transient cursor over a bonded T that behaves as close to Pointer<T> as copy-on-write allows:
- operator-> ALWAYS shares (returns Pointer<const T>): cow->ConstMethod() is pointer-identical and zero-copy; cow->NonConstMethod() is a compile error that names the fix.
- Extraction shares or detaches by the target's const-ness: a const Pointer target (Pointer<const X> p = As<const X>()) shares; a mutable Pointer target (Pointer<X> p = As<X>()) copy-on-write detaches a private, uniquely-owned T to mutate.
- Reads are implicit (operator-> / const Pointer extraction, above); mutation is the one explicit move: cow.Moo()->Mutate() detaches (Moo == Make Owned Object; the cow says Moo when you make it yours). There is deliberately no public read verb – reads already have two zero-ceremony spellings, so the only spelled-out verb is the deliberate one (Moo).
- Per-method dispatch when one handle interleaves reads and writes: cow(&T::m, args) (const m shares, non-const m detaches).
The read/write intent rides the const-ness of the As<>() REQUEST (As<const X> -> const Cow, shares everywhere; As<X> -> Cow) — see atom_detail::CowHandleType in Atom.h. The worst outcome is a compile error; a non-const method can never silently bleed.
TODO (C++26): let bare cow->NonConstMethod() copy-on-write per-method instead of erroring. It cannot be done in C++<=20 — operator-> must commit to Pointer<const T> vs Pointer<T> BEFORE the method is named, so it can't see the callee's const-ness (the exec_around execute-around proxy makes this concrete: its bracket is method-agnostic). The clean fix is static reflection (P2996) + token injection (P3294): reflect T's member functions, read each one's const-qualification, and inject a forwarder per method into a generated CowProxy< T > (const -> View, non-const -> Moo). Gate under BIO_CPP_VERSION >= 26 ON TOP of this surface; callers don't change. (Do NOT reach for macro/codegen registries: a missed or mis-tagged annotation is a SILENT bleed, strictly worse than today's compile error.)
- Template Parameters
-
| T | a non-pointer, non-reference bonded Wave-implementation type. |