English 中文(简体)
“指定人未被任何其他点人所混淆”的含义是什么?
原标题:What s the duration of "pointer not aliased by any other pointer" implication?
最佳回答

The standard has this to say about "object lifetime" (§3.8 in N3290):

The lifetime of an object of type T ends when:
— if T is a class type with a non-trivial destructor (12.4), the destructor call starts, or
— the storage which the object occupies is reused or released.

在您通过<条码>免费后,该物体已亡故。 它已经不复存在。 忽略该点人是不明确的行为。

可以分配同样的记忆地址,但不会有“别”的东西:该地点的情况已经消失。

问题回答

因为一旦你释放(主题1),通过记忆1点人获取任何东西都是不明确的行为(新陈词,等等),因此,汇编者可以优化假设,在小鼠打电话后,其他任何点人不会把记忆2混为一谈。

因此,假定汇编者自己没有内部资料,说明小型(小型)的属性,即它只处理它与其他任何职能一样,则不能假定被送回的点子不是由任何其他点人所决定的。 declspec(restrict) (或等同,attribute__(malloc)>, inlberg) 告知汇编者,该点人不是由任何其他点人挑选的,因此无法以其他方式加以优化。





相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?