1 research outputs found
A static analysis approach for modern iterator development
Programming languages evolve in the long term, new standards
are specified in which new constructs appear, old elements may become deprecated. Standard library of programming languages also changes time by
time.
The standard of the C++ programming language defines the elements of
the C++ Standard Template Library (STL) that provides containers, algorithms, and iterators. According to the STL’s generic programming approach,
these sets can be extended in a convenient way. The std::iterator class
template had been in the C++ since beginning and has been deprecated in
the C++17 standard. This class template’s purpose was to specify the traits
of an iterator. Typically, it was a base class of many standard and non-standard iterator class to provide the necessary traits. However, the usage
of iterator is straightforward and fits into the object-oriented programming
paradigm. Many non-standard containers offer custom iterators because of
the STL compatibility. Using this base class does not cause any weird effect,
therefore usage of iterator can be found in code legacy.
In this paper, we present a static analysis approach to assist the development of iterator classes in a modern way in which the iterator class template
is not taken advantage of. We utilize the Clang compiler infrastructure to
look for how the deprecated iterator classes can be found in legacy code and
present an approach how to modernize them