Skip to content

Commit 66f9c10

Browse files
authored
Merge pull request EzoeRyou#19 from kajyuuen/fix-typos-016
Fix typos
2 parents 3d236a6 + 75ed5d3 commit 66f9c10

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

016-algorithm.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ auto print_if_le_100 = []( auto first, auto last )
8181
if ( *iter <= 100 )
8282
std::cout << *iter ;
8383
}
84-
} ;
84+
} ;
8585

8686

8787
// 値を2倍して出力
@@ -91,7 +91,7 @@ auto print_twice = []( auto first, auto last )
9191
{ // 特別な処理
9292
std::cout << 2 * (*iter) ;
9393
}
94-
} ;
94+
} ;
9595

9696

9797
// 値を出力するたびに改行を出力
@@ -101,7 +101,7 @@ auto print_with_newline = []( auto first, auto last )
101101
{ // 特別な処理
102102
std::cout << *iter << "\n"s ;
103103
}
104-
} ;
104+
} ;
105105
~~~
106106

107107
これを見ると、for文によるイテレーターのループは全く同じコードだとわかる。
@@ -1115,7 +1115,7 @@ auto generate_n = []( first, n, gen )
11151115
auto last2 = remove( first, last, value ) ;
11161116
~~~
11171117

1118-
この例では、`remove``[first,last)`から値`value`に等しい要素を取り除いたイテレーターの範囲を戻り地として返す。その戻り値が`last2`だ。`[first,last2)`が値を取り除いた後の新しいイテレーターの範囲だ。
1118+
この例では、`remove``[first,last)`から値`value`に等しい要素を取り除いたイテレーターの範囲を戻り値として返す。その戻り値が`last2`だ。`[first,last2)`が値を取り除いた後の新しいイテレーターの範囲だ。
11191119

11201120
`remove`を呼び出しても元のvectorの要素数が変わることはない。`remove`はvectorの要素の値を変更するだけだ。
11211121

@@ -1162,7 +1162,7 @@ int main()
11621162

11631163
`remove`は現在知っている知識だけではまだ完全に実装できない。以下は不完全な実装の例だ。`remove`を完全に理解するためには`ムーブセマンティクス`の理解が必要だ。
11641164

1165-
~~~
1165+
~~~cpp
11661166
auto remove_if = []( auto first, auto last, auto pred )
11671167
{
11681168
// removeする最初の要素
@@ -1184,7 +1184,7 @@ auto remove_if = []( auto first, auto last, auto pred )
11841184
*removing = *remaining ;
11851185
++removing ;
11861186
}
1187-
1187+
11881188
}
11891189
// 新しい終端イテレーター
11901190
return removing ;

017-lambda.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
実は以下の形の関数は、「関数」ではない。
44

55
~~~cpp
6-
auto function = [](auto value ) { return value } ;
6+
auto function = []( auto value ) { return value } ;
77
~~~
88
99
これは`ラムダ式`と呼ばれるC++の機能で、関数のように振る舞うオブジェクトを作るための式だ。
@@ -77,7 +77,7 @@ int main()
7777
`ラムダ式```なので、そのまま`関数呼び出し`することもできる。
7878

7979
~~~cpp
80-
void f( std::string x
80+
void f( std::string x )
8181
{
8282
std::cout << x ;
8383
}

019-operator-overloading.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -373,8 +373,8 @@ struct fractional
373373
// デリゲートコンストラクター
374374
fractional( int num )
375375
: fractional( num, 1 )
376-
{ }
377-
}
376+
{ }
377+
} ;
378378
~~~
379379
380380
`デリゲートコンストラクター`は初期化処理を別のコンストラクターにデリゲート(丸投げ)する。丸投げ先のコンストラクターの初期化処理が終わり次第、デリゲートコンストラクターの関数の本体が実行される。
@@ -392,7 +392,7 @@ struct S
392392
{
393393
std::cout << "constructor\n" ;
394394
}
395-
}
395+
} ;
396396
397397
int main()
398398
{
@@ -669,7 +669,7 @@ int main()
669669
{
670670
X x ;
671671
Y y ;
672-
672+
673673
// OK
674674
x + y ;
675675

@@ -906,7 +906,7 @@ s + s ;
906906
を可能にするクラスSに対する`operator +`は、
907907

908908
~~~cpp
909-
struct S { }
909+
struct S { }
910910
S operator + ( S const &, S const & ) ;
911911
~~~
912912

020-array.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ int main()
4545
std::cin >> N ;
4646

4747
// 要素数N
48-
std::vector<int> v(N) ;
48+
std::vector<int> v(N) ;
4949
}
5050
~~~
5151

@@ -149,4 +149,4 @@ int main()
149149

150150
その他の`array`の使い方は、`vector`とほぼ同じだ。
151151

152-
さて、これから'array'を実装していこう。実装を通じて読者はC++のクラスとその他の機能を学んでいくことになる。
152+
さて、これから`array`を実装していこう。実装を通じて読者はC++のクラスとその他の機能を学んでいくことになる。

022-implement-array.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,11 +203,11 @@ struct array_int_3
203203
array_int_3( array_int_3 const & other )
204204
{
205205
std::copy(
206-
std::begin(other.storage), std::end(otherstorage),
206+
std::begin(other.storage), std::end(other.storage),
207207
std::begin(storage)
208208
) ;
209209
210-
210+
211211
}
212212
}
213213
~~~

0 commit comments

Comments
 (0)