青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

隨筆-90  評論-947  文章-0  trackbacks-0

3.10 Lvalues and rvalues [basic.lval]

左值和右值

1 Every expression is either an lvalue or an rvalue.

表達式不是左值就是右值。

2 An lvalue refers to an object or function. Some rvalue expressions—those of class or cv-qualified class type—also refer to objects. 47)

左值是指一個對象或者函數。某些右值(那些帶或不帶cv限定符的類類型)也是對象。

3 [Note:
some built-in operators and function calls yield lvalues. [Example: if E is an expression of pointer type, then *E is an lvalue expression referring to the object or function to which E points. As another example, the function
int& f();
yields an lvalue, so the call f() is an lvalue expression. ] ]

[注意:某些內置運算符以及一些函數調用會返回左值。[例1:如果 E 是一個指針類型的表達式,那么 *E 是一個左值表達式,指示指針 E 所指向的那個對象或者函數。例2:函數
int& f();
返回左值,所以函數調用 f() 是一個左值表達式。] ]

4 [Note: some built-in operators expect lvalue operands. [Example: built-in assignment operators all expect their left hand operands to be lvalues. ] Other built-in operators yield rvalues, and some expect them. [Example: the unary and binary + operators expect rvalue arguments and yield rvalue results. ] The discussion of each built-in operator in clause 5 indicates whether it expects lvalue operands and whether it yields an lvalue. ]

[注意:某些內置運算符需要左值操作數。[例:所有內置的賦值運算符的左操作數都必須是左值。] 有些內置運算符會返回右值結果,有些會需要右值操作數。[例:一元運算符“+”和二元運算符“+”都需要右值操作數,并且返回右值結果。] 我們在條款 5 中會對所有內置運算符進行討論,指出它們的操作數和返回結果是左值還是右值。]

5 The result of calling a function that does not return a reference is an rvalue. User defined operators are functions, and whether such operators expect or yield lvalues is determined by their parameter and return
types.

調用返回值為非引用類型的函數,結果是右值。用戶自定義的運算符也是函數,這些運算符的操作數以及結果是左值還是右值,取決于(運算符重載)函數的參數和返回值類型。

6 An expression which holds a temporary object resulting from a cast to a nonreference type is an rvalue (this includes the explicit creation of an object using functional notation (5.2.3)).

對非引用類型的轉換表達式(包括使用函數式的記號進行顯示創建)是右值,它將返回一個臨時對象。


__________________
47) Expressions such as invocations of constructors and of functions that return a class type refer to objects, and the implementation can invoke a member function upon such objects, but the expressions are not lvalues.

有些表達式,比如調用構造函數的表達式,以及調用返回類類型的函數的表達式,它們也是對象,且可以對它們調用成員函數,但這種表達式不是左值。

____________________________________華麗的分頁符____________________________________

 

7 Whenever an lvalue appears in a context where an rvalue is expected, the lvalue is converted to an rvalue; see 4.1, 4.2, and 4.3.

如果在一個需要右值的場合出現了左值,這個左值將被轉換成右值。
見 4.1、4.2、4.3。

8 The discussion of reference initialization in 8.5.3 and of temporaries in 12.2 indicates the behavior of lvalues and rvalues in other significant contexts.

12.2 中關于引用的初始化和關于臨時對象的討論,也指出了左右值在其他重要場合的行為。

9 Class rvalues can have cv-qualified types; non-class rvalues always have cv-unqualified types. Rvalues shall always have complete types or the void type; in addition to these types, lvalues can also have incomplete types.

類類型的右值可以具有 cv 限定符;非類類型的右值不能被 cv 限定符修飾。右值通常是完整類型或者 void 類型,而對于左值來說,除了完整類型和 void 類型外,還可以是不完整類型。

10 An lvalue for an object is necessary in order to modify the object except that an rvalue of class type can also be used to modify its referent under certain circumstances. [Example: a member function called for an object (9.3) can modify the object. ]

通常情況下,如果要修改一個對象,它必須是左值。但在某些特定的場合,右值形式的類對象也可以被修改。[例:調用一個對象的成員函數(9.3),可以修改對象本身。]

11 Functions cannot be modified, but pointers to functions can be modifiable.

函數(對象)不能(在運行時)被修改,但是函數指針可以。

12 A pointer to an incomplete type can be modifiable. At some point in the program when the pointed to type is complete, the object at which the pointer points can also be modified.

指向一個不完整類型的指針可能是可修改的。當這個被指向的類型某時某刻成為完整類型后,這個指針所指向的那個對象也是可修改的。

13 The referent of a const-qualified expression shall not be modified (through that expression), except that if it is of class type and has a mutable component, that component can be modified (7.1.5.1).

被 const 限定的表達式所對應的對象不能(通過該表達式)被修改;除非這個對象是類類型并且含有 mutable 成員,此時該 mutable 成員可以被修改。

14 If an expression can be used to modify the object to which it refers, the expression is called modifiable. A program that attempts to modify an object through a nonmodifiable lvalue or rvalue expression is illformed.

如果一個表達式可以被用來修改此表達式對應的對象,那么這個表達式被稱為可修改的。企圖通過一個不可修改的左值者右值表達式去修改一個對象,是非法的。

15 If a program attempts to access the stored value of an object through an lvalue of other than one of the following types the behavior is undefined 48):
— the dynamic type of the object,
— a cv-qualified version of the dynamic type of the object,
— a type that is the signed or unsigned type corresponding to the dynamic type of the object,
— a type that is the signed or unsigned type corresponding to a cv-qualified version of the dynamic type of
the object,
— an aggregate or union type that includes one of the aforementioned types among its members (including,
recursively, a member of a subaggregate or contained union),
— a type that is a (possibly cv-qualified) base class type of the dynamic type of the object,
— a char or unsigned char type.

如果程序通過下列類型之外類型的左值訪問一個對象的值,其行為是未定義的:

——對象的動態類型;
——CV 限定的對象動態類型;
——對象的動態類型對應的有符號或無符號類型;
——CV 限定的對象動態類型有符號或無符號類型;
——一個成員中含有聚合或者聯合類型的聚合或者聯合類型(包括遞歸形式的定義以及成員中有子聚合類型或者包含一個聯合)
——對象的動態類型的基類類型(可以被 cv 限定符修飾)
——char 或 unsigned char 類型


__________________
48) The intent of this list is to specify those circumstances in which an object may or may not be aliased.
給出這份列表的目的是指明一些特定情形,在這些情形下對象可能被重疊,但也有可能不是,我們無法預知。

____________________________________華麗的分隔符____________________________________

 

以上,求指正,包括理解誤區和語言組織不合理的,歡迎指出~ ^_^

posted on 2012-02-29 22:50 溪流 閱讀(1592) 評論(0)  編輯 收藏 引用 所屬分類: C++
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            韩国福利一区| 欧美激情一区| 韩国在线一区| 久久一区中文字幕| 久久精品91| 亚洲国产精品小视频| 亚洲三级观看| 欧美日韩国产精品一卡| 午夜综合激情| 久久久噜噜噜| 亚洲调教视频在线观看| 亚洲中字在线| 亚洲精品免费一区二区三区| 日韩一级免费| 黄色小说综合网站| 亚洲日本成人在线观看| 国产精品一区一区三区| 美腿丝袜亚洲色图| 欧美午夜性色大片在线观看| 久久久久久久97| 欧美精品三级在线观看| 久久成人在线| 欧美精品一区二区三区视频| 欧美亚洲视频| 欧美激情中文字幕乱码免费| 欧美影院成人| 欧美欧美天天天天操| 久久久夜精品| 国产精品乱子乱xxxx| 欧美成人午夜剧场免费观看| 国产精品成人观看视频国产奇米| 久久婷婷国产综合精品青草| 欧美三日本三级三级在线播放| 久久综合给合| 国产精品成人久久久久| 欧美国产日韩一区二区在线观看 | 亚洲一区二区三区色| 在线观看欧美日韩| 亚洲一区精品电影| 在线视频你懂得一区| 久久九九精品99国产精品| 亚洲欧美欧美一区二区三区| 欧美成人一区二区三区片免费| 欧美一区二区网站| 欧美午夜不卡在线观看免费| 亚洲福利视频一区二区| 国产一区二区三区高清播放| 亚洲一区网站| 亚洲在线视频观看| 欧美日韩小视频| 亚洲韩日在线| 亚洲国产专区校园欧美| 久久久久久久久一区二区| 欧美一区二区三区免费看| 国产精品久久久久久久久久尿| 亚洲欧洲在线视频| 日韩亚洲欧美中文三级| 欧美精品国产一区| 亚洲日本成人网| 日韩天天综合| 欧美日韩在线影院| 99视频热这里只有精品免费| 99re视频这里只有精品| 欧美黄色一级视频| 亚洲精品一区中文| 亚洲深夜福利在线| 国产精品成av人在线视午夜片| 日韩视频永久免费| 亚洲一区二区三区精品在线观看| 欧美日韩a区| 亚洲一区二区免费视频| 欧美在线精品一区| 狠狠色综合色综合网络| 美女露胸一区二区三区| 欧美激情偷拍| 中国亚洲黄色| 国产亚洲二区| 美日韩精品视频免费看| 亚洲精品一区在线观看| 香蕉久久夜色精品国产| 国产一区清纯| 欧美成人一区二区| 亚洲手机成人高清视频| 久久久久久久综合| 亚洲国产专区校园欧美| 欧美日韩在线大尺度| 亚洲欧美www| 免费久久99精品国产自| 99精品欧美一区二区三区综合在线| 欧美视频在线观看免费| 欧美在线网站| 亚洲三级免费电影| 欧美在线观看一区| 亚洲国产天堂久久国产91| 欧美日韩在线不卡一区| 久久精品国产清自在天天线| 亚洲国产精品成人精品| 亚洲欧美日韩综合国产aⅴ| 黑人巨大精品欧美一区二区小视频| 欧美国产极速在线| 欧美一区二区精美| 日韩视频精品在线| 狼狼综合久久久久综合网| 一区二区欧美激情| 国语精品中文字幕| 久久精品官网| 亚洲午夜小视频| 欧美激情1区2区| 亚洲综合色婷婷| 亚洲第一在线综合网站| 国产精品一级久久久| 欧美国产亚洲另类动漫| 久久成人18免费观看| 一本综合久久| 亚洲欧洲精品一区二区精品久久久| 久久精品久久99精品久久| 在线天堂一区av电影| 亚洲人成小说网站色在线| 国产香蕉久久精品综合网| 欧美视频在线观看一区| 欧美精品三级| 男女激情久久| 久久蜜桃av一区精品变态类天堂| 亚洲在线观看免费| 在线亚洲伦理| 99re6这里只有精品| 亚洲精品韩国| 欧美国产丝袜视频| 欧美 日韩 国产一区二区在线视频 | 亚洲性线免费观看视频成熟| 亚洲黄网站黄| 亚洲国产精品一区二区第四页av| 国内精品久久久久伊人av| 国产视频亚洲精品| 国产日韩欧美视频在线| 国产精品一区二区三区四区| 国产精品一卡二卡| 国产精品男女猛烈高潮激情 | 欧美偷拍另类| 欧美视频一区二区三区…| 欧美日韩视频在线一区二区观看视频| 免费在线观看成人av| 农村妇女精品| 欧美国产一区二区| 欧美日本精品一区二区三区| 欧美日韩免费精品| 欧美色欧美亚洲另类二区| 国产精品第一区| 国产精品亚洲第一区在线暖暖韩国 | 亚洲福利电影| 亚洲高清在线观看一区| 亚洲国产日韩欧美在线动漫| 欧美激情一二区| 亚洲看片网站| 亚洲深夜激情| 久久成人精品无人区| 久久久久在线观看| 欧美精品尤物在线| 国产精品久久久久高潮| 国产亚洲欧美aaaa| 亚洲黑丝在线| 亚洲一区二区三区中文字幕在线| 亚洲欧美视频一区二区三区| 久久国产免费| 模特精品在线| 亚洲最黄网站| 久久精品成人| 欧美日韩亚洲一区二区三区在线观看| 欧美涩涩视频| 在线日韩中文| 一区二区免费在线播放| 久久久久欧美| 99精品视频免费全部在线| 小黄鸭视频精品导航| 蜜桃av一区二区| 国产精品一区二区久激情瑜伽| 国外成人免费视频| 亚洲一线二线三线久久久| 久久永久免费| 亚洲一区二区三区视频播放| 久久一二三国产| 国产精品视频一二三| 亚洲人成7777| 久久亚洲国产精品一区二区| 日韩午夜电影| 久久亚洲综合色一区二区三区| 国产精品都在这里| 日韩亚洲一区二区| 老鸭窝91久久精品色噜噜导演| 一区二区三区欧美在线| 欧美成人性生活| 国产一区二区视频在线观看| 中文网丁香综合网| 亚洲国产成人高清精品| 亚洲欧美日韩人成在线播放| 欧美精品久久久久久久免费观看| 国内精品久久久| 午夜在线成人av| 亚洲精品乱码久久久久久久久 | 欧美电影免费观看|