[clang-tools-extra] [clang-tidy]suggest use `std::span` as replacement of c array in C++20 for modernize-avoid-c-arrays (PR #108555)

Congcong Cai via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 13 07:17:46 PDT 2024


HerrCai0907 wrote:

> I'm not sure I understand this change. `std::span` is not a replacement for a C array, since it does not own memory. I don't understand also the change from suggesting to use `std::vector` instead of `std::array`

The C-Array in parameter also does not own memory. It is equivalent to pointer.

https://github.com/llvm/llvm-project/pull/108555


More information about the cfe-commits mailing list