C++/CLI equivalent of C# checked keyword

好久不见. 提交于 2019-12-04 14:54:18
Hans Passant

The linked duplicate make no sense, C++/CLI follows C++ conventions. C++ has no built-in mechanism for detecting arithmetic overflow.

Using the checked and unchecked keywords was originally planned for future extensions of C++/CLI. Ecma-372 is the current language standard and proposes this extension in appendix F.2.1. This however never happened and is very unlikely to be ever implemented.

You'll thus have to implement overflow checking yourself. You'll find some guidance in this question.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!