共用方式為


set::key_type

A type that describes an object stored as an element of a set in its capacity as sort key.

typedef Key key_type;

Remarks

key_type is a synonym for the template parameter Key.

For more information on Key, see the Remarks section of the set Class topic.

Note that both key_type and value_type are synonyms for the template parameter Key. Both types are provided for the set and multiset classes, where they are identical, for compatibility with the map and multimap classes, where they are distinct.

Example

See the example for value_type for an example of how to declare and use key_type.

Requirements

Header: <set>

Namespace: std

See Also

Reference

set Class

Standard Template Library