Difference between revisions of "Template:cpp/container/empty"
From cppreference.com
m (Update links.) |
(don't use ddcl) |
||
Line 1: | Line 1: | ||
{{cpp/container/{{{1|}}}/title | empty}} | {{cpp/container/{{{1|}}}/title | empty}} | ||
{{cpp/container/{{{1|}}}/navbar}} | {{cpp/container/{{{1|}}}/navbar}} | ||
− | {{ | + | {{dcl begin}} |
+ | {{dcl | since={{cpp/std|{{{1|}}}}} | | ||
{{#ifeq:{{{1|}}}|array|constexpr bool empty() const;|bool empty() const;}} | {{#ifeq:{{{1|}}}|array|constexpr bool empty() const;|bool empty() const;}} | ||
}} | }} | ||
+ | {{dcl end}} | ||
+ | |||
Checks if the container has no elements, i.e. whether {{c|begin() {{==}} end()}}. | Checks if the container has no elements, i.e. whether {{c|begin() {{==}} end()}}. | ||
Revision as of 04:00, 25 June 2013
bool empty() const; |
(since {std}) | |
Checks if the container has no elements, i.e. whether begin() == end().
Contents |
Parameters
(none)
Return value
true if the container is empty, false otherwise
Exceptions
noexcept specification:
noexcept
Complexity
Constant
Example
Templated content. The link is cpp/container/<PP>/example_empty |
See also
returns the number of elements (public member function of std::{{{1}}} )
|