...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Returns a type convertible to int
that evaluates the number of elements in the sequence.
template <typename Sequence>
typename result_of::size
<Sequence>::type
size(Sequence const& seq);
Parameter |
Requirement |
Description |
---|---|---|
|
Model of Forward Sequence |
The sequence we wish to investigate. |
size(seq);
Return type: Convertible to int
.
Semantics: Returns the number of elements in the sequence.
#include <boost/fusion/sequence/intrinsic/size.hpp> #include <boost/fusion/include/size.hpp>
vector
<int, int, int> v(1, 2, 3);
assert(size(v) == 3);