@@ -112,7 +112,7 @@ int main()
112
112
int main ()
113
113
{
114
114
std::allocator<int> a ;
115
- // 警告、戻り地が無視されている
115
+ // 警告、戻り値が無視されている
116
116
a.allocate(1) ;
117
117
118
118
// OK
@@ -354,7 +354,7 @@ std::copy(
354
354
355
355
簡易vectorの概要では、まだ学んでいない機能が使われていた。`class`と`public`と`private`だ。
356
356
357
- C++のクラスにはアクセス指定がある。`public:`と`private:`だ。アクセス指定書かれた後 、別のアクセス指定が現れるまでの間のメンバーは、アクセス指定の影響を受ける。
357
+ C++のクラスにはアクセス指定がある。`public:`と`private:`だ。アクセス指定が書かれた後 、別のアクセス指定が現れるまでの間のメンバーは、アクセス指定の影響を受ける。
358
358
359
359
~~~cpp
360
360
struct C
@@ -569,7 +569,7 @@ public :
569
569
~~~cpp
570
570
void f( std::vector<int> & v )
571
571
{
572
- std::vector<int>::size_type = v.size() ;
572
+ std::vector<int>::size_type s = v.size() ;
573
573
}
574
574
~~~
575
575
@@ -584,11 +584,11 @@ size_type = std::size_t ;
584
584
~~~ cpp
585
585
void f ( std::vector<int > & v )
586
586
{
587
- auto i = v ;
587
+ auto i = v.begin() ;
588
588
auto j = i + 3 ;
589
589
590
590
// iとjの距離
591
- std::vector<int>::difference_type = j - i ;
591
+ std::vector<int>::difference_type d = j - i ;
592
592
}
593
593
~~~
594
594
@@ -744,7 +744,7 @@ int main()
744
744
745
745
すでに学んだようにconst修飾はthisポインターを修飾する。オブジェクトのconst性によって、適切な方のメンバー関数が呼ばれてくれる。
746
746
747
- 簡易vectorでの実装は単にconst就職するだけだ 。
747
+ 簡易vectorでの実装は単にconst修飾するだけだ 。
748
748
749
749
~~~ c++
750
750
iterator begin () const noexcept
@@ -857,7 +857,7 @@ Number zero()
857
857
858
858
class Number
859
859
{
860
- explict Number( int i ) ;
860
+ explicit Number( int i ) ;
861
861
explicit Number( double d ) ;
862
862
explicit Number( std::string s ) ;
863
863
} ;
0 commit comments