what iwhat we mean byy "undefined"?是什么意思

Starting a new class in QT 5.4, I noticed that the second line of code had a tilda as part of it's name.
Is that related to QT or C++?
What does that tilda mean and what is it trying to say here?
#include "findapplications.h"
FindApplications::FindApplications()
FindApplications::~FindApplications()
I think I know why I wasn't getting any search results.
I misspelled tilde as tilda.
解决方案 A destructor is a special member function of a class that is executed whenever an object of it's class goes out of scope or whenever the delete expression is applied to a pointer to the object of that class.
A destructor will have exact same name as the class prefixed with a tilde ~ and it can neither return a value nor can it take any parameters. Destructor can be very useful for releasing resources before coming out of the program like closing files, releasing memories etc.
The destructor is called whenever an object's lifetime ends, which includes
program termination, for objects with static storage duration
thread exit, for objects with thread-local storage duration (since
end of scope, for objects with automatic storage duration and for
temporaries whose life was extended by binding to a reference,
delete-expression, for objects with dynamic storage duration, end of
the full expression, for
stack unwinding, for objects with automatic storage duration when an
exception escapes their block, uncaught.
The destructor may also be called directly, e.g. to destroy an object that was constructed using placement-new or through an allocator member function such as std::allocator::destroy(), to destroy an object that was constructed through the allocator.
Note that calling a destructor directly for an ordinary object, such as a local variable, invokes undefined behavior when the destructor is called again, at the end of scope.
In generic contexts, the destructor call syntax can be used with an object of non- this is known as pseudo-destructor call: see member access operator.
Implicitly-declared destructor:
If no user-defined destructor is provided for a class type (struct, class, or union), the compiler will always declare a destructor as an inline public member of its class.
Deleted implicitly-declared destructor:
The implicitly-declared or defaulted destructor for class T is undefined (until C++11) defined as deleted (since C++11) if any of the following is true:
T has a non-static data member that cannot be destructed (has deleted
or inaccessible destructor)
T has direct or virtual base class that cannot be destructed (has
deleted or inaccessible destructors)
T is a union and has a variant member with non-trivial destructor.
(since C++11)
The implicitly-declared destructor is virtual (because the base class has a virtual destructor) and the lookup for the deallocation function (operator delete() results in a call to ambiguous, deleted, or inaccessible function.
Trivial destructor.
The destructor for class T is trivial if all of the following is true:
The destructor is not user-provided (meaning, it is
implicitly-defined or defaulted)
The destructor is not virtual (that is, the base class destructor is
not virtual)
All direct base classes have trivial destructors
All non-static data members of class type (or array of class type)
have trivial destructors
A trivial destructor is a destructor that performs no action. Objects with trivial destructors don't require a delete-expression and may be disposed of by simply deallocating their storage. All data types compatible with the C language (POD types) are trivially destructible.
Implicitly-defined destructor:
If the implicitly-declared destructor is not deleted or trivial, it is defined (that is, a function body is generated and compiled) by the compiler. This implicitly-defined destructor has an empty body.
As with any implicitly-defined special member function, the exception specification of the implicitly-defined destructor is non-throwing unless it directly invokes a function with a different exception specification (e.g. when it must call a user-defined destructor for a member or a base subobject with a different exception specification).
Destruction sequence:
For both user-defined or implicitly-defined destructors, after the body of the destructor is executed, the compiler calls the destructors for all non-static non-variant members of the class, in reverse order of declaration, then it calls the destructors of all direct base classes in reverse order of construction (which in turn call the destructors of their members and their base classes, etc), and then, if this object is of most-derived class, it calls the destructors of all virtual bases.
Even when the destructor is called directly (e.g. obj.~Foo();), the return statement in ~Foo() does not return control to the caller immediately: it calls all those member and base destructors first.
Virtual destructors:
Deleting an object through pointer to base invokes undefined behavior unless the destructor in the base class is virtual:
class Base {
virtual ~Base() {}
class Derived : public Base {};
Base* b = new D
A common guideline is that a destructor for a base class must be either public and virtual or protected and nonvirtual
Pure virtual destructors
A destructor may be declared pure virtual, for example in a base class which needs to be made abstract, but has no other suitable functions that could be declared pure virtual. Such destructor must have a definition, since all base class destructors are always called when the derived class is destroyed:
class AbstractBase {
virtual ~AbstractBase() = 0;
AbstractBase::~AbstractBase() {}
class Derived : public AbstractBase {};
// AbstractB
// compiler error
Exceptions:
As any other function, a destructor may terminate by throwing an exception (this usually requires it to be explicitly declared noexcept(false)) (since C++11), however if this destructor happens to be called during stack unwinding, std::terminate is called instead.
Although std::uncaught_exception may sometimes be used to detect stack unwinding in progress, it is generally considered bad practice to allow any destructor to terminate by throwing an exception. One example where this functionality is used is the library SOCI, which relies on the ability of the destructors of certain nameless temporaries to throw exceptions.
Run this code.
#include &iostream&
A ( int i ) : i ( i ) {}
std::cout && "~a" && i && std::
int main()
{ // nested scope
p = new A(3);
} // a2 out of scope
// calls the destructor of a3
content taken from
本文地址: &
在QT 5.4中开始一个新类,我注意到第二行代码有一个tilda作为其名称的一部分。这是与QT还是C ++相关?这个tilda是什么意思,这里想说什么?
#include“findapplications.h”
FindApplications :: FindApplications() { }
FindApplications ::?FindApplications() { }
编辑:我想我知道为什么我没有得到任何搜索结果。
解决方案 析构函数是一个类的特殊成员函数,当它的类的对象超出范围或每当将删除表达式应用于指向该类的对象的指针时。
析构函数将具有与带有波浪符号的类完全相同的名称?,它既不能返回值也不能采取任何参数。
当对象的生命周期结束时,析构函数被调用,包括
程序终止,对于具有静态存储持续时间的对象
存储持续时间(自 C ++ 11起)
结束范围,对于具有自动存储持续时间的对象和临时值,其生命通过绑定到引用,
delete-expression,用于具有动态存储持续时间的对象,结束完整表达式,用于无名临时数;
析构函数也可以直接调用,例如以销毁使用placement-new或通过诸如 std :: allocator :: destroy()的分配器成员函数构造的对象,以销毁通过分配器。 请注意,直接为一个普通对象(如局部变量)调用析构函数会在再次调用析构函数时调用未定义的行为。
在通用上下文中,析构函数调用语法可以与非类类型的对象一起使用;
隐式声明的析构函数:
如果没有为类类型提供用户定义的析构函数( struct , class
union ),编译器将总是声明一个析构函数为 inline
public 其类的成员。
已删除隐式声明的析构函数:
class T 的隐式声明或默认析构函数未定义(直到C ++ 11)定义为删除(因为C ++ 11),如果下列任何一个为真:
T有一个不能被破坏的非静态数据成员(删除了或不可访问的析构函数)
T具有不能被销毁的直接或虚拟基类(具有被删除或不可访问的析构函数)
T是一个联合,非平凡析构函数。 (自C ++ 11起)
隐式声明的析构函数为 virtual (因为基类有一个虚拟析构函数),并且对释放函数(操作符delete())的查找导致对模糊,删除或不可访问函数的调用简单析构函数
class T 的析构函数在以下所有条件都成立时是微不足道的:
析构函数不是用户提供的(意味着它是隐式定义或默认)
析构函数不是虚函数
所有非静态数据成员(非基类类析构函数是不是虚拟的)类型类型(或类型类型的数组)有小的析构函数
一个简单的析构函数是一个析构函数, 。具有简单析构函数的对象不需要delete-expression,并且可以通过简单地释放它们的存储器来处理。所有与C语言兼容的数据类型(POD类型)都是可破坏的。
隐式定义析构函数:
如果隐式声明的析构函数没有被删除或微不足道,它由编译器定义(即函数体被生成和编译)。这个隐式定义的析构函数有一个空体。
与任何隐式定义的特殊成员函数一样,隐式定义的析构函数的异常规范是非抛出的,除非它直接调用具有不同异常规范的函数(例如,当它必须为成员或具有不同异常规范的基本子对象调用用户定义的析构函数时)。
strong>销毁序列:
对于用户定义或隐式定义的析构函数,在析构函数的主体执行后,编译器调用析构函数类的所有非静态非变体成员,以相反的声明顺序,然后它以相反的结构顺序调用所有直接基类的析构函数(反过来又调用其成员及其基类的析构函数等) ,然后,如果这个对象是大多数派生类,它调用所有虚拟基础的析构函数。
即使直接调用析构函数 obj。?Foo(); ),?Foo()中的return语句不会将控制权返回给调用者
p>通过指向base的指针删除对象会调用未定义的行为,除非基类中的析构函数是virtual:
class Base { public: virtual?Base(){} };
class Derived:public Base {};
Base * b = new D
一个常见的准则是,基类的析构函数必须是public和virtual受保护和非虚拟纯虚拟析构函数析构函数可以声明为纯虚函数,例如在需要被抽象的基类中,但没有其他可以被声明为纯虚函数的合适函数。这样的析构函数必须有一个定义,因为所有的基类析构函数总是在派生类被销毁时被调用:
class AbstractBase { public: virtual?AbstractBase()= 0; };
AbstractBase ::?AbstractBase(){}
class Derived:public AbstractBase {};
// AbstractB //编译器错误 D // OK
任何其他函数,析构函数可以通过抛出异常(这通常需要明确声明为noexcept(false))(从C ++ 11开始)终止,但是如果这个析构函数恰好在栈展开,而是调用std :: terminate。 虽然std :: uncaught_exception有时可用于检测正在进行的堆栈展开,但通常认为不允许任何析构函数通过抛出异常来终止。使用此功能的一个示例是库SOCI,它依赖于某些无名临时表的析构函数抛出异常的能力。
示例: 运行此代码。
#include& iostream&
A(int i):i(i){}
?A() { std :: cout& “?a”&& i&& std :: } };
int main() { A a1(1);
{//嵌套的范围 A a2(2);
p = new A(3); } // a2超出范围
//调用a3的析构函数}
?a2 ?a3 ?a1
本文地址: &
扫一扫关注IT屋
微信公众号搜索 “ IT屋 ” ,选择关注
与百万开发者在一起
(window.slotbydup = window.slotbydup || []).push({
id: '5828425',
container: s,
size: '300,250',
display: 'inlay-fix'
(window.slotbydup = window.slotbydup || []).push({
id: '5828430',
container: s,
size: '300,250',
display: 'inlay-fix'大家都在搜:
扫描二维码安装房天下APP
手机浏览器访问房天下
> > 问题详情
what does &well spotted& mean here?
what does &well spotted& mean here? A: do you like my carpet? Be honest! Tell me what you really think. B: to be honest, it looks like your old carpet. I...
what does &well spotted& mean here? A: do you like my carpet? Be honest! Tell me what you really think. B: to be honest, it looks like your old carpet. Is it really new or did you just have your old cleaned? A: well spotted! I actually had it cleaned twice, because it was so dirty. The rug is new. You remember my trip to china? Well, I bought it there.
浏览次数:0
好眼力。或:看得准。spot作为及物动词,有一项意为“see (someone or something) that is difficult to detect&。(参见英国2005年第2版The Oxford Dictionary of English)这种表达类似于well done。
房天下知识为您分享了一条干货
手机动态登录
请输入用户名/邮箱/手机号码!
请输入密码!
没有房天下通行证,
下载房天下APP
提问获取更多回答
ask:3,asku:1,askr:31,askz:7,askd:29,RedisW:0askR:1,askD:0 mz:hit,askU:0,askT:0askA:2
Copyright &
北京拓世宏业科技发展有限公司
Beijing Tuo Shi Hong Ye Science&Technology Development Co.,Ltd 版权所有
违法信息举报邮箱:综合能力_英文“ 一贯的 ”怎么说?__沪江网
网页版学习工具
英文“ 一贯的 ”怎么说?
在沪江关注英语的沪友cucidawan遇到了一个关于的疑惑,已有2人提出了自己的看法。
知识点疑惑描述
英文“ 一贯的 ”怎么说?
知识点相关讲解
是consistent policy
http://dict.cnki.net/dict_result.aspx?searchword=consistent+policy
—— whuteverag
adj.不变的, 持续的, 坚决的
consistent
adj. 一致的, 调和的, 坚固的
这里用 consistent
如:同党外人士合作共事是中国共产党的一贯政策--&三三制&抗日民主政权的启示
Cooperation with Non-Party Personage: The Consistent Policy of CPC
参考句子:
1. 他的观点缺乏一贯性: 时而保守, 时而开明.
His views lack consistency: one day he's a conservative, the next he's a liberal.
2. 我想现在我明白你的意思了。如果你所说的“正直”就是我所说的“一贯性”,那么我们刚才的争吵就是彼此误解了。
I get your drift now, I think. If you mean by&integrity&, what I would call&consistency& then we've been arguing at cross-purposes.
3. 她现在有权力支配那些一贯向她发号施令的人.
She now has authority over the people she used to take orders from.
—— lansingdun
其他相关知识点what do you mean 什么意思_百度知道
what do you mean 什么意思
我有更好的答案
what do you mean?=What is your meaning ?中文:你是什么意思啊?mean 英[mi:n] 美[min] 过去式:meant 过去分词:meant 现在分词:meaningvt. 1.表示…的意思 2.本意是, 原意为; 意味 3.怀有某目的; 打算 4.对某人有价值或重要 5.打算或注定要某人成为或做某事 6.预定;注定 7.引起;造成 adj. 1.吝啬的; 自私的 2.卑鄙的, 不善良的 3.中间的, 平均的 4.低微的 5.人或其行为不善良;刻薄 6.要发怒的;要发狂的 7.熟练的;出色的 8.(人的理解力或能)平庸的;一般的 9.低劣而肮脏的 10.低劣的;平庸的;微不足道的;不如人的 11.不重要的;没价值的 12.简陋的;破旧的;难看的 13.卑贱的;卑劣的;心胸狭窄的 14.(位置、时间、数量、价值、顺序、程度等)中间的;居中的,折中的;中庸的 15.中等的;普通的;平均的 16.【数学】 中项的 n. 1.平均数, 平均值 2.中间, 中庸 3.几何平均;等比中数 vi. 1.产生…结果;意味着 2.用意;怀有特定用意 3.有重要意义;有重要性;有影响 及物动词 vt.1.表示…的意思 In this poem the budding flower means youth.在这首诗里含苞欲放的花朵是指青春.The sign means that cars cannot enter.这种标志表示汽车不能入内.2.本意是, 原意为; 意味 When we say yes, we mean it.我们说同意就同意.I did not mean you.我不是指你.These new orders for our manufactures will mean working overtime.这些订购我们产品的新订单意味着要加班.He means you no harm.他对你没有恶意.3.怀有某目的; 打算 He that promises too much means nothing.许愿过多的人是不打算兑现的.I mean to stay here, if I can.若是能留下, 我想留在这儿.I mean this house for my daughter.我打算把这房子给我的女儿.4.对某人有价值或重要 In running a company, strict financial management means everything.经营一家公司, 严格的财务管理是至关重要的.I must tell you that I mean what I say.我得告诉你, 我说话是算数的.5.打算或注定要某人成为或做某事 I was never meant for the army.我根本就不是当兵的材料.He means his son to be a doctor.他要儿子当医生.6.预定;注定7.引起;造成形容词 adj.1.吝啬的; 自私的 He is a mean man.他是个自私的人.Her husband is rather mean over money matters.她的丈夫在金钱方面非常小气.He's too mean to make a donation.他很小气, 不肯捐款.2.卑鄙的, 不善良的 He took a mean advantage of me.他利用卑鄙的手段占我的便宜.Corruption and bribery are mean.贪污行贿是可鄙的.It was mean of her to say that.她那样说是刻薄的.3.中间的, 平均的 The mean temperature of this area is 33 degrees in summer.这个地区夏季平均气温为33度.4.低微的 He is a man of mean birth.他是位出身低微的人.5.人或其行为不善良;刻薄6.要发怒的;要发狂的7.熟练的;出色的8.(人的理解力或能)平庸的;一般的9.低劣而肮脏的10.低劣的;平庸的;微不足道的;不如人的11.不重要的;没价值的12.简陋的;破旧的;难看的13.卑贱的;卑劣的;心胸狭窄的14.(位置、时间、数量、价值、顺序、程度等)中间的;居中的,折中的;中庸的 15.中等的;普通的;平均的16.【数学】 中项的名词 n.1.平均数, 平均值 What you do first is to calculate the mean.你要做的第一件事就是算出平均数.2.中间, 中庸 It's a question of finding the mean between too lenient treatment and too severe punishment.问题是要找出处理过宽和处罚过严的折中办法.3.几何平均;等比中数不及物动词 vi.1.产生…结果;意味着2.用意;怀有特定用意3.有重要意义;有重要性;有影响mean (来自拉丁词根medius中间) 参考词汇mean , ignoble , abject 这组同义词的一般含义是“卑鄙的”.mean和ignoble的原义指出身低微,mean指社会下层人的出身,ignoble指出身比贵族阶层低下. mean 通常表示令人厌恶的反社会的各种特征,如心胸狭窄、气量小等.例如,整个社会都为共同的事业而奋斗,而有的个别人只去经营自己的“小天地”,这种人可谓mean They have an air of freedom, and they have not a dreary commitment to mean ambitions or love of comfort.他们有一种奔放不羁的风度,他们没有对卑鄙的野心目标的无聊的追逐和对舒适的迷恋.He is a man of mean birth.他是个出身卑微的人.ignoble 通常用于修饰人的思想境界,其确切的含义是缺少或没有高尚的情操、崇高的道德或完美的智慧.在掌握这个词时,应知道它的反义词为noble To bettay a friend is ignoble.背弃朋友是卑鄙的.abject 的含义是“低下”,在修饰事物时,这个词只不过是个强式词.如:abject poverty(赤贫).不过,如果用词慎重,这个词所表示的“卑鄙的”包含着“被贬低”的意思.此外,在这里简单一提这组词的近义词:base, low, vile. base 所表示的“卑鄙的”包含着由于缺乏崇高的思想或者缺少博爱的感情而激起人们的义愤的意义;low 所表示的“卑鄙的”包含着由于做事不合乎道德规范而激起人们的愤怒的意义,比如向毫无保护能力的人进攻,即属此类;vile 所表示的“卑鄙的”包含着低级、下贱、污秽的意义 He is poor but not abject in his manner.他人虽清贫,但举止并不下作.But in an old man who has known joys and sorrows, and has achieved whatever work it was in him to do, the fear of death is somewhat abject and ignoble.然而老年人已经经历各种欢乐和忧伤,而且成就了他力所能及的一切工作,就他来讲,怕死就有些低贱而卑鄙了.现代英汉综合大辞典 mean [mi:n]vt.(meant [ment])表示...意思, 作...解释意指; 意味着意欲, 打算预定, 指定, 计划有价值, 有重要性引起, 造成What do you mean by saying that?你那样说是什么意思?What does that word mean? (=What is meant by that word?)那个词作什么解释?I mean this one, not that one.我指的是这个, 不是那个.Money means nothing to her.她视金钱如粪土.Health means everything.健康就是一切.I mean business.我是当真的.He means you no harm.他无意伤害你.He did not mean to go.他没打算去.He means this house for his daughter.他预定把这栋房子给女儿.This was meant for a joke.这是笑话.He was meant for [to be] a doctor.本来是准备把他培养成为医生的.Yourfriendshipmeans agreat deal to me.你的友谊对我很重要.Friction means heat.摩擦生热.词性变化mean [mi:n]vi.意欲, 打算, 用意有意义He means well.他出于好意.Environment means much to a child.环境对儿童有着重大意义.习惯用语be meant to do 照道理[照规矩]应该Do you mean to say ...? 你的意思是说...吗? 难道...吗?What do you mean by ...? 你这是什么意思?(=What on earth do you mean by ...?) 你怎么胆敢...? 你怎么竟然...?You don't mean to say so! 你不是这个意思吧! 真的吗?mean ill (to sb. [by sb.]) (对某人)存心不良, (对某人)怀着恶意mean much [a great deal] to sb. 对某人很重要; 对某人很可贵mean sb. for 准备让某人干某工作mean well by [towards, to] sb. 对某人怀好意mean what one says 说的真心话, 是认真说的mean well [kindly] (to sb. [towards sb., by sb.]) (对某人)出于好意; (对某人)抱着帮忙的态度参考词汇[同义词]见 intend
采纳率:95%
来自团队:
你说的是什么意思?1. Iris:What do you mean by that?
艾瑞丝:你那样说是什么意思?2. What do you mean by saying so?
你这么说什么意思?3. What do you mean we have no more milk. I just bought some yesterday.
我们的牛奶又没了,你什么意思,我昨天刚买的。
本回答被提问者和网友采纳
为您推荐:
其他类似问题
您可能关注的内容
换一换
回答问题,赢新手礼包
个人、企业类
违法有害信息,请在下方选择后提交
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。&协助为荷&怎么解释,有否出处?_百度知道
&协助为荷&怎么解释,有否出处?
&协助为荷&怎么解释,有否出处?
我有更好的答案
&为荷&是古代文言书信的常用语。意思是麻烦人家了,“荷”是负担的意思,为荷就是把它当作负担 。在信尾写为荷就是要求人做事了 ,这种词语往往比较文气,所以即使是写白话书信也可以用。“荷”,读第四声。⒈扛,承当,担任:~锄。~枪。~担。负~。~天下之重任。 ⒉感激别人的关心或帮助,常用在书信里。〈表〉礼貌:深深感~。特致谢为~。[希予]希望给予。 [悉]①全;都。②知道。 [系]是
采纳率:83%
为您推荐:
其他类似问题
amp的相关知识
换一换
回答问题,赢新手礼包
个人、企业类
违法有害信息,请在下方选择后提交
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。

我要回帖

更多关于 what do you mean by 的文章

 

随机推荐