Return the number of 1 bits in the optionally specified range.
Synopsis
Declared in <bdlc_bitarray.h>
std::size_t
num1(
std::size_t begin = 0,
std::size_t end = k_INVALID_INDEX) const;
Description
Return the number of bits in the range optionally specified by begin and end having a value of 1. The range is [begin .. effectiveEnd)], where effectiveEnd == length() if end is not specified and effectiveEnd == end otherwise. The behavior is undefined unless begin <= effectiveEnd <= length().
Return Value
number of 1 bits in the range
Parameters
Name |
Description |
begin |
start of the counted range (inclusive) |
end |
end of the counted range (exclusive); length if omitted |
Created with MrDocs