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
nextUsing the Slice Compilers
prevSerializable Objects

All Slice compilers support a metadata directive that allows you to deprecate a Slice definition. For example:

Wiki Markup
{zcode:slice}
interface Example {
    ["deprecated:someOperation() has been deprecated, use alternativeOperation() instead."]
    void someOperation();

    void alternativeOperation();
};
{zcode}

The ["deprecated"] metadata directive causes the compiler to emit code that generates a warning if you compile application code that uses a deprecated feature. This is useful if you want to remove a feature from a Slice definition but do not want to cause a hard error.

The message that follows the colon is optional; if you omit the message and use ["deprecated"], the Slice compilers insert a default message into the generated code.

You can apply the ["deprecated"] metadata directive to Slice constructs other than operations (for example, a structure or sequence definition).

Ztop
See Also
Zret
Znav
nextUsing the Slice Compilers
prevSerializable Objects