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

隨筆-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久久香蕉加勒比| 日韩视频一区二区三区| 欧美一区二区三区免费观看| 国精品一区二区| 久久亚洲国产成人| 欧美自拍偷拍| 国产精品国产一区二区| 亚洲福利视频二区| 国产精品久久久久aaaa九色| 久久综合狠狠综合久久激情| 国产精品人人做人人爽| 免费的成人av| 正在播放欧美视频| 麻豆精品传媒视频| 99热在这里有精品免费| 在线成人免费视频| 国产亚洲欧美一区二区三区| 久久中文字幕一区| 一区二区日本视频| 久久综合色88| 亚洲午夜一区二区| 亚洲欧洲精品一区二区三区不卡 | 久久aⅴ国产紧身牛仔裤| 亚洲乱码国产乱码精品精可以看| 欧美日韩在线免费视频| 美女精品国产| 久久亚洲免费| 亚洲影院免费| 91久久黄色| 亚洲第一成人在线| 国产综合第一页| 欧美日韩欧美一区二区| 欧美午夜在线一二页| 亚洲国产女人aaa毛片在线| 国产亚洲一区在线| 国产乱码精品一区二区三| 免费不卡亚洲欧美| 欧美激情精品久久久久久大尺度| 欧美激情乱人伦| 欧美日韩国产综合视频在线观看中文 | 日韩午夜在线观看视频| 一区二区三区视频免费在线观看| 亚洲经典视频在线观看| 亚洲一区三区视频在线观看| 亚洲美女毛片| 亚洲特级毛片| 欧美一区二区播放| 欧美小视频在线观看| 久久久久国产精品午夜一区| 欧美一区二区三区成人| 欧美区日韩区| 国产综合精品一区| 亚洲三级性片| 美女免费视频一区| 欧美伦理影院| 国产一区三区三区| 久久五月婷婷丁香社区| 一本不卡影院| 欧美激情一区二区三区不卡| 欧美日韩三级电影在线| 亚洲欧洲视频在线| 久久久国产成人精品| 99视频精品免费观看| 亚洲一区国产一区| 性视频1819p久久| 国产精品久久久久一区二区| 亚洲欧美日韩天堂一区二区| 久久永久免费| 香蕉乱码成人久久天堂爱免费| 欧美精品久久一区| 亚洲日韩成人| 亚洲黄色影院| 国产精品久久久久久久久久三级| 国产一区高清视频| 亚洲激情第一页| 久久先锋影音| 久久先锋资源| 久久久综合网站| 99精品欧美一区二区蜜桃免费| 亚洲一区二区三区四区视频| 9l国产精品久久久久麻豆| 性色av一区二区三区| 久久久一本精品99久久精品66| 最近中文字幕mv在线一区二区三区四区| 欧美在线免费一级片| 亚洲欧美成人| 尤物精品国产第一福利三区| 亚洲看片免费| 一区二区在线免费观看| 久久久久国产成人精品亚洲午夜| 国产一区二区三区免费观看| 免费成人激情视频| 美女成人午夜| 久久九九99视频| 蜜桃久久精品一区二区| 欧美护士18xxxxhd| 黄色成人精品网站| 欧美亚洲在线视频| 亚洲精品国产精品乱码不99按摩| 91久久精品国产91性色| 国产在线观看精品一区二区三区| 香蕉尹人综合在线观看| 亚洲国产一区二区a毛片| 亚洲国产人成综合网站| 一本一本久久a久久精品综合麻豆 一本一本久久a久久精品牛牛影视 | 麻豆精品视频在线观看视频| 日韩小视频在线观看专区| 久久久久国色av免费看影院| 欧美激情按摩在线| 亚洲国产日韩在线| 免费h精品视频在线播放| 亚洲国产精品ⅴa在线观看| 国内精品久久久久影院 日本资源| 欧美日韩大片| 亚洲在线观看视频网站| 久久亚洲午夜电影| 欧美色欧美亚洲另类二区| 欧美一二三区精品| 亚洲全部视频| 久久免费午夜影院| 亚洲第一福利视频| 欧美精品二区| 午夜精品一区二区三区在线播放| 欧美欧美天天天天操| 亚洲免费视频在线观看| 欧美激情精品久久久久久久变态| 亚洲国产一区二区在线| 狠狠色综合网站久久久久久久| 正在播放欧美视频| 久久国产日韩| 日韩一级视频免费观看在线| 国内久久婷婷综合| 国产乱肥老妇国产一区二| 欧美经典一区二区三区| 久久蜜桃香蕉精品一区二区三区| 亚洲午夜极品| 欧美+日本+国产+在线a∨观看| 亚洲一区二区在线播放| 亚洲国产日韩美| 亚洲国产精品成人精品| 国内精品久久久久久久影视麻豆 | 欧美激情在线免费观看| 韩国欧美国产1区| 亚洲电影免费观看高清完整版在线| 欧美日韩福利视频| 欧美日产在线观看| 国产日韩成人精品| 国产欧美在线观看一区| 一区视频在线| 亚洲国产精品一区| 亚洲美女在线国产| 宅男66日本亚洲欧美视频| 宅男精品视频| 欧美日韩免费精品| 亚洲国产三级| 欧美在线日韩精品| 久久综合给合| 久久精品国产久精国产爱| 亚洲图片激情小说| 欧美成人精品高清在线播放| 亚洲国产一区二区视频| 国产精品亚发布| 一区二区三区免费观看| 久久亚洲高清| 久久综合久久久久88| 黄色成人av在线| 欧美大片在线观看一区| 久久精品国产欧美激情| 一区二区精品| 欧美国产一区二区| 国产精品亚洲激情| 亚洲日本欧美在线| 欧美喷水视频| 久久国产视频网站| 另类亚洲自拍| 99视频日韩| 久久天天躁狠狠躁夜夜爽蜜月| 一本色道久久综合狠狠躁的推荐| 亚洲综合国产激情另类一区| 在线观看欧美精品| 亚洲一区免费看| 一区二区三区国产精品| 久久久91精品国产| 欧美一级视频一区二区| 国产日韩一级二级三级| 久久婷婷丁香| 亚洲狠狠婷婷| 小嫩嫩精品导航| 欧美呦呦网站| 国语自产精品视频在线看抢先版结局| 亚洲视频在线观看免费| 亚洲视频你懂的| 久久久久久久久久久久久久一区 | 亚洲欧美日韩在线不卡| 久久精品国产在热久久 | 亚洲一区精彩视频| 国产精品午夜视频| 狠狠色综合色区| 一本久久青青|