max_load_factor: Get or set the maximum load factor

max_load_factorR Documentation

Get or set the maximum load factor

Description

Get or set the maximum load factor by reference, i.e. the number of elements per bucket.

Usage

max_load_factor(x, max_load = NULL)

Arguments

x

A CppUnorderedSet, CppUnorderedMultiset, CppUnorderedMap, or CppUnorderedMultimap object.

max_load

The containers maximum load factor. If NULL, the function returns the container's current maximum load factor. Passing a number sets the maximum load factor to that value.

Value

Returns a numeric, if max_load is NULL. Invisibly returns NULL, if max_load is numeric.

See Also

bucket_count, load_factor, max_bucket_count.

Examples

s <- cpp_unordered_set(4:6)
max_load_factor(s)
# [1] 1

max_load_factor(s, 3)
max_load_factor(s)
# [1] 3


cppcontainers documentation built on Sept. 9, 2025, 5:55 p.m.