Properties of C++ template metaprograms

Pataki, Norbert [Pataki, Norbert (Informatika), author] ELTE IK Department of Programming Languages And... (ELTE / ELU FoI / ICS); Kozsik, Tamás [Kozsik, Tamás (Formális módszerek), author] ELTE IK Department of Programming Languages And... (ELTE / ELU FoI / ICS); Porkoláb, Zoltán [Porkoláb, Zoltán (Programozási nyel...), author] ELTE IK Department of Programming Languages And... (ELTE / ELU FoI / ICS)

English Scientific Conference paper (Conference paper)
    Identifiers
    Summary: Verifying properties of programs is a common way to ensure the proper behaviour of those programs. Invariants, pre- and postconditions are program properties often used when proving correctness of programs. \par C++ Template MetaPrograms (TMPs) are special progams interpreted by the compiler. Metaprograms are widely used for the following purposes: executing algorithms in compile-time, optimizing runtime programs and emitting compilation errors and warnings to enforce certain semantic checks. \par In this paper we step to ``meta- meta-level'': we present a technique to make safer C++ TMPs with static asserts. We describe how to check invariants, pre- and postconditions of TMPs and enforce the compiler to refuse metaprograms if any of the specified program properties is dissatisfied. We present some examples where semantic errors in TMPs are revealed by our method.
    Citation styles: IEEEACMAPAChicagoHarvardCSLCopyPrint
    2021-06-22 01:20