|
7 | 7 | <!-- called ‘unsized’ or ‘dynamically sized’ types. One example is `[T]`. This type --> |
8 | 8 | <!-- represents a certain number of `T` in sequence. But we don’t know how many --> |
9 | 9 | <!-- there are, so the size is not known. --> |
10 | | -多くの方はコンパイル時に知ることのできる特定のバイトサイズを持っています。 |
| 10 | +ほとんどの型はコンパイル時に知れる、バイト数で測った、サイズがあります。 |
11 | 11 | 例えば、 `i32` 型は、32ビット(4バイト)というサイズです。 |
12 | 12 | しかしながら、表現のためには便利であってもサイズが定まっていない型が存在します。 |
13 | 13 | そのような方を 「サイズ不定」又は「動的サイズ」型と呼びます。 |
14 | | -一例を上げると `[T]` 型は `T` のシーケンスを意味しており、その要素数については規定されていないため、サイズは不定となります。 |
| 14 | +一例を上げると `[T]` 型は 一定のサイズの`T` のシーケンスを意味していますが、その要素数については規定されていないため、サイズは不定となります。 |
15 | 15 |
|
16 | 16 | <!-- Rust understands a few of these types, but they have some restrictions. There --> |
17 | 17 | <!-- are three: --> |
@@ -46,7 +46,7 @@ impl<T> Foo for [T] { |
46 | 46 | ``` |
47 | 47 |
|
48 | 48 | <!-- Instead, you would have to write: --> |
49 | | -このように書く代わりに、以下のように書く必要があることに鳴るでしょう: |
| 49 | +このように書く代わりに、以下のように書く必要があることになるでしょう: |
50 | 50 |
|
51 | 51 | ```rust,ignore |
52 | 52 | impl Foo for &str { |
@@ -76,5 +76,5 @@ struct Foo<T: ?Sized> { |
76 | 76 | <!-- This `?`, read as “T may be `Sized`”, means that this bound is special: it --> |
77 | 77 | <!-- lets us match more kinds, not less. It’s almost like every `T` implicitly has --> |
78 | 78 | <!-- `T: Sized`, and the `?` undoes this default. --> |
79 | | -`?` は 「Tは `Sized` かもしれない」と読みます、これはこれが特別な境界: より小さいカインドとマッチするのではなく、より大きいカインドとマッチする ということを意味しています。 |
| 79 | +`?` は 「Tは `Sized` かもしれない」と読みます、これは `?` が特別な境界: より小さいカインドとマッチするのではなく、より大きいカインドとマッチする ということを意味しています。 |
80 | 80 | これは、すべての `T` は暗黙的に `T : Sized` という制限がかけられていて、 `?` はその制限を解除するというようなものです。 |
0 commit comments