Measuring the Overhead of C++ Standard Template Library Safe Variants

The C++ Standard Template Library is a widely-used library that is based on the generic programming paradigm. The usage of this library does not warrant bug-free programs. Furthermore, many new errors may arise from the inaccurate use of the generic programming paradigm, like dereferencing invalid iterators or misunderstanding remove-like algorithms. Most of the STL algorithms have preconditions which are checked neither at compilation time nor at runtime. Violation of such a precondition results in undefined behaviour. In this paper we propose solutions for a subset of these problems. The techniques we describe help programmers use generic algorithms on sorted intervals in a safer way. We present a new iterator adaptor type and tag as well as safe containers which keep track their [email protected]? validness. We measure the runtime overhead of these extensions.

[1]  Alexander K. Petrenko,et al.  Electronic Notes in Theoretical Computer Science , 2009 .

[2]  Douglas Gregor,et al.  STLlint: lifting static checking from languages to libraries , 2006 .

[3]  Mads Torgersen The expression problem revisited: Four new solutions using generics , 2004 .

[4]  Leor Zolman An STL message decryptor for visual C , 2001 .

[5]  Alexander A. Stepanov,et al.  Generic Programming , 1988, ISSAC.

[6]  Zoltán Porkoláb,et al.  Towards the Modularization of C++ Concept Maps , 2009, Electron. Notes Theor. Comput. Sci..

[7]  Yann-Gaël Guéhéneuc,et al.  Inconsistencies of Metrics in C + + Standard Template Library ? , 2007 .

[8]  Alexander A. Stepanov,et al.  Range partition adaptors: a mechanism for parallelizing STL , 1996, SIAP.

[9]  Christopher Baus,et al.  Custom Iterators for the STL , 2000 .

[10]  Jaakko Järvi,et al.  Algorithm specialization in generic programming: challenges of constrained generics in C++ , 2006, PLDI '06.

[11]  Michael Wong,et al.  Speeding up STL Set/Map Usage in C++ Applications , 2008, SIPEW.

[12]  Bjarne Stroustrup,et al.  C++ Programming Language , 1986, IEEE Softw..

[13]  Foutse Khomh,et al.  11th ECOOP Workshop on Quantitative Approaches in Object-Oriented Software Engineering , 2007 .

[14]  Mitsuhisa Sato,et al.  Parallel Array Class Implementation Using C++ STL Adaptors , 1997, ISCOPE.

[15]  István Forgács,et al.  A New Concept of Effective Regression Test Generation in a C++ Specific Environment , 2008, Acta Cybern..

[16]  Zoltán Porkoláb,et al.  Towards a General Template Introspection Library , 2004, GPCE.

[17]  Krzysztof Czarnecki,et al.  Generative programming - methods, tools and applications , 2000 .

[18]  Andrei Alexandrescu,et al.  Modern C++ Design , 2001 .

[19]  Bjarne Stroustrup,et al.  Concepts: linguistic support for generic programming in C++ , 2006, OOPSLA '06.

[20]  Scott Meyers,et al.  Effective STL: 50 Specific Ways to Improve Your Use of the Standard Template Library , 2001 .

[21]  Alan Bundy,et al.  Constructing Induction Rules for Deductive Synthesis Proofs , 2006, CLASE.

[22]  Thomas Becker STL & generic programming: writing your own iterators , 2001 .

[23]  Ralf Hinze,et al.  Generic programming in 3D , 2009, Sci. Comput. Program..

[24]  Matthew H. Austern Generic programming and the STL - using and extending the C++ standard template library , 1999, Addison-Wesley professional computing series.

[25]  Norbert Pataki,et al.  C++ Metastring Library and Its Applications , 2009, GTTSE.

[26]  Bjarne Stroustrup,et al.  Runtime concepts for the C++ standard template library , 2008, SAC '08.