Kouhei Sutou
null+****@clear*****
Thu Oct 4 10:38:59 JST 2012
Kouhei Sutou 2012-03-15 16:33:00 +0900 (Thu, 15 Mar 2012) New Revision: e1c194f8805b2810ad6fff6b4b960f6a4c28a9f0 https://github.com/mroonga/mroonga/commit/e1c194f8805b2810ad6fff6b4b960f6a4c28a9f0 Log: doc coding-style: add about copy constructor Modified files: doc/source/developer/coding_style.rst Modified: doc/source/developer/coding_style.rst (+29 -0) =================================================================== --- doc/source/developer/coding_style.rst 2012-03-15 15:59:09 +0900 (f85d1d8) +++ doc/source/developer/coding_style.rst 2012-03-15 16:33:00 +0900 (2a0b109) @@ -264,3 +264,32 @@ TODO: ちゃんと考える。 }; } +コピーコンストラクタ +-------------------- + +基本的にコピーコンストラクタの使用を禁止する。 + +よい例: + + class MyClass + { + private: + MyClass(const MyClass &); + } + +悪い例(コピーコンストラクタを禁止していない): + + class MyClass + { + } + +悪い例(カスタムコピーコンストラクタを使っている): + + class MyClass + { + unsigned int age_; + MyClass(const MyClass &object) + { + this.age_ = object.age_; + } + } -------------- next part -------------- HTML����������������������������...Download