Revision as of 20:42, 17 April 2010 editIvansorokin (talk | contribs)50 edits First version | Latest revision as of 11:58, 17 October 2021 edit undoChristian75 (talk | contribs)Extended confirmed users, New page reviewers, Pending changes reviewers, Rollbackers114,301 edits {{R with history}} | ||
(60 intermediate revisions by 12 users not shown) | |||
Line 1: | Line 1: | ||
#REDIRECT ] | |||
A array is wrapper class that provide STL-like interface to standard fixed-size C-arrays. It also overcome several limitations of standard array. | |||
{{R to section}} | |||
== Creation History == | |||
{{R with history}} | |||
In his book, ''Generic Programming and the STL'', Matthew H. Austern introduces a wrapper class for ordinary arrays with static size, called <tt>block</tt>. It is safer and has no worse performance than ordinary arrays. In ''The C++ Programming Language, 3rd edition'', ] introduces a similar class, called <tt>c_array</tt>, which Nicolai Josuttis present slightly modified in his book ''The C++ Standard Library - A Tutorial and Reference'', called <tt>carray</tt>. | |||
Nicolai Josuttis introduced it under the name <tt>array</tt> in ] libraries. Later this class was introduced in C++ standard library in ]. | |||
== Motivation == | |||
Standard C arrays has several principal limitation: | |||
* They aren't ]s. They can not be copied like any others objects. | |||
* They do not obey standard <tt>operator &</tt> semantics. | |||
And several minor drawbacks: | |||
* They do not provide STL-like interface. | |||
* They do not made bound-checks even in debug builds. | |||
* They have weird syntax. | |||
The second item means that in the following code | |||
<source lang="cpp"> | |||
int a; | |||
int * b1 = a; | |||
int * b2 = &a; | |||
</source> | |||
<tt>b1</tt> and <tt>b2</tt> receives the same value. That is impossible for object of any others standard types. | |||
== Links == | |||
* | |||
* |
Latest revision as of 11:58, 17 October 2021
Redirect to:
- To a section: This is a redirect from a topic that does not have its own page to a section of a page on the subject. For redirects to embedded anchors on a page, use {{R to anchor}} instead.
- With history: This is a redirect from a page containing substantive page history. This page is kept as a redirect to preserve its former content and attributions. Please do not remove the tag that generates this text (unless the need to recreate content on this page has been demonstrated), nor delete this page.
- This template should not be used for redirects having some edit history but no meaningful content in their previous versions, nor for redirects created as a result of a page merge (use {{R from merge}} instead), nor for redirects from a title that forms a historic part of Misplaced Pages (use {{R with old history}} instead).