Navigation Menu

Skip to content

Commit

Permalink
doc coding-style: add about namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Mar 15, 2012
1 parent 54d65e8 commit 97edbdd
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions doc/source/developer/coding_style.rst
Expand Up @@ -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;

0 comments on commit 97edbdd

Please sign in to comment.