Not quite. C++&#x27;s references are syntactic sugar on top of pointers: a Foo&amp; always needs a Foo to point to. But Swift&#x27;s inouts are implemented as a pair of closures: a getter and a setter, which need not just modify a Foo.<p>Consider the much-hated vector&lt;bool&gt;, implemented as a packed bit array. Since you can&#x27;t return a reference to a bit, operator[] must create a special wrapper class that holds a reference to the word and the bit offset, and then overload operator= and perform other tricks. It&#x27;s famously leaky and gross.<p>In Swift, we can implement this optimization much more cleanly. inout lifetimes are always scoped, and when the scope ends, the new value is written back to the object via its setter. Our `inout boolean` is not backed by a boolean at all: it&#x27;s backed by a getter and setter which can do arbitrary things, like mask and shift a word.