2 ms·
Because the example is about an idiomatic way of enforcing exclusive pointer ownership. Maybe it wasn't a very good example though. A better example might be th
by nice_byte 11y ago
Because the example is about an idiomatic way of enforcing exclusive pointer ownership. Maybe it wasn't a very good example though. A better example might be this: in the Builder design pattern, an object is built from various "parts" by the client. It's obvious that the object should have an exclusive ownership of all of its parts. However, at the time of creation, each part belongs to whoever created it, so the ownership needs to be transferred.