Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
C-sharp language specification.2004.pdf
Скачиваний:
14
Добавлен:
23.08.2013
Размер:
2.55 Mб
Скачать

Chapter 12 Variables

1also generates a compile-time error since the assignment to n in the anonymous method has no affect on the

2definite assignment state of n outside the anonymous method. end example]

312.3.3.28 Yield statements

4For a yield return statement stmt of the form:

5yield return expr ;

6A variable v has the same definite assignment state at the beginning of expr as at the beginning of stmt.

7If a variable v is definitely assigned at the end of expr, it is definitely assigned at the end point of stmt;

8otherwise, it is not definitely assigned at the end point of stmt.

912.4 Variable references

10A variable-reference is an expression that is classified as a variable. A variable-reference denotes a storage

11location that can be accessed both to fetch the current value and to store a new value.

12variable-reference:

13

expression

14[Note: In C and C++, a variable-reference is known as an lvalue. end note]

1512.5 Atomicity of variable references

16Reads and writes of the following data types shall be atomic: bool, char, byte, sbyte, short, ushort,

17uint, int, float, and reference types. In addition, reads and writes of enum types with an underlying type

18in the previous list shall also be atomic. Reads and writes of other types, including long, ulong, double,

19and decimal, as well as user-defined types, need not be atomic. Aside from the library functions designed

20for that purpose, there is no guarantee of atomic read-modify-write, such as in the case of increment or

21decrement.

129

Соседние файлы в предмете Электротехника