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

隨筆-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 溪流 閱讀(1597) 評論(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>
            欧美在线观看www| 国内精品久久久久久 | 欧美黄色免费网站| 欧美一级二区| 亚洲在线中文字幕| 在线亚洲欧美视频| 亚洲视频欧洲视频| 99在线精品免费视频九九视| 免费视频亚洲| 午夜日韩av| 欧美一区二区三区视频在线 | 日韩视频精品在线| 亚洲性夜色噜噜噜7777| 日韩视频久久| 一本色道久久加勒比精品| 亚洲精品免费在线| 亚洲国产高潮在线观看| 欧美成人免费va影院高清| 亚洲一区二区三区激情| 国产美女精品免费电影| 亚洲自拍偷拍色片视频| 午夜影视日本亚洲欧洲精品| 欧美一级视频精品观看| 久久久欧美精品| 欧美日本韩国一区| 国产乱肥老妇国产一区二| 国产亚洲欧洲一区高清在线观看| 国产亚洲精品一区二区| 亚洲国产欧美日韩精品| 亚洲免费av电影| 在线视频精品| 久久久久久久久伊人| 欧美成人精品一区二区| 亚洲欧美自拍偷拍| 99国产一区| 西西裸体人体做爰大胆久久久| 欧美一级视频免费在线观看| 久久综合影视| 99在线热播精品免费| 欧美一区成人| 欧美二区乱c少妇| 国产精品亚洲аv天堂网| 国产精品欧美一区二区三区奶水| 国产一区二区高清视频| 亚洲免费观看视频| 久久精品男女| 亚洲精品影院在线观看| 欧美在线不卡视频| 国产精品超碰97尤物18| 亚洲激情成人网| 久久精品国产第一区二区三区最新章节| 久久一区二区精品| 在线视频精品| 你懂的国产精品| 欧美性猛片xxxx免费看久爱| 国产真实精品久久二三区| 日韩一级成人av| 亚洲综合成人婷婷小说| 性欧美videos另类喷潮| 亚洲黄色小视频| 久久精品一区蜜桃臀影院| 国产精品a久久久久久| 亚洲片国产一区一级在线观看| 欧美在线一区二区三区| 亚洲精品综合在线| 免费观看日韩| 在线精品视频免费观看| 久久久国产精品一区| 亚洲美女av黄| 久久久夜精品| 欧美一区二区三区电影在线观看| 欧美高清视频一区二区| 精品成人在线视频| 亚洲欧美日本精品| 亚洲欧洲日本在线| 欧美国产精品一区| 影音先锋亚洲精品| 麻豆国产va免费精品高清在线| 性欧美1819性猛交| 国产偷自视频区视频一区二区| 亚洲一区二区三区四区视频| 看片网站欧美日韩| 久久久久久久久久久久久女国产乱 | 欧美一区成人| 一本色道久久加勒比精品| 久久久综合网| 国产精品素人视频| 久久成人精品电影| 亚洲一区二区精品在线| 国产精品红桃| 久久国产精品一区二区三区| 亚洲欧美精品在线| 国产一区在线看| 欧美日韩国产精品自在自线| 亚洲精品国产精品国产自| 亚洲丁香婷深爱综合| 免费欧美日韩| 一区二区三区国产在线| 久久精品日韩一区二区三区| 日韩视频亚洲视频| 欧美日韩亚洲另类| 亚洲欧美卡通另类91av| 99re8这里有精品热视频免费| 欧美激情无毛| 亚洲国产欧美在线| 亚洲精品视频在线观看网站| 欧美三区美女| 欧美在线一二三四区| 久久精品午夜| 99精品欧美一区二区三区| 亚洲一区二区欧美| 国内精品一区二区三区| 欧美激情一区二区三区高清视频| 欧美激情1区2区| 性色av一区二区三区红粉影视| 久久久久九九视频| 99精品欧美| 欧美一区=区| 一区二区三区日韩在线观看| 99视频精品在线| 欧美影院视频| 亚洲乱码精品一二三四区日韩在线| 黄色成人av网站| 亚洲精品人人| 尤物精品国产第一福利三区 | 国产一区二区三区观看| 亚洲国语精品自产拍在线观看| 国产精品视频福利| 亚洲高清视频在线| 国语自产偷拍精品视频偷| 日韩一级片网址| 在线观看视频一区二区| 亚洲一区免费观看| 亚洲精品免费看| 久久蜜臀精品av| 久久久久久精| 国产伦理一区| 99国内精品久久| 亚洲狼人精品一区二区三区| 99riav久久精品riav| 国产精品99一区二区| 欧美大学生性色视频| 国产日韩欧美一区二区三区在线观看| 亚洲国产精品久久人人爱蜜臀 | 一本色道久久综合一区| 六月丁香综合| 久久精品国产清自在天天线| 国产精品啊v在线| 日韩亚洲国产精品| 亚洲国产精品久久久| 亚洲成色精品| 一区二区三区在线视频免费观看| 亚洲网站视频| 亚洲一区亚洲二区| 国产精品久久久久久一区二区三区| 亚洲日本中文字幕| 亚洲精品国产精品国自产在线| 久久成人精品一区二区三区| 亚洲在线观看视频| 久久亚洲精品欧美| 六月丁香综合| 亚洲午夜三级在线| 先锋影音国产精品| 美女脱光内衣内裤视频久久网站| 亚洲国产天堂久久综合网| 欧美色综合网| 久久男女视频| 一区二区日韩免费看| 巨乳诱惑日韩免费av| 中文在线资源观看网站视频免费不卡| 国产精品igao视频网网址不卡日韩| 亚洲男人的天堂在线观看| 蜜臀久久久99精品久久久久久| 一区二区三区福利| 永久免费毛片在线播放不卡| 欧美精品日韩三级| 久久成年人视频| 亚洲精品欧美日韩| 久久久爽爽爽美女图片| 夜夜爽夜夜爽精品视频| 韩日精品在线| 欧美午夜宅男影院| 免费试看一区| 欧美怡红院视频| 99精品热视频只有精品10| 国产伦精品一区二区三区照片91 | 亚洲成在线观看| 国产精品高清在线观看| 嫩草成人www欧美| 久久精品理论片| 亚洲一区二区三区四区中文| 亚洲高清自拍| 欧美xxx成人| 久久精品国产欧美亚洲人人爽| 夜夜嗨av一区二区三区| 亚洲国产精品久久久久秋霞影院| 国产日韩成人精品| 欧美视频在线一区二区三区| 欧美国产精品久久| 欧美成人免费视频|