帮助一个c ++语句 [英] Help with a c++ statement

查看:110
本文介绍了帮助一个c ++语句的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下语句来自WebKit。我不是100%肯定这是什么意思。任何线索?

The following statement is from WebKit. I am not 100% sure what it means. Any clues?

new ((void*)&nullAtom) AtomicString;


推荐答案

这是一个刊登位置。这意味着AtomicString对象将被构造在指向括号(& nullAtom)内部的内存位置,而不是通常的行为(构建在从堆中取出的一部分内存上)。

It's a placement-new. It means that the AtomicString object will be constructed at the memory location pointed to inside the parentheses (&nullAtom), rather than the usual behavior (constructed on top of a bit of memory taken off of the heap).

这篇关于帮助一个c ++语句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆