Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext

size

Overview
Reference

Authors

  • Glen Fernandes

The header <boost/core/size.hpp> provides function templates size to obtain the number of elements in a range.

namespace boost {

template<class C>
constexpr auto
size(const C& c) noexcept(noexcept(c.size())) -> decltype(c.size());

template<class T, std::size_t N>
constexpr std::size_t
size(T(&)[N]) noexcept;

} /* boost */

template<class C> constexpr auto size(const C& c) noexcept(noexcept(c.size())) -> decltype(c.size());

Returns c.size().

template<class T, std::size_t N> constexpr std::size_t size(T(&)[N]) noexcept;

Returns N.


PrevUpHomeNext