C++ metastring library and its applications

Szugyi, Z [Szűgyi, Zalán (Informatika), szerző] Programozási Nyelvek és Fordítóprogramok Tanszék (ELTE / IK); Sinkovics, Á [Sinkovics, Ábel (Informatika), szerző] PhD Informatika Doktori Iskola (ELTE / IK); Pataki, N [Pataki, Norbert (Informatika), szerző] Programozási Nyelvek és Fordítóprogramok Tanszék (ELTE / IK); 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)
Megjelent: LECTURE NOTES IN COMPUTER SCIENCE 0302-9743 1611-3349 6491 LNCS pp. 461-480 2011
  • SJR Scopus - Computer Science (miscellaneous): Q2
    C++ template metaprogramming is an emerging direction of generative programming: with proper template definitions we can enforce the C++ compiler to execute algorithms at compilation time. Template metaprograms have become essential part of today's C++ programs of industrial size; they provide code adoptions, various optimizations, DSL embedding, etc. Besides the compilation time algorithms, template metaprogram data-structures are particularly important. From simple typelists to more advanced STL-like data types there are a variety of such constructs. Interesting enough, until recently string, as one of the most widely used data type of programming, has not been supported. Although, boost::mpl::string is an advance in this area, it still lacks the most fundamental string operations. In this paper, we analysed the possibilities of handling string objects at compilation time with a metastring library. We created a C++ template metaprogram library that provides the common string operations, like creating sub-strings, concatenation, replace, and similar. To provide real-life use-cases we implemented two applications on top of our Metastring library. One use case utilizes compilation time inspection of input in the domain of pattern matching algorithms, thus we are able to select the more optimal search method at compilation time. The other use-case implements safePrint, a type-safe version of printf - a widely investigated problem. We present both the performance improvements and extended functionality we have achieved in the applications of our Metastring library. © 2011 Springer-Verlag.
    Hivatkozás stílusok: IEEEACMAPAChicagoHarvardCSLMásolásNyomtatás
    2020-12-04 15:14