https://doi.org/10.71352/ac.36.341
Compile-time advances of the C++ Standard Template Library
Abstract.
The C++ Standard Template Library is the flagship example for libraries based on the generic programming paradigm.
The usage of this library is intended to minimize classical C/C++ errors, but does not warrant bug-free programs. Furthermore,
many new kinds of errors may arise from the inaccurate use of the generic programming paradigm, like dereferencing invalid iterators or
misunderstanding remove-like algorithms.
Every standard container offers a template parameter in order to customize the memory management. Allocator types are accountable for
allocation and deallocation of memory.
In this paper we present some scenarios that may cause undefined or weird behaviour at runtime. These scenarios are related to allocators
and reverse iterators. We emit warnings while these constructs are used without any modification in the compiler. We also present a general
approach to emit
“customized” warnings. We support the so-called believe-me marks in order to disable our
specific warnings.
