以工厂函数取代构造函数 replace constructor with factory method
"查查词典"手机版
千万人都在用的超大词汇词典翻译APP
例句与用法
A link demand performed on a static class constructor does not protect the constructor because static constructors are called by the system , outside the application s code execution path 对静态类构造函数执行的链接要求不会保护该构造函数,因为静态构造函数是由系统调用的,它们并不包括在应用程序的代码执行路径中。
Consider initializing static fields inline rather than explicitly using static constructors because the clr can optimize the performance of types that do not have an explicitly defined static constructor 考虑以内联方式初始化静态字段而不是显式使用静态构造函数,因为clr可以优化没有显式定义的静态构造函数的类型的性能。
To work around this problem , you can force the construction of the managed static constructor by defining a function in the managed . dll , exporting it , and invoking it from the native mfc application 为了解决此问题,可以通过以下方法来强制构造托管静态构造函数:在托管. dll中定义一个函数,导出它并从本机mfc应用程序中调用它。
A reference type that encapsulates data constants and fields and behavior methods , properties , indexers , events , operators , instance constructors , static constructors , and destructors , and can contain nested types 一种引用类型,它封装数据和行为,并可以包含嵌套类型,其中数据包括常数和字段,行为包括方法、属性、索引器、事件、运算符、实例构造函数、静态构造函数和析构函数。
Under the category of changes that have no managed extensions support , static constructors can now be defined out - of - line they were required to be defined inline within managed extensions , and the notion of a delegating constructor has been introduced 在不具有托管扩展支持的更改类别下,现在可外联定义静态构造函数(在托管扩展中要求对其进行内联定义) ,而且引入了委托构造函数的概念。