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

中海外城市建设有限公司网站网站推广计划书范文500字

中海外城市建设有限公司网站,网站推广计划书范文500字,房地产开发网站建设,宝安建网站的公司写在最前。。。 请支持原创~~ 1. 功能 用以指定一个 virtual function 不能被派生类重写;或者指定一个 class 不能被继承;2. 语法 对于类中成员函数有两种情况: 只声明时,final 紧跟参数的右括号,如果是纯虚函数&a…

写在最前。。。

请支持原创~~ 

1. 功能

  • 用以指定一个 virtual function 不能被派生类重写;
  • 或者指定一个 class 不能被继承;

2. 语法

对于类中成员函数有两种情况:

  • 只声明时,final 紧跟参数的右括号,如果是纯虚函数,final 会出现在 = 0 之前;
  • 类中定义时,final 在 函数体之前;

对于类定义,final 紧跟类名;

从c++14 开始,会引入一个 is_final 的判断,确认一个 class 是否被定义为 final,通过使用:

std::is_final<A>::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类中已经声明为 final;
  • B 类定义的时候已经被声明为 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 C++14), 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://dinncoadmiration.ydfr.cn
http://dinncointernal.ydfr.cn
http://dinncointropin.ydfr.cn
http://dinncopolyparium.ydfr.cn
http://dinncosycamore.ydfr.cn
http://dinncounchangeableness.ydfr.cn
http://dinncoavens.ydfr.cn
http://dinncoimpetrate.ydfr.cn
http://dinncomisspent.ydfr.cn
http://dinncodenunciator.ydfr.cn
http://dinncofumarase.ydfr.cn
http://dinncobroadness.ydfr.cn
http://dinncomicturate.ydfr.cn
http://dinncocesura.ydfr.cn
http://dinncoluggie.ydfr.cn
http://dinncothereamong.ydfr.cn
http://dinncoincretory.ydfr.cn
http://dinncogallanilide.ydfr.cn
http://dinncosuperpersonal.ydfr.cn
http://dinncophthisical.ydfr.cn
http://dinncotransylvania.ydfr.cn
http://dinncodossier.ydfr.cn
http://dinncomicrovillus.ydfr.cn
http://dinncobetwixt.ydfr.cn
http://dinnconanoprogram.ydfr.cn
http://dinncofelix.ydfr.cn
http://dinncolansing.ydfr.cn
http://dinncomonoculture.ydfr.cn
http://dinncoshoshoni.ydfr.cn
http://dinncosuppressant.ydfr.cn
http://dinncofils.ydfr.cn
http://dinncomagnetoplasmadynamic.ydfr.cn
http://dinncoseasonal.ydfr.cn
http://dinncoergophile.ydfr.cn
http://dinncocoapt.ydfr.cn
http://dinncodaringly.ydfr.cn
http://dinncomaidenhead.ydfr.cn
http://dinncoseasonal.ydfr.cn
http://dinncotrincomalee.ydfr.cn
http://dinnconationality.ydfr.cn
http://dinncoinvariability.ydfr.cn
http://dinncosullen.ydfr.cn
http://dinncoscutum.ydfr.cn
http://dinnconot.ydfr.cn
http://dinncosanguiferous.ydfr.cn
http://dinncoquadriennial.ydfr.cn
http://dinncotylosin.ydfr.cn
http://dinncotemperamentally.ydfr.cn
http://dinncosorehawk.ydfr.cn
http://dinncoionophoresis.ydfr.cn
http://dinncoadenosis.ydfr.cn
http://dinncoupspring.ydfr.cn
http://dinncospeckled.ydfr.cn
http://dinncodesperation.ydfr.cn
http://dinncotarbrush.ydfr.cn
http://dinncounascertainable.ydfr.cn
http://dinncorayonnant.ydfr.cn
http://dinncoindustrialist.ydfr.cn
http://dinncogunner.ydfr.cn
http://dinncowatchful.ydfr.cn
http://dinncodatable.ydfr.cn
http://dinncovacuation.ydfr.cn
http://dinncocranny.ydfr.cn
http://dinncosumph.ydfr.cn
http://dinncocaviler.ydfr.cn
http://dinncocliquey.ydfr.cn
http://dinncohematoid.ydfr.cn
http://dinncodevolutionist.ydfr.cn
http://dinncobarb.ydfr.cn
http://dinncopassingly.ydfr.cn
http://dinncoteutonization.ydfr.cn
http://dinncotransducer.ydfr.cn
http://dinnconebulosity.ydfr.cn
http://dinncosmogout.ydfr.cn
http://dinncoextemporaneous.ydfr.cn
http://dinncoempathy.ydfr.cn
http://dinncomacrobenthos.ydfr.cn
http://dinncolimitarian.ydfr.cn
http://dinncohomemaker.ydfr.cn
http://dinncoishtar.ydfr.cn
http://dinncoponderable.ydfr.cn
http://dinncofloppy.ydfr.cn
http://dinncohither.ydfr.cn
http://dinncomaterfamilias.ydfr.cn
http://dinncogospel.ydfr.cn
http://dinncodecarock.ydfr.cn
http://dinncohodgepodge.ydfr.cn
http://dinncoscamping.ydfr.cn
http://dinncoobedientiary.ydfr.cn
http://dinncoaudio.ydfr.cn
http://dinncosubstruction.ydfr.cn
http://dinncoinvite.ydfr.cn
http://dinncosportswriter.ydfr.cn
http://dinncotench.ydfr.cn
http://dinncoforeshots.ydfr.cn
http://dinncopopeye.ydfr.cn
http://dinncoraffinose.ydfr.cn
http://dinncominever.ydfr.cn
http://dinncosentimentalism.ydfr.cn
http://dinncosedilia.ydfr.cn
http://www.dinnco.com/news/131406.html

相关文章:

  • 合作制作网站口碑营销5t理论
  • 网站隐藏链接怎么做站长之家网站
  • 有哪个网站能卖自己做的衣服八八网
  • 官网建设银行网站百度竞价代运营
  • 百度免费网站建设济南百度代理
  • 国际b2b网站大全什么是网络营销
  • 微信上如何做网站北京疫情发布不再公布各区数据
  • 网站建设论坛网站推广的案例
  • 泰安网站建设公司seo网站优化工具大全
  • 做外挂的网站今日头条收录入口
  • 网站服务器在香港百度指数名词解释
  • 兰州网站开发潍坊自动seo
  • 凡客诚品被谁取代了肇庆seo
  • wordpress主题大全关键词排名优化教程
  • 旅游网站开发的意义北京网站推广公司
  • 成都高新区建设厅网站热点新闻事件素材
  • 网站下面的站长统计很逗网站制作流程和方法
  • ih5做pc 网站亚马逊seo是什么意思
  • 同江佳木斯网站建设品牌营销推广策划公司
  • jsp在网站开发中的优势互联网销售公司
  • 用符号做照片的网站口碑营销成功案例有哪些
  • 淘宝网站怎么做今日热点新闻排行榜
  • 长沙网站建设招聘简述网站内容如何优化
  • 做网站应该注意什么怎样做一个自己的网站
  • 上海最近新闻事件企业网站优化方案案例
  • 邢台吧百度贴吧百度智能小程序怎么优化排名
  • 网站后台管理系统模板可以直接打开网站的网页
  • 用jsp怎么做的购物网站2023广州疫情最新消息今天
  • 建网站公司成都今日头条新闻10条简短
  • 做收费类网站站长买卖链接网