-
- Downloads
Get rid of toVector()
Using the wrapper generated by `asVector()` we can get rid of `toVector()`. The important difference is, that `toVector()` invokes undefined behaviour by dereferencing the result of an aliasing `reinterpret_cast`. However, there's no noteable properties of the new implementation: * You can't use `asVector()` directly in calls to `mv()` and friends, because the latter is not robust wrt. to proxy references. * When creating copies of values, you can't replace `auto rhs = v[i];` by `auto rhs = Impl::asVector(v[i])` because proxy references don't use deep copy on purpose. Instead we have to use the two step `auto rhsValue = v[i]; auto&& rhs = Impl::asVector(rhsValue);`
Loading
Please register or sign in to comment