The GCC developers thought of this, too, and provided the means for a main function constructor and destructor that happen to fit this need perfectly.
gcc的开发者也考虑过这个问题,它们为main函数的constructor函数和destructor函数提供了一些碰巧能够满足这个要求一些方法。
Define a constructor function which initializes the required data.
定义一个构造器函数来初始所需的数据。
It can also detect if a constructor function of a schema-type is supported; more about that in a moment.
还可以检查是否支持模式类型的构造器函数,特别是在当时。
The function simply converts the element identifier into a pointer and then calls the constructor, passing the remaining arguments unchanged.
这个函数简单地将元素标识符转换为一个指针,然后调用构造函数,将其他参数不加修改地传递给构造函数。
You can give it a name (that is, a class name), specify parameters (as in a constructor), and even use the .this keyword, which basically means referencing a variable within the scope of the function.
可以给其一个名称(也就是一个类名),指定参数(和在构造函数中一样),甚至可以使用关键字 .this,这意味着在函数范围内引用变量。
The RequiredValidator() constructor (see Listing 6) takes the same parameters as the Validator() function.
RequiredValidator()构造函数(参见清单6)的参数与Validator()函数相同。
And, because every function in the Student controller touches the template view, you need to load the URL Helper as part of the Student constructor (see Listing 14).
并且,由于Student控制器内的每个函数都会接触到模板视图,所以需要加载urlHelper,作为Student构造函数的一部分(参见清单14)。
The LotteryFactory's constructor seeds the rand function used by our lottery classes.
LotteryFactory的构造函数将构造我们的彩票类所使用的rand函数。
The range function is simply a list constructor, very similar to the range function in Python, or the..
range函数只是一个list构造函数,非常类似于Python中的range函数,或者是Haskell或Perl中的. .。
We specify the callback for the Scale widget not in its constructor, but later, using the configure function.
我们没有在它的构造函数中指定Scale窗口小部件的回调,而是稍后使用configure来指定。
If the record is not found, I create a new Employee prototype by invoking the Employee constructor function with the appropriate fields from the panel. Here's the Employee constructor function.
如果没有找到记录,就使用面板中适当的字段,调用Employee构造函数创建一个新的Employee原型。
When you want to create an atomic value of one of the time-oriented data types, use a type-constructor function and provide the string representation as an argument.
如果需要创建与时间相关的数据类型的单个值,可以使用类型构造器函数并提供时间的字符串表示形式作为参数。
The constructor is used to form a delegate over a target object and a function pointer.
这构造器用来通过一个目标对象和一个函数指针形成一个委托。
If you are familiar with the basics of object-oriented programming, you will know that when an object is instantiated, the class constructor function is automatically called.
如果您对面向对象编程语言基本原理比较熟悉,您就知道当一个对象被实例化时,类构造函数被自动调用。
Therefore, it might be worthwhile to restructure your spatial query to ensure just a single call to the constructor function using common table expressions.
因此,可能有必要使用公共表表达式重新构造空间查询,以确保只调用一次构造函数。
The constructor function has the same name as the structured type with which it is associated.
构造函数和它关联的结构化类型有相同的名称。
The constructor function has no parameters and returns an instance of the type with all of its attributes set to null values.
构造函数没有参数,并且返回的类型实例中的所有属性都为空。
Making it private is the "old" way of doing it. The constructor still exists, but it is private, and can only be invoked from within another class member function.
使其私人的“旧”的方式这样做。构造函数仍然存在,但它是私人的,只能从内部调用另一个类的成员函数。
Like any other member function, a constructor is declared inside the class and may be defined there or outside the class.
和其他成员函数一样,构造函数也必须在类中声明,但是可以在类中或类外定义。
The only way for a constructor to handle an exception from a constructor initializer is to write the constructor as a function try block.
构造函数要处理来自构造函数初始化式的异常,唯一的方法是将构造函数编写为函数测试块。
To create your constructor and destructor, declare two functions, then apply the constructor and destructor function attributes to them.
要创建constructor和destructor函数,则需要声明两个函数,然后对这两个函数应用constructor和destructor函数属性。
The constructor function is invoked immediately prior to main being called; and the destructor function is called when your application exits.
constructor函数是在调用main函数之前调用的,而destructor 函数则是在应用程序退出时调用的。
In the constructor function, a new trace file is opened into which the profiling address trace will be written; within the destructor function, the trace file is closed (see Listing 3).
在constructor函数中,会打开一个新的跟踪文件,分析数据的地址跟踪就是写入这个文件的;在destructor函数中,会关闭这个跟踪文件(参见清单3)。
When invoked with the new operator, the constructor function creates what is known as a prototype for an object; that is, it creates a template from which to build objects of the given kind.
当调用new操作符时,构造函数就为对象创建一个所谓的原型(prototype);也就是说,它创建了一个模板(template),从中构建给定类型的对象。
When you create a structured type, DB2 automatically creates a constructor function for the type and creates both mutator and observer methods for the attributes of the type.
当您创建结构化类型时,DB 2为类型自动创建一个构造函数,并为类型的属性创建mutator方法和observer方法。
The core of the listing is the defnode macro that takes a node type and a vector of field names, and creates a constructor function for creating maps of that type.
这个清单的核心是defnode宏,它获取一个节点类型和一个字段名矢量,并创建一个构造函数来创建该类型的映射。
Once I have a constructor function, I can use the new operator to create objects, as shown below
拥有构造函数之后,就可以使用new操作符来创建对象了,如下所示
Once I have a constructor function, I can use the new operator to create objects, as shown below
拥有构造函数之后,就可以使用new操作符来创建对象了,如下所示
应用推荐