• A private constructor is a special instance constructor.

    私有构造函数一种特殊实例构造函数。

    youdao

  • The following is an example of a class using a private constructor.

    以下一个类别使用私用建构函式范例

    youdao

  • Do classes that should not be instantiated have a private constructor?

    需要实例化私有构造函数吗?

    youdao

  • What is the difference between a class having private constructor and a sealed class having private constructor?

    区别什么拥有私有构造函数一个密封的类私有构造函数吗?

    youdao

  • You could still accidentally use a private constructor (e. g. in a restricted set of scopes), but the compiler will forbid you from ever using a deleted constructor.

    仍然可以不小心使用私有构造方法(例如限制范围),编译禁止使用过删除构造函数。

    youdao

  • If a class contains only static members, remember to mark the class as static or seal the class (NotInheritable) and give the class a private constructor to avoid instance creation.

    如果包含静态成员则要记得将该类标记静态,或者密封该类(NotInheritable),并且还要该类提供一个私有构造函数避免实例创建

    youdao

  • Listing 2 shows a piece of code that results in a compile-time error because the copy constructor is private.

    清单2显示产生编译时错误代码部分因为拷贝构造函数私有的。

    youdao

  • You should mark this constructor private so that you can't accidentally call the constructor and forget to record it in your object map.

    应当构造标识私有这样不会意外调用构造器忘记记录对象映射

    youdao

  • The argument to the constructor is the fully qualified URL of the metadata service being exposed, which we construct using methods in the private class HostDescriptor.

    构造函数参数是正在显示的元数据服务限定url我们使用私有HostDescriptor中的方法构造了它。

    youdao

  • Note that we declare the LogonUI constructor as private.

    请注意我们构造函数 LogonUI声明为 private

    youdao

  • HierarchyBuilder's constructor is private, however, so I can't test it via my test class (nor do I care to); therefore, my line coverage still hovers at 88%.

    然而,因为HierarchyBuilder构造器private类型的,所以不能通过测试测试(我关心)。因此,我的覆盖率仍然只有88%。

    youdao

  • Also, for classes that have design reasons to have private or no copy constructor, this style of swapping won't work. Here's what boost: : swap gets you.

    另外对于出于设计原因拥有private构造函数而没有复制构造函数类,所以这种交换风格适用。

    youdao

  • In the first case, you are essentially declaring a private copy constructor and then not providing any implementation. By declaring them private, non-members cannot copy it.

    第一情况下基本上声明一个私有拷贝构造函数然后没有提供任何实现通过声明他们私人非成员国不能复制它。

    youdao

  • 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.

    使私人方式这样做。构造函数仍然存在私人的,只能内部调用另一个成员函数

    youdao

  • We add a constructor that also defines a private property.

    添加构造函数定义一个私有属性

    youdao

  • If you're using a framework that requires this for some reason, see if you can satisfy it by providing a private no-argument constructor (which is visible via reflection).

    如果正在使用框架因为某些原因需要使用这样构造函数的话,那么您可以了解以下能否通过提供私有的无参数构造函数(经由反射可见的)来满足这一要求。

    youdao

  • The noncopyable class definition presents no surprises, as the copy constructor and operator= are declared private.

    noncopyable定义没有什么令人感到新奇的地方,因为copyconstructoroperator= 声明 private

    youdao

  • Your first solution conveys to the reader that the copy-constructor is private and is not to be used.

    第一个解决方案读者传达拷贝构造函数私有的,不能使用。

    youdao

  • The traditional way to solve this is to declare the copy-constructor private and to leave it unimplemented.

    传统方式解决这个声明拷贝构造函数私有未实现的。

    youdao

  • Which is the difference between declaring a constructor private and =delete?

    声明一个构造函数区别私人=删除?。

    youdao

  • The special constructor used for serialization should also perform thorough input validation and should be either protected or private to help protect against misuse by malicious code.

    用于序列化特殊构造函数应当进行彻底输入验证并且应当成为被保护或者私有的,帮助防范恶意代码滥用行为

    youdao

  • Ruby class initialize (constructor) is private method or public method?

    宝石初始化(构造函数)私人公共方法方法

    youdao

  • The first case is redundant, why declare the copy constructor, make it private, and not implement it.

    第一病例多余的,为什么声明拷贝构造函数使私人实现

    youdao

  • Do declare static classes as sealed and abstract, and add a private instance constructor, if your programming language does not have built-in support for static classes.

    如果编程语言没有静态的内置支持,则应将静态类声明密封抽象的,添加一个私有实例构造函数

    youdao

  • In the first case, you are essentially declaring a private copy constructor and then not providing any implementation.

    第一情况下基本上声明一个私有拷贝构造函数然后没有提供任何实现。

    youdao

  • If a static constructor is not private, it can be called by code other than the system.

    如果静态构造函数不是私有,则系统以外代码可以调用

    youdao

  • The programming language compiler added a default static constructor to your type and did not make it private.

    编程语言编译器类型添加默认静态构造函数,但设置为私有。

    youdao

  • So just making a constructor private doesn't communicate the intention very well, and the resulting error is not very clear, either.

    所以仅仅一个构造函数私有并不交流意图由此产生的错误不是很清楚,。

    youdao

  • Note that if you do not use an access modifier with the constructor it will still be private by default.

    注意如果不对构造函数使用访问修饰符,则默认情况下私有构造函数。

    youdao

  • The constructor still exists, but it is private, and can only be invoked from within another class member function.

    构造函数仍然存在私人的,只能内部调用另一个成员函数。

    youdao

$firstVoiceSent
- 来自原声例句
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定