We should avoid storing the underlying data as const in constant owning data buffers. While using const ensures read-only access via C++'s constness guarantees, it also results in unnecessary data copying when attempting to extract the data. Moreover, this approach prevents storing move-only types altogether.
We should avoid storing the underlying data as const in constant owning data buffers. While using const ensures read-only access via C++'s constness guarantees, it also results in unnecessary data copying when attempting to extract the data. Moreover, this approach prevents storing move-only types altogether.