22 lines · plain
1.. title:: clang-tidy - readability-container-data-pointer2 3readability-container-data-pointer4==================================5 6Finds cases where code could use ``data()`` rather than the address of the7element at index 0 in a container. This pattern is commonly used to materialize8a pointer to the backing data of a container. ``std::vector`` and9``std::string`` provide a ``data()`` accessor to retrieve the data pointer10which should be preferred.11 12This also ensures that in the case that the container is empty, the data13pointer access does not perform an errant memory access.14 15Options16-------17 18.. option:: IgnoredContainers19 20 Semicolon-separated list of containers regexp for which this check won't be21 enforced. Default is an empty string.22