1.. title:: clang-tidy - cppcoreguidelines-pro-bounds-pointer-arithmetic
2
3cppcoreguidelines-pro-bounds-pointer-arithmetic
4===============================================
5
6This check flags all usage of pointer arithmetic, because it could lead to an
7invalid pointer. Subtraction of two pointers is not flagged by this check.
8
9Pointers should only refer to single objects, and pointer arithmetic is fragile
10and easy to get wrong. ``span<T>`` is a bounds-checked, safe type for accessing
11arrays of data.
12
13This rule is part of the `Bounds safety (Bounds 1)
14<https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Pro-bounds-arithmetic>`_
15profile from the C++ Core Guidelines.
16