brintos

brintos / llvm-project-archived public Read only

0
0
Text · 638 B · 4b7d7f2 Raw
24 lines · plain
1.. title:: clang-tidy - readability-simplify-subscript-expr2 3readability-simplify-subscript-expr4===================================5 6This check simplifies subscript expressions. Currently this covers calling7``.data()`` and immediately doing an array subscript operation to obtain a8single element, in which case simply calling ``operator[]`` suffice.9 10Examples:11 12.. code-block:: c++13 14  std::string s = ...;15  char c = s.data()[i];  // char c = s[i];16 17Options18-------19 20.. option:: Types21 22   The list of type(s) that triggers this check. Default is23   `::std::basic_string;::std::basic_string_view;::std::vector;::std::array;::std::span`24