回答編集履歴
2
コードの修正
answer
CHANGED
|
@@ -15,8 +15,7 @@
|
|
|
15
15
|
void LeftAndRight(in int x);
|
|
16
16
|
|
|
17
17
|
void Example(int x){
|
|
18
|
-
Left(ref x); //左辺値
|
|
19
|
-
Left(out int y); //左辺値
|
|
18
|
+
Left(ref x,out int y); //左辺値
|
|
20
19
|
LeftAndRight(in x); //左辺値
|
|
21
20
|
LeftAndRight(x+x); //右辺値
|
|
22
21
|
}
|
1
**C#**をC#に修正
answer
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
### 狭義の参照渡し
|
|
10
10
|
ここでは前述の二つの手続きのうちいずれかを言語仕様として採用するケースを指します
|
|
11
|
-
例えば
|
|
11
|
+
例えばC#では```ref/out```が左辺値参照、```in```が左辺値及び右辺値参照の両方をサポートします
|
|
12
12
|
```
|
|
13
13
|
class Value{
|
|
14
14
|
void Left(ref int x,out int y);
|