n_children


Description:

public size_t n_children ()

Determines the number of children in a container Variant instance.

This includes variants, maybes, arrays, tuples and dictionary entries. It is an error to call this function on any other type of Variant.

For variants, the return value is always 1. For values with maybe types, it is always zero or one. For arrays, it is the length of the array. For tuples it is the number of tuple items (which depends only on the type). For dictionary entries, it is always 2

This function is O(1).

Parameters:

this

a container Variant

Returns:

the number of children in the container