Giter Club home page Giter Club logo

stl's Introduction

STL Container and Container Adaptor Classes:

The term first-class container, when applied to a container type, simply means that the container class has all the characteristics and behaviors that a user would expect of any data type, given the user's previous experience (with built-in data types, for example). The first-class containers include the vector, deque, list, map, multimap, set, and multiset classes.

The term container adaptor, on the other hand refers to an "adaptation" of one of the first-class containers by modifying and restricting its interface for some special purpose. These container adaptors include the stack and queue, which are based (by default) on the deque, as well as the priority_queue, which is based (by default) on the vector.

There are some other classes that are regarded as near-containers, in that (for example) they can be used with iterators, which makes them accessible to manipulation via the STL algorithms.

string

Not to be confused with the legacy C-string data type, inherited from the C-language, and consisting of a simple character array with the characters of interest terminated with a null character. The C++ string class is indeed a bona fide class, with much more flexibility (and safety) than the older C-string, and should probably be used anywhere the C-string is not explicitly required.

bitset

Provides a model for a fixed-size array of bits or boolean values, which is used to manage a set of "on-off switches" (or "flags") and where the state of a bitset object at any time will represent some combination of such flags (or on-off switches).

valarray

Provides a representation for the mathematical concept of a linear sequence of values and is designed to permit the efficient performance of certain numerical calculations. That having been said, some writers argue that the valarray class is poorly designed and that there are better alternatives if you wish to do serious numerical calculations in C++. Note that for many purposes even "ordinary" C-style arrays (which are not classes) and C-strings (which are also not classes) can be accessed from the STL with C-style pointers in the same way that STL containers are accessed with STL iterators.

stl's People

Contributors

0sonali avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.