kumi
v3.1.0
Exquisite Epidote
Loading...
Searching...
No Matches
◆
count()
template<product_type T>
constexpr std::size_t kumi::count
(
T &&
ts
)
inline
constexpr
noexcept
Counts the number of elements of t not equivalent to false.
Parameters
ts
Value to process
Returns
Number of elements not equivalent to
false
.
Example:
#include <kumi/kumi.hpp>
#include <iostream>
#include <type_traits>
int
main()
{
auto
t =
kumi::tuple
{1, 0, 2.,
nullptr
, 3.f,
false
,
'z'
};
std::cout << std::boolalpha <<
kumi::count
(t ) <<
"\n"
;
}
kumi::count
constexpr std::size_t count(T &&ts) noexcept
Counts the number of elements of t not equivalent to false.
Definition
predicates.hpp:138
kumi::tuple
Fixed-size collection of heterogeneous values.
Definition
tuple.hpp:37
kumi