Towards a general template introspection library

Zólyomi, I; Porkoláb, Z [Porkoláb, Zoltán (Programozási nyel...), szerző] Programozási Nyelvek és Fordítóprogramok Tanszék (ELTE / IK)

Angol nyelvű Tudományos Szakcikk (Folyóiratcikk)
  • SJR Scopus - Computer Science (miscellaneous): Q2
To ensure the correctness of template based constructions in C++, constraints on template parameters are especially useful. Unlike other languages (Ada, Eiffel, etc.), C++ does not directly support checking requirements on template parameters (i.e., concept checking). However, many articles introduce ad hoc solutions based on special language features. In this paper we propose a structure for a general introspection library which supports easy expression and combination of basic orthogonal requirements, providing the possibility to avoid reimplementation of simple checks for every similar concept. Based on these building blocks, it is possible to express highly complex constraints on template parameters, contrary to languages having builtin support for a limited set of constraints only. Our library enables a checking method that takes the advantages of previous solutions, such as REQUIRE-like macros and static interfaces. Our implementation is non-intrusive, relies only on standard C++ language features and results no runtime over-head. © Springer-Verlag 2004.
Hivatkozás stílusok: IEEEACMAPAChicagoHarvardCSLMásolásNyomtatás
2021-05-16 05:22