SimpleConcepts: A Lightweight Extension to C++ to Support Constraints on Generic Types

Published in Computer Science and Information Systems, 2014

Recommended citation: Reed Milewicz, Marjan Mernik, and Peter Pirkelbauer. Simpleconcepts: A lightweight extension to c++ to support constraints on generic types. Computer Science and Information Systems, 11(4):1361–1379, 2014 http://rmmilewi.github.io/files/comsis14.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.

This is an extended journal version of the paper presented FedCSIS in 2013.

Download paper here

Recommended citation: Reed Milewicz, Marjan Mernik, and Peter Pirkelbauer. Simpleconcepts: A lightweight extension to c++ to support constraints on generic types. Computer Science and Information Systems, 11(4):1361–1379, 2014.