国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > C++ > 正文

談一談c++中的unevaluated operand

2019-11-06 07:16:49
字體:
供稿:網(wǎng)友

什么是unevaluated Operand

我們先看2段外文:

In some contexts, unevaluated operands appear (5.2.8, 5.3.3, 5.3.7, 7.1.6.2). An unevaluated operand is not evaluated. An unevaluated operand is considered a full-exPRession. [ Note: In an unevaluated operand, a non-static class member may be named (5.1) and naming of objects or functions does not, by itself, require that a definition be provided (3.2). —end note ] + 5.2.8 covers typeid + 5.3.3 covers sizeof + 5.3.7 covers noexcep + 7.1.6.2 covers simple type specifiers such as auto and decltype and POD types like int, char, double etc.

The operands of the four operators typeid, sizeof, noexcept, and decltype (since C++11) are expressions that are not evaluated (unless they are polymorphic glvalues and are the operands of typeid), since these operators only query the compile-time properties of their operands. Thus, std::size_t n = sizeof(std::cout << 42); does not perform console output. The unevaluated operands are considered to be full expressions even though they are syntactically operands in a larger expression (for example, this means that sizeof(T()) requires an accessible T::~T)

可以這樣理解: 1. unevaluated operand是不被評估的,它是一個完整的表達(dá)式。c++中4個操作符typeid,sizeof, noexcept,decltype對應(yīng)的表達(dá)式是不需要被評估的。 2. unevaluated operand僅僅是查詢編譯期間的相關(guān)屬性,并不會生產(chǎn)運行期的代碼。 3. unevaluated operand不會去完全編譯表達(dá)式,即不會完全檢查編譯的錯誤,但是參數(shù)值和需要推導(dǎo)返回值的地方會執(zhí)行編譯檢查。


發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表

圖片精選

主站蜘蛛池模板: 板桥市| 永登县| 耒阳市| 宜昌市| 永靖县| 莲花县| 宽城| 龙海市| 原阳县| 罗定市| 西乌| 新竹市| 曲靖市| 永州市| 巴彦淖尔市| 民勤县| 福建省| 富民县| 白城市| 白玉县| 舞阳县| 崇礼县| 左贡县| 河间市| 莒南县| 渝北区| 张家口市| 仙桃市| 永靖县| 独山县| 堆龙德庆县| 长岛县| 鹤岗市| 曲周县| 邢台县| 合肥市| 常宁市| 阜城县| 襄樊市| 乌鲁木齐县| 淅川县|