Skip to main content

Extending the C++ Standard Library and the STL

  • Chapter
  • First Online:
  • 4895 Accesses

Abstract

The C++ standard library and the STL provide a wide selection of functions, classes and generic containers that can be used in common programming situations. There are, however, times when just the right container or function for a particular programming task is missing from the standard library and the STL. In the first part of this chapter, we will extend the C++ standard library and the STL by developing a custom dynamic_array container that has a functionality that lies between those of std::array and std::vector. Furthermore, one often encounters a good C++ compiler that lacks large parts of the C++ standard library such as the STL, C99 compatibility, the time utilities in <chrono> or the thread support library. The second half of this chapter shows how to emulate partial standard library support with certain self-written parts of the C++ standard library and the STL.

This is a preview of subscription content, log in via an institution.

Notes

  1. 1.

    The general requirements for STL containers are specified in Paragraph 23.2.1 of [1] and listed in Tables 96 and 97 therein.

  2. 2.

    Consult Sect. 23.3.2 in  [1] for an overview of std::array and Sect. 23.3.6 for a summary of std::vector.

References

  1. ISO/IEC, ISO/IEC 14882:2011: Information technology—Programming languages—C++ (International Organization for Standardization, Geneva, 2011)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2013 Springer-Verlag Berlin Heidelberg

About this chapter

Cite this chapter

Kormanyos, C. (2013). Extending the C++ Standard Library and the STL. In: Real-Time C++. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-34688-0_16

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-34688-0_16

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-34687-3

  • Online ISBN: 978-3-642-34688-0

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics