{"title":"A static analysis approach for modern iterator development","authors":"Dániel Kolozsvári, Norbert Pataki","doi":"10.33039/ami.2023.08.006","DOIUrl":null,"url":null,"abstract":". Programming languages evolve in the long term, new standards are specified in which new constructs appear, old elements may become dep-recated. 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.","PeriodicalId":43454,"journal":{"name":"Annales Mathematicae et Informaticae","volume":"1 1","pages":""},"PeriodicalIF":0.3000,"publicationDate":"2023-01-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Annales Mathematicae et Informaticae","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.33039/ami.2023.08.006","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q4","JCRName":"MATHEMATICS","Score":null,"Total":0}
引用次数: 0
Abstract
. Programming languages evolve in the long term, new standards are specified in which new constructs appear, old elements may become dep-recated. 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.