C Container Collection (CCC)
Loading...
Searching...
No Matches
ccc_ucount Struct Reference

A type for returning an unsigned integer from a container for counting. Intended to count sizes, capacities, and 0-based indices. More...

#include <types.h>

Data Fields

ccc_result error
 
size_t count
 

Detailed Description

A type for returning an unsigned integer from a container for counting. Intended to count sizes, capacities, and 0-based indices.

Access the fields of this struct directly to check for errors and then use the returned index. If an error has occurred, the index is invalid. An error will be indicated by any non-zero value in the error field.

if (!res.error)
{
(void)ccc_bs_set(&my_bitset, res.count, CCC_TRUE);
}
else
{
// handle errors...
}
ccc_ucount ccc_bs_first_trailing_one(ccc_bitset const *bs)
Return the index of the first trailing bit set to 1 in the set.
ccc_tribool ccc_bs_set(ccc_bitset *bs, size_t i, ccc_tribool b)
Set the bit at valid index i to value b (true or false).
A type for returning an unsigned integer from a container for counting. Intended to count sizes,...
Definition: types.h:172
size_t count
Definition: types.h:176
ccc_result error
Definition: types.h:174
@ CCC_TRUE
Definition: types.h:108

Full string explanations of the exact ccc_result error types can be provided via the ccc_result_msg function if the enum itself does not provide sufficient explanation.

Field Documentation

◆ count

size_t ccc_ucount::count

The count returned by the operation.

◆ error

ccc_result ccc_ucount::error

The error that occurred indicated by a status. 0 (falsey) means OK.


The documentation for this struct was generated from the following file: