register_static_meta


Description:

[ Version ( since = "1.18" ) ]
public bool register_static_meta (MetaFlag flags, string meta_item, Type type)

Registers a static metadata field on the container to only hold the specified type.

After calling this, setting a value under this field can only succeed if its type matches the registered type of the field.

Unlike register_meta, no (initial) value is set for this field, which means you can use this method to reserve the space to be _optionally_ set later.

Note that if a value has already been set for the field being registered, then its type must match the registering type, and its value will be left in place. If the field has no set value, then you will likely want to include WRITABLE in flags to allow the value to be set later.

Parameters:

this

A MetaContainer

flags

Flags to be used for the registered field

meta_item

The key for the this field to register

type

The required value type for the registered field

Returns:

true if the meta_item field was successfully registered on this to only hold type values, with the given flags.