3 <meta http-equiv=
"Content-Type" content=
"text/html; charset=US-ASCII">
5 <link rel=
"stylesheet" href=
"../../../../../../doc/src/boostbook.css" type=
"text/css">
6 <meta name=
"generator" content=
"DocBook XSL Stylesheets V1.74.0">
7 <link rel=
"home" href=
"../../index.html" title=
"Chapter 1. Boost.Icl">
8 <link rel=
"up" href=
"../function_reference.html" title=
"Function Reference">
9 <link rel=
"prev" href=
"equivalences_and_orderings.html" title=
"Equivalences and Orderings">
10 <link rel=
"next" href=
"range.html" title=
"Range">
12 <body bgcolor=
"white" text=
"black" link=
"#0000FF" vlink=
"#840084" alink=
"#0000FF">
13 <table cellpadding=
"2" width=
"100%"><tr>
14 <td valign=
"top"><img alt=
"Boost C++ Libraries" width=
"277" height=
"86" src=
"../../../../../../boost.png"></td>
15 <td align=
"center"><a href=
"../../../../../../index.html">Home
</a></td>
16 <td align=
"center"><a href=
"../../../../../libraries.htm">Libraries
</a></td>
17 <td align=
"center"><a href=
"http://www.boost.org/users/people.html">People
</a></td>
18 <td align=
"center"><a href=
"http://www.boost.org/users/faq.html">FAQ
</a></td>
19 <td align=
"center"><a href=
"../../../../../../more/index.htm">More
</a></td>
22 <div class=
"spirit-nav">
23 <a accesskey=
"p" href=
"equivalences_and_orderings.html"><img src=
"../../../../../../doc/src/images/prev.png" alt=
"Prev"></a><a accesskey=
"u" href=
"../function_reference.html"><img src=
"../../../../../../doc/src/images/up.png" alt=
"Up"></a><a accesskey=
"h" href=
"../../index.html"><img src=
"../../../../../../doc/src/images/home.png" alt=
"Home"></a><a accesskey=
"n" href=
"range.html"><img src=
"../../../../../../doc/src/images/next.png" alt=
"Next"></a>
25 <div class=
"section boost_icl_function_reference_size" lang=
"en">
26 <div class=
"titlepage"><div><div><h3 class=
"title">
27 <a name=
"boost_icl.function_reference.size"></a><a class=
"link" href=
"size.html" title=
"Size">Size
</a>
28 </h3></div></div></div>
29 <div class=
"informaltable"><table class=
"table">
41 <span class=
"emphasis"><em><span class=
"bold"><strong>Size
</strong></span></em></span>
74 <code class=
"computeroutput"><span class=
"identifier">size_type
</span> <span class=
"identifier">T
</span><span class=
"special">::
</span><span class=
"identifier">size
</span><span class=
"special">()
</span><span class=
"keyword">const
</span></code><br>
75 <code class=
"computeroutput"><span class=
"identifier">size_type
</span> <span class=
"identifier">size
</span><span class=
"special">(
</span><span class=
"keyword">const
</span> <span class=
"identifier">T
</span><span class=
"special">&)
</span></code>
80 <span class=
"emphasis"><em>O(
1)
</em></span>
85 <span class=
"emphasis"><em>O(n)
</em></span>
90 <span class=
"emphasis"><em>O(n)
</em></span>
95 <span class=
"emphasis"><em>O(
1)
</em></span>
100 <span class=
"emphasis"><em>O(
1)
</em></span>
107 <code class=
"computeroutput"><span class=
"identifier">size_type
</span> <span class=
"identifier">cardinality
</span><span class=
"special">(
</span><span class=
"keyword">const
</span> <span class=
"identifier">T
</span><span class=
"special">&)
</span></code>
112 <span class=
"emphasis"><em>O(
1)
</em></span>
117 <span class=
"emphasis"><em>O(n)
</em></span>
122 <span class=
"emphasis"><em>O(n)
</em></span>
127 <span class=
"emphasis"><em>O(
1)
</em></span>
132 <span class=
"emphasis"><em>O(
1)
</em></span>
139 <code class=
"computeroutput"><span class=
"identifier">difference_type
</span> <span class=
"identifier">length
</span><span class=
"special">(
</span><span class=
"keyword">const
</span> <span class=
"identifier">T
</span><span class=
"special">&)
</span></code>
144 <span class=
"emphasis"><em>O(
1)
</em></span>
149 <span class=
"emphasis"><em>O(n)
</em></span>
154 <span class=
"emphasis"><em>O(n)
</em></span>
169 <code class=
"computeroutput"><span class=
"identifier">size_type
</span> <span class=
"identifier">iterative_size
</span><span class=
"special">(
</span><span class=
"keyword">const
</span> <span class=
"identifier">T
</span><span class=
"special">&)
</span></code>
178 <span class=
"emphasis"><em>O(
1)
</em></span>
183 <span class=
"emphasis"><em>O(
1)
</em></span>
188 <span class=
"emphasis"><em>O(
1)
</em></span>
193 <span class=
"emphasis"><em>O(
1)
</em></span>
200 <code class=
"computeroutput"><span class=
"identifier">size_type
</span> <span class=
"identifier">interval_count
</span><span class=
"special">(
</span><span class=
"keyword">const
</span> <span class=
"identifier">T
</span><span class=
"special">&)
</span></code>
209 <span class=
"emphasis"><em>O(
1)
</em></span>
214 <span class=
"emphasis"><em>O(
1)
</em></span>
229 For
<span class=
"bold"><strong>icl
</strong></span> containers the single
<code class=
"computeroutput"><span class=
"identifier">size
</span></code> function known from std containers
230 branches into tree to five different members functions. The table above shows
231 the types,
<code class=
"computeroutput"><span class=
"identifier">size
</span></code> functions
232 are implemented for, together with their
<span class=
"bold"><strong>complexities
</strong></span>.
233 Linear complexities
<span class=
"emphasis"><em>O(n)
</em></span> refer to the container's
<code class=
"computeroutput"><span class=
"identifier">iterative_size
</span></code>:
235 <pre class=
"programlisting"><span class=
"identifier">n
</span> <span class=
"special">=
</span> <span class=
"identifier">y
</span><span class=
"special">.
</span><span class=
"identifier">iterative_size
</span><span class=
"special">()
</span>
240 The next table gives a short definition for the different size functions.
242 <div class=
"informaltable"><table class=
"table">
251 <span class=
"emphasis"><em><span class=
"bold"><strong>Size
</strong></span></em></span>
269 <code class=
"computeroutput"><span class=
"identifier">size_type
</span> <span class=
"identifier">interval_count
</span><span class=
"special">(
</span><span class=
"keyword">const
</span> <span class=
"identifier">T
</span><span class=
"special">&)
</span></code>
274 <a class=
"link" href=
"../interface/function_synopsis.html#interval_set_types"><span class=
"bold"><strong>S
</strong></span></a>
275 <a class=
"link" href=
"../interface/function_synopsis.html#interval_map_types"><span class=
"bold"><strong>M
</strong></span></a>
280 The number of intervals of an interval container.
287 <code class=
"computeroutput"><span class=
"identifier">size_type
</span> <span class=
"identifier">iterative_size
</span><span class=
"special">(
</span><span class=
"keyword">const
</span> <span class=
"identifier">T
</span><span class=
"special">&)
</span></code>
292 <a class=
"link" href=
"../interface/function_synopsis.html#interval_set_types"><span class=
"bold"><strong>S
</strong></span></a>
293 <a class=
"link" href=
"../interface/function_synopsis.html#interval_map_types"><span class=
"bold"><strong>M
</strong></span></a>
294 <a class=
"link" href=
"../interface/function_synopsis.html#itl_set_type"><span class=
"bold"><strong>s
</strong></span></a>
295 <a class=
"link" href=
"../interface/function_synopsis.html#itl_map_type"><span class=
"bold"><strong>m
</strong></span></a>
300 The number of objects in an icl container that can be iterated over.
307 <code class=
"computeroutput"><span class=
"identifier">difference_type
</span> <span class=
"identifier">length
</span><span class=
"special">(
</span><span class=
"keyword">const
</span> <span class=
"identifier">T
</span><span class=
"special">&)
</span></code>
312 <a class=
"link" href=
"../interface/function_synopsis.html#interval_type"><span class=
"bold"><strong>i
</strong></span></a>
313 <a class=
"link" href=
"../interface/function_synopsis.html#interval_set_types"><span class=
"bold"><strong>S
</strong></span></a>
314 <a class=
"link" href=
"../interface/function_synopsis.html#interval_map_types"><span class=
"bold"><strong>M
</strong></span></a>
319 The length of an interval or the sum of lengths of an interval container's
320 intervals, that's
<code class=
"computeroutput"><span class=
"identifier">domain_type
</span></code>
321 has a
<code class=
"computeroutput"><span class=
"identifier">difference_type
</span></code>.
328 <code class=
"computeroutput"><span class=
"identifier">size_type
</span> <span class=
"identifier">cardinality
</span><span class=
"special">(
</span><span class=
"keyword">const
</span> <span class=
"identifier">T
</span><span class=
"special">&)
</span></code>
333 <a class=
"link" href=
"../interface/function_synopsis.html#interval_type"><span class=
"bold"><strong>i
</strong></span></a>
334 <a class=
"link" href=
"../interface/function_synopsis.html#interval_set_types"><span class=
"bold"><strong>S
</strong></span></a>
335 <a class=
"link" href=
"../interface/function_synopsis.html#interval_map_types"><span class=
"bold"><strong>M
</strong></span></a>
336 <a class=
"link" href=
"../interface/function_synopsis.html#itl_set_type"><span class=
"bold"><strong>s
</strong></span></a>
337 <a class=
"link" href=
"../interface/function_synopsis.html#itl_map_type"><span class=
"bold"><strong>m
</strong></span></a>
342 The number of elements of an interval or a container. For continuous
343 data types cardinality can be
<span class=
"emphasis"><em>infinite
</em></span>.
350 <code class=
"computeroutput"><span class=
"identifier">size_type
</span> <span class=
"identifier">T
</span><span class=
"special">::
</span><span class=
"identifier">size
</span><span class=
"special">()
</span><span class=
"keyword">const
</span></code><br>
351 <code class=
"computeroutput"><span class=
"identifier">size_type
</span> <span class=
"identifier">size
</span><span class=
"special">(
</span><span class=
"keyword">const
</span> <span class=
"identifier">T
</span><span class=
"special">&)
</span></code>
356 <a class=
"link" href=
"../interface/function_synopsis.html#interval_type"><span class=
"bold"><strong>i
</strong></span></a>
357 <a class=
"link" href=
"../interface/function_synopsis.html#interval_set_types"><span class=
"bold"><strong>S
</strong></span></a>
358 <a class=
"link" href=
"../interface/function_synopsis.html#interval_map_types"><span class=
"bold"><strong>M
</strong></span></a>
359 <a class=
"link" href=
"../interface/function_synopsis.html#itl_set_type"><span class=
"bold"><strong>s
</strong></span></a>
360 <a class=
"link" href=
"../interface/function_synopsis.html#itl_map_type"><span class=
"bold"><strong>m
</strong></span></a>
365 The number of elements of an interval or a container, which is also
366 it's
<code class=
"computeroutput"><span class=
"identifier">cardinality
</span></code>.
373 <span class=
"emphasis"><em><span class=
"bold"><strong>Back to section . . .
</strong></span></em></span>
375 <div class=
"informaltable"><table class=
"table">
376 <colgroup><col></colgroup>
377 <thead><tr></tr></thead>
381 <a class=
"link" href=
"../interface/function_synopsis.html#function_synopsis_table"><span class=
"emphasis"><em><span class=
"bold"><strong>Function
382 Synopsis
</strong></span></em></span></a>
387 <a class=
"link" href=
"../interface.html" title=
"Interface"><span class=
"emphasis"><em><span class=
"bold"><strong>Interface
</strong></span></em></span></a>
393 <table xmlns:
rev=
"http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width=
"100%"><tr>
394 <td align=
"left"></td>
395 <td align=
"right"><div class=
"copyright-footer">Copyright
© 2007 -
2010 Joachim Faulhaber
<br>Copyright
© 1999 -
2006 Cortex Software GmbH
<p>
396 Distributed under the Boost Software License, Version
1.0. (See accompanying
397 file LICENSE_1_0.txt or copy at
<a href=
"http://www.boost.org/LICENSE_1_0.txt" target=
"_top">http://www.boost.org/LICENSE_1_0.txt
</a>)
402 <div class=
"spirit-nav">
403 <a accesskey=
"p" href=
"equivalences_and_orderings.html"><img src=
"../../../../../../doc/src/images/prev.png" alt=
"Prev"></a><a accesskey=
"u" href=
"../function_reference.html"><img src=
"../../../../../../doc/src/images/up.png" alt=
"Up"></a><a accesskey=
"h" href=
"../../index.html"><img src=
"../../../../../../doc/src/images/home.png" alt=
"Home"></a><a accesskey=
"n" href=
"range.html"><img src=
"../../../../../../doc/src/images/next.png" alt=
"Next"></a>