Simpleconcepts: Support for Constraints on Generic Types in C++
Published in FedCSIS, 2013
Recommended citation: Reed Milewicz, Marjan Mernik, and Peter Pirkelbauer. SimpleConcepts: Support for constraints on generic types in C++. In Maria Ganzha, Leszek A. Maciaszek, and Marcin Paprzycki, editors, Proceedings of the 2013 Federated Conference on Computer Science and Information Systems, pages 1535–1540, 2013. http://rmmilewi.github.io/files/simpleconcepts13.pdf
Generic programming plays an essential role in C++ software through the use of templates. However, both the creation and use of template libraries is hindered by the fact that the language does not allow programmers to specify constraints on generic types. To date, no proposal to update the language to provide concepts has survived the committee process. Until that time comes, as a form of early support, this paper introduces SimpleConcepts, an extension to C++11 that provides support for concepts, sets of constraints on generic types. SimpleConcepts features are parsed according to an island grammar and source-to-source translation is used to lower concepts to pure C++11 code.
Recommended citation: Reed Milewicz, Marjan Mernik, and Peter Pirkelbauer. SimpleConcepts: Support for constraints on generic types in C++. In Maria Ganzha, Leszek A. Maciaszek, and Marcin Paprzycki, editors, Proceedings of the 2013 Federated Conference on Computer Science and Information Systems, pages 1535–1540, 2013.