{"id":2156,"date":"2025-01-28T19:19:55","date_gmt":"2025-01-28T19:19:55","guid":{"rendered":"https:\/\/bhiggs.x10hosting.com\/PracticalCPlusPlusProgramming\/?page_id=2156"},"modified":"2025-01-28T21:33:04","modified_gmt":"2025-01-28T21:33:04","slug":"whats-the-problem","status":"publish","type":"page","link":"https:\/\/bhiggs.x10hosting.com\/PracticalCPlusPlusProgramming\/index.php\/topics\/c-details\/the-standard-template-library-2\/whats-the-problem\/","title":{"rendered":"What&#8217;s The Problem?"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Whats_the_Problem\"><\/span>What&#8217;s the Problem?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Every programming language needs a standard library of functionality to make it useful &#8212; perhaps more than one library (after all, it makes sense to break functionality up into understandable and easily accessible pieces). C++ is no exception, but it took a while before C++ received a library beyond what was a kind of implied library of functions from C.<\/p>\n\n\n\n<p>For example, we&#8217;ve seen many places in our earlier coverage where we&#8217;ve created our own classes for <strong>Vector<\/strong>, <strong>Queue<\/strong>, <strong>Stack<\/strong>, and others. But these are pretty standard data structures, and we shouldn&#8217;t have to implement our own versions.<\/p>\n\n\n\n<p>So, in the interests of software reuse, and correct and efficient implementation, the C++ Standard committee decided to include a set of pre-implemented versions.<\/p>\n\n\n\n<p>These classes, and more, are included in the <a href=\"https:\/\/en.cppreference.com\/w\/\" target=\"_blank\" rel=\"noreferrer noopener\"><em>Standard Template Library<\/em> (STL)<\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"History\"><\/span>History<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The original work on the STL was done by <em>Alexander Stepanov<\/em> and <em>Meng Lee <\/em>at Hewlett-Packard, with major contributions from <em>David Musser<\/em>, at the Rensselaer Polytechnic Institute.<\/p>\n\n\n\n<p>It was proposed to the C++ Standard committee in November, 1993, and is now part of the approved C++ standard.<\/p>\n\n\n\n<p>It implements a set of classes and algorithms that constitute an approach called <em>generic programming<\/em>.<\/p>\n\n\n\n<p>STL contains the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Containers<\/strong><\/li>\n\n\n\n<li><strong>Generic Algorithms<\/strong><\/li>\n\n\n\n<li><strong>Iterators<\/strong><\/li>\n\n\n\n<li><strong>Function Objects<\/strong><\/li>\n\n\n\n<li><strong>Adaptors<\/strong><\/li>\n\n\n\n<li><strong>Allocators<\/strong><\/li>\n<\/ul>\n\n\n\n<div style=\"height:47px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button has-custom-font-size has-medium-font-size\"><a class=\"wp-block-button__link has-palette-color-8-color has-text-color has-link-color wp-element-button\" href=\"https:\/\/bhiggs.x10hosting.com\/PracticalCPlusPlusProgramming\/index.php\/topics\/c-details\/the-standard-template-library-2\/containers\/\">Next: Containers<\/a><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>What&#8217;s the Problem? Every programming language needs a standard library of functionality to make it useful &#8212; perhaps more than one library (after all, it makes sense to break functionality up into understandable and easily accessible pieces). C++ is no exception, but it took a while before C++ received a library beyond what was a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":2150,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-2156","page","type-page","status-publish","hentry"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/bhiggs.x10hosting.com\/PracticalCPlusPlusProgramming\/index.php\/wp-json\/wp\/v2\/pages\/2156","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bhiggs.x10hosting.com\/PracticalCPlusPlusProgramming\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/bhiggs.x10hosting.com\/PracticalCPlusPlusProgramming\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/bhiggs.x10hosting.com\/PracticalCPlusPlusProgramming\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bhiggs.x10hosting.com\/PracticalCPlusPlusProgramming\/index.php\/wp-json\/wp\/v2\/comments?post=2156"}],"version-history":[{"count":5,"href":"https:\/\/bhiggs.x10hosting.com\/PracticalCPlusPlusProgramming\/index.php\/wp-json\/wp\/v2\/pages\/2156\/revisions"}],"predecessor-version":[{"id":2218,"href":"https:\/\/bhiggs.x10hosting.com\/PracticalCPlusPlusProgramming\/index.php\/wp-json\/wp\/v2\/pages\/2156\/revisions\/2218"}],"up":[{"embeddable":true,"href":"https:\/\/bhiggs.x10hosting.com\/PracticalCPlusPlusProgramming\/index.php\/wp-json\/wp\/v2\/pages\/2150"}],"wp:attachment":[{"href":"https:\/\/bhiggs.x10hosting.com\/PracticalCPlusPlusProgramming\/index.php\/wp-json\/wp\/v2\/media?parent=2156"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}