回答編集履歴

2

fix typo

2017/05/19 06:01

投稿

yohhoy
yohhoy

スコア6191

test CHANGED
@@ -20,7 +20,7 @@
20
20
 
21
21
 
22
22
 
23
- 構造体同士の等値比較を行いたいのであれば、`operator=`オーバーロードを定義するのが自然です。同関数定義では結局メンバ変数を列挙しないといけませんが、利用側コードはすっきりします。
23
+ 構造体同士の等値比較を行いたいのであれば、`operator==`演算子オーバーロードを定義するのが自然です。同関数定義では結局メンバ変数を列挙しないといけませんが、利用側コードはすっきりします。
24
24
 
25
25
 
26
26
 
@@ -40,7 +40,7 @@
40
40
 
41
41
 
42
42
 
43
- bool operator=(const Human& a, const Human& b) {
43
+ bool operator==(const Human& a, const Human& b) {
44
44
 
45
45
  return (a.sex == b.sex) && (a.age == b.age) && (a.married == b.married);
46
46
 

1

change link url

2017/05/19 06:01

投稿

yohhoy
yohhoy

スコア6191

test CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
 
8
8
 
9
- [Boost.Fusionライブラリ](http://www.boost.org/libs/fusion/doc/html/index.html)を用いれば、[似たようなことを実現](http://faithandbrave.hateblo.jp/entry/20090805/1249460403)できますが、本当にその方法が好ましいかは状況次第かと思います。
9
+ [Boost.Fusionライブラリ](http://www.boost.org/libs/fusion/doc/html/index.html)を用いれば、[似たようなことを実現](https://boostjp.github.io/tips/tuple.html#user-defined-type-as-tuple)できますが、本当にその方法が好ましいかは状況次第かと思います。
10
10
 
11
11
 
12
12