Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

Znav
nextC++ Mapping for Structures
prevC++ Mapping for Built-In Types

A Slice enumeration maps to the corresponding enumeration in C++. For example:

Wiki Markup
{zcode:slice}
enum Fruit { Apple, Pear, Orange };
{zcode}

Not surprisingly, the generated C++ definition is identical:

Wiki Markup
{zcode:cpp}
enum Fruit { Apple, Pear, Orange };
{zcode}

Suppose we modify the Slice definition to include a custom enumerator value:

Wiki Markup
{zcode:slice}
enum Fruit { Apple, Pear = 3, Orange };
{zcode}

The generated C++ definition now includes an explicit initializer for every enumerator:

Wiki Markup
{zcode:cpp}
enum Fruit { Apple = 0, Pear = 3, Orange = 4 };
{zcode}

Ztop

See Also

Zret
Znav
nextC++ Mapping for Structures
prevC++ Mapping for Built-In Types