国产探花免费观看_亚洲丰满少妇自慰呻吟_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ā)表

圖片精選

主站蜘蛛池模板: 纳雍县| 阳城县| 万州区| 红河县| 宁夏| 龙南县| 郧西县| 岳西县| 遵义市| 葫芦岛市| 抚州市| 马边| 怀安县| 布尔津县| 招远市| 沁源县| 宕昌县| 思茅市| 勐海县| 辽中县| 吉首市| 顺平县| 蛟河市| 定襄县| 上饶市| 上虞市| 新昌县| 余姚市| 合江县| 横峰县| 同江市| 铁岭县| 景宁| 门源| 永嘉县| 德格县| 浦城县| 汤原县| 策勒县| 察雅县| 云龙县|