Skip to content

Modern Set Capacity

Paul Squires edited this page Oct 19, 2026 · 5 revisions

Home › Set › Set › Capacity

Capacity

Returns the number of slots in the table, always a power of two.

Syntax

Capacity( ) as int32

Examples

#import "std/containers"
using containers

dim seen as Set( of integer )
print seen.Capacity          '' 0 -- nothing allocated yet

dim as integer x = 1
seen.Add( x )
print seen.Capacity          '' 8 -- the minimum

'' Power-of-two capacity, doubling at a load factor of 0.75

Library: Set
Category: Set
Documented under: Members

Clone this wiki locally