当前位置: 首页 > news >正文

新网站建设代理商开发一平方多少钱

新网站建设代理商,开发一平方多少钱,公司网站建设 公司简介怎么写,有创意的设计产品写在最前。。。 请支持原创~~ 1. 功能 用以指定一个 virtual function 不能被派生类重写#xff1b;或者指定一个 class 不能被继承#xff1b;2. 语法 对于类中成员函数有两种情况#xff1a; 只声明时#xff0c;final 紧跟参数的右括号#xff0c;如果是纯虚函数或者指定一个 class 不能被继承2. 语法 对于类中成员函数有两种情况 只声明时final 紧跟参数的右括号如果是纯虚函数final 会出现在 0 之前类中定义时final 在 函数体之前对于类定义final 紧跟类名 从c14 开始会引入一个 is_final 的判断确认一个 class 是否被定义为 final通过使用 std::is_finalA::value 来判断 class A 是否为 final。 3. 举例 struct A; struct A final {}; // OK, definition of struct A,// not value-initialization of variable finalstruct X {struct C { constexpr operator int() { return 5; } };struct B final : C{}; // OK, definition of nested class B,// not declaration of a bit-field member final };// Abnormal final usage.struct final final // OK, definition of a struct named final from which { // you cannot inherit };// struct final final {}; // Error: redefinition of struct final, NOT a// definition of a variable final using an elaborated// type specifier struct final followed by an// aggregate initialization// struct override : final {}; // Error: cannot derive from final base type;// override in given context is a normal name void foo() {[[maybe_unused]]final final; // OK, declaration of a variable named final of type// struct final }struct final final; // OK, declaration of a variable named final of type// struct final using an elaborated type specifier int main() { }final 只是一个标识在使用成员函数和类定义时有特殊的意义。而在其他情况下可以作为一个对象名、函数名、类名使用。 struct Base {virtual void foo(); };struct A : Base {void foo() final; // Base::foo is overridden and A::foo is the final overridevoid bar() final; // Error: bar cannot be final as it is non-virtual };struct B final : A // struct B is final {void foo() override; // Error: foo cannot be overridden as it is final in A };struct C : B {}; // Error: B is final 注意这里的几个注意点 A 类中 foo() 继承自 Base 类并把自身定义为 final即后续继承A 的子类无法再重写 foo()A 类中 bar() 使用了final但 final 是用在 virtual 的成员函数B 类想重写 foo()是不允许的因为在A类中已经声明为 finalB 类定义的时候已经被声明为 final所以无法再被其他类继承即B 类不会有子类4. 原文摘录 Specifies that a virtual function cannot be overridden in a derived class or that a class cannot be derived from. When applied to a member function, the identifier final appears immediately after the declarator in the syntax of a member function declaration or a member function definition inside a class definition. When applied to a class, the identifier final appears at the beginning of the class definition, immediately after the name of the class. 1) In a member function declaration, final may appear in virt-specifier-seq immediately after the declarator, and before the pure-specifier, if used. 2) In a member function definition inside a class definition, final may appear in virt-specifier-seq immediately after the declarator and just before function-body. 3) In a class definition, final may appear as class-virt-specifier immediately after the name of the class, just before the colon that begins the base-clause, if used. In the cases (1,2), virt-specifier-seq, if used, is either override or final, or final override or override final. In the case (3), the only allowed value of class-virt-specifier, if used, is final When used in a virtual function declaration or definition, final specifier ensures that the function is virtual and specifies that it may not be overridden by derived classes. The program is ill-formed (a compile-time error is generated) otherwise. When used in a class definition, final specifies that this class may not appear in the base-specifier-list of another class definition (in other words, cannot be derived from). The program is ill-formed otherwise (a compile-time error is generated). final can also be used with a union definition, in which case it has no effect (other than on the outcome of std::is_final) (since C14), since unions cannot be derived from. final is an identifier with a special meaning when used in a member function declaration or class head. In other contexts, it is not reserved and may be used to name objects and functions.
http://www.w-s-a.com/news/490997/

相关文章:

  • 外贸通网站建设网站建设7个主要流程图
  • 元气森林网络营销方式医疗网站优化怎么做
  • 手机网站制作报价表做网站公司做网站公司
  • 湖州网站设计吉林网站建设哪家好
  • 做存储各种环境信息的网站使用tag的网站
  • 阿里云用ip做网站网站开发员属于
  • 外链网盘下载南宁seo推广优化
  • 网站的推广方案有哪些此网站可能有
  • wordpress更改链接后网站打不开一键生成个人网站
  • 网站建设后台有哪些东西前端开发培训一般多少钱
  • 高端建设网站公司网站开发 源码
  • 企业网站的劣势园林景观设计公司简介范文
  • 网站建设程序招聘东营建设信息网登录
  • o2o是什么意思通俗讲seo与网站优化 pdf
  • 外贸网站外包一般建设一个网站多少钱
  • 抄袭别人网站的前端代码合法吗网络促销策略
  • 用wordpress制作网站做资源网站
  • wordpress 发布网站南宁网站建设网站
  • 职业生涯规划大赛心得贵阳哪家网站做优化排名最好
  • wordpress 图片懒加载北京网站优化和推广
  • 深圳网站建设工作一个dede管理两个网站
  • 被禁止访问网站怎么办中国建筑网官网查询系统
  • 网站管理运营建设网贷网站
  • 深圳市龙岗区住房和建设局网站怎么给网站做404界面
  • 设计类网站网站系统 建设和软件岗位职责
  • 网站后台打开慢站长之家网址ip查询
  • 图书馆网站设计方案家具设计作品
  • 马鞍山做网站公司排名徐州网站外包
  • 十堰微网站建设电话宣传型网站建设
  • 电脑制作网站教程网络公司除了建网站