<code>size</code> returns the number of elements in the sequence, that is, the number of elements in the range <code>[begin<Sequence>::type,end<Sequence>::type)</code>.
<tr><td><code>typedef size<Sequence>::type s;</code></td><td>A model of <ahref="../Integral_Constant.html">Integral Constant</a></td><td></td><td>Equivalent to <code>typedef distance< begin<Sequence>::type,end<Sequence>::type >::type s;</code></td><td><code>s::value >= 0</code></td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
The complexity of the <code>size</code> algorithm directly depends on the implementation of the particular sequence it is applied to. In the worst case <code>size</code> has a linear complexity. As a general rule, if the <code>Sequence</code> is a <ahref="../Random_Access_Sequence.html">Random Access Sequence</a>, you can be certain that <code>size<Sequence>::type</code> is an amortized constant time operation. The opposite is not necessary true - for example, a model of <ahref="../Forward_Sequence.html">Forward Sequence</a> still can guarantee you an amortized constant time <code>size</code> complexity. Please refer the documentation page of the concrete sequence type for further information.