mirror of
https://github.com/ETLCPP/etl.git
synced 2026-07-30 16:26:17 +08:00
The templated cross-size copy constructor and assignment operator were broken in two ways: - They accessed other.buffer / rhs.buffer, which is private in a different mem_cast instantiation, so the cross-size overloads failed to compile whenever they were actually instantiated. - They copied Size_ (the destination size) bytes from a source buffer that is only Other_Size bytes large, reading past the end of the source when the destination was larger. Use the public data() accessor and copy Other_Size bytes. The existing static_assert(Size >= Other_Size) guarantees the destination is big enough. Add test_mem_cast_copy_and_assign_from_smaller regression test. Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| etl | ||