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

Click here to view the latest version of this page.
PrevUpHomeNext
empty
Description

Returns a type convertible to bool that evaluates to true if the sequence is empty, else, evaluates to false.

Synopsis
template <typename Sequence>
typename result_of::empty<Sequence>::type
empty(Sequence const& seq);
Parameters

Parameter

Requirement

Description

seq

Model of Forward Sequence

The sequence we wish to investigate.

Expression Semantics
empty(seq);

Return type: Convertible to bool.

Semantics: Evaluates to true if the sequence is empty, else, evaluates to false.

Header
#include <boost/fusion/sequence/intrinsic/empty.hpp>
#include <boost/fusion/include/empty.hpp>
Example
vector<int, int, int> v(1, 2, 3);
assert(empty(v) == false);

PrevUpHomeNext