Home   Manual   Type Index   Symbol Index   Topics Index

std::length_of

returns the number of items within a collection

Description

Many collections just store this value explicitely, making this a very cheap operation.

But there are collections which must traverse all its contents to compute the total number of stored items, making this a very expensive operation!

See also

std::is_empty   checks whether a collection contains any items

Implemented by

std_types::association_list  as  std_types::association_list/std::length_of
std_types::hash_table  as  std_types::hash_table/std::length_of
std_types::key_order_table  as  std_types::key_order_table/std::length_of
std_types::list  as  std_types::list/std::length_of
std_types::octet_string  as  std_types::octet_string/std::length_of
std_types::value_range  as  std_types::value_range/std::length_of

Topics

Strings
Lists
Collections