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 Constants
prevC++ Mapping for Sequences

Here is the definition of our EmployeeMap once more:

Wiki Markup
{zcode:slice}
dictionary<long, Employee> EmployeeMap;
{zcode}

The following code is generated for this definition:

Wiki Markup
{zcode:cpp}
typedef std::map<Ice::Long, Employee> EmployeeMap;
{zcode}

Again, there are no surprises here: a Slice dictionary simply maps to an STL map. As a result, you can use the dictionary like any other STL map, for example:

Wiki Markup
{zcode:cpp}
EmployeeMap em;
Employee e;

e.number = 42;
e.firstName = "Stan";
e.lastName = "Lippman";
em[e.number] = e;

e.number = 77;
e.firstName = "Herb";
e.lastName = "Sutter";
em[e.number] = e;
{zcode}

All the usual STL iterators and algorithms work with this map just as well as with any other STL container.

Ztop
See Also
Zret
Znav
nextC++ Mapping for Constants
prevC++ Mapping for Sequences