是什么/​​ *!* /在C#是什么意思? [英] What does /*!*/ mean in C#?

查看:252
本文介绍了是什么/​​ *!* /在C#是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新的C#和正在读代码 / *!* / 什么看似奇怪的地方。对于定义为实例类方法:

I'm new to C# and am reading code with /*!*/ in what seem like strange places. For instance class methods defined as:

protected override OptionsParser/*!*/ CreateOptionsParser()
protected override void ParseHostOptions(string/*!*/[]/*!*/ args)

不幸的是 / *!* / 不是googleable。这是什么意思?

Unfortunately /*!*/ is not googleable. What does it mean?

推荐答案

很可能试图获得规格#风格的标注成非规格#版本。该!注释在规格#意味着值不空。笔者很可能试图表明,无论是返回值,args数组和所有在args的元素总是非空值。

It's likely an attempt to get Spec# style annotations into a non-Spec# build. The ! annotation in Spec# means the value is not-null. The author is likely trying to indicate that both the return values, args array and all of the elements in args are always non-null values.

规格#链接:

  • http://research.microsoft.com/en-us/projects/specsharp/

快速规格#概述:

规格#是通过微软研究院项目创建.NET语言。它是一个试图嵌入代码合同入式系统中的C#语言的扩展。最突出的是非​​可空类型(类型名后!表示),检查异常和前置/后置条件。

Spec# is a .Net language created via a Microsoft Research Project. It is an extension of the C# language which attempts to embed code contracts into the type system. The most prominent are non-nullable types (indicated with ! after the type name), checked exceptions and pre/post conditions.

这篇关于是什么/​​ *!* /在C#是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆