Custom Operators

New operators are declared at a global level using the operator keyword, and are marked with the prefixinfix or postfix modifiers:

  1. prefix operator +++

The following example defines a new custom infix operator called +-, which belongs to the precedence group AdditionPrecedence:

  1. infix operator +-: AdditionPrecedence

 

posted @ 2018-09-17 11:34  zzfx  阅读(189)  评论(0编辑  收藏  举报