[Groonga-mysql-commit] mroonga/mroonga [fix-for-visual-studio] doc coding-style: add about namespace

Back to archive index

Kouhei Sutou null+****@clear*****
Thu Oct 4 10:49:22 JST 2012


Kouhei Sutou	2012-03-15 10:15:42 +0900 (Thu, 15 Mar 2012)

  New Revision: 97edbdd13dbb91edca230a2c42fa31ffef3bb136
  https://github.com/mroonga/mroonga/commit/97edbdd13dbb91edca230a2c42fa31ffef3bb136

  Log:
    doc coding-style: add about namespace

  Modified files:
    doc/source/developer/coding_style.rst

  Modified: doc/source/developer/coding_style.rst (+20 -0)
===================================================================
--- doc/source/developer/coding_style.rst    2012-03-15 10:06:36 +0900 (342b02e)
+++ doc/source/developer/coding_style.rst    2012-03-15 10:15:42 +0900 (9cb22b0)
@@ -69,3 +69,23 @@ TODO: 読みやすさの他にデバッグのしやすさ(gdbでの追いや
 悪い例( ``.h`` を使っている):
 
     ha_mroonga.h
+
+名前空間
+--------
+
+ヘッダーファイルでは ``using namespace`` を使わない。ソースコードでは ``using namespace std`` であれば使ってもよい。他の名前空間は使ってはいけない。
+
+よい例:
+
+    ha_mroonga.cpp:
+      using namespace std;
+
+悪い例(ヘッダーファイル内で ``using namespace`` を使っている):
+
+    ha_mroonga.hpp:
+      using namespace std;
+
+悪い例( ``std`` 以外の名前空間に対して ``using namespace`` を使っている):
+
+    ha_mroonga.cpp:
+      using namespace zmq;
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-mysql-commit mailing list
Back to archive index