Skip to main content
Version: 1.4.0

Sizing

The predefined functions Set.size and Set.cardinal return the number of elements in a given set.

const my_set: set<int> = Set.literal(list([3, 2, 2, 1]));
const cardinal : nat = Set.size(my_set); // == 3

Note: See the predefined namespace Set