Hi Stefan,
Cap'n Proto's Readers and Builders both behave as pointers, not value types. They are copyable, but copying them doesn't copy the data, it just copies the pointer. Both actually point into the underlying message buffer, and calling methods on the Reader/Builder manipulates that underlying buffer.
To actually move data from one builder to another, you'd have to do something like:
// Copy primitive fields like this.
to.setFoo(from.getFoo());
to.setBar(from.getBar());
// Transfer ownership of pointer fields like this.
to.adoptBaz(from.disownBaz());
to.adoptQux(from.disownQux());
If you wanted to avoid manually specifying each field, you could write some code based on AnyStruct::Builder instead. Any struct builder type can be converted to AnyStruct::Builder, which then allows you to iterate over the raw data and pointers that make up the struct.
Note that mutating Cap'n Proto messages is awkward due to the memory allocation needs, namely that all objects need to be allocated adjacent in the message buffer, to allow zero-copy output. Because of this, Cap'n Proto is not an ideal format for an in-memory data structure that you need to modify over time. The "self-contained structures in C++" thread you linked to, also knows as "POCS" (plain-old-c-structs), is an idea I'd still like to implement at some point, providing a mutation-friendly (but non-zero-copy) in-memory representation corresponding to Cap'n Proto types. No work has been done on this yet, unfortunately.
-Kenton