Using Static Analysis to Extract C++0x Concepts

Lin CHEN,Bao-Wen XU
DOI: https://doi.org/10.3724/SP.J.1016.2009.01792
2009-01-01
Jisuanji Xuebao/Chinese Journal of Computers
Abstract:Using Concepts to abstract domain knowledge is the basis for generic programming. Concept will be a new language feature in C++0x, which provides solid base for developing reusable and extendable generic software. To make better use of new generic programming features of C++0x, it is necessary to identify Concepts in legacy C++ programs, and refactor them to C++0x programs. This paper presents an automatic method to identify Concepts with static analysis, analyzes the usages of type parameters in legacy programs to extract valid expression constraints and associate type constraints. Concepts can be inferred by these constraints. The approach is applied to the C++ Standard Template Library to identify most of the potential Concepts in STL. The study convinces that this method is helpful to identify Concepts in legacy C++ programs.
What problem does this paper attempt to address?