Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
#undefで#defをキャンセルできます。同様の方法で「using」または「usingnamespace」をキャンセルできますか?
いいえ、できません。
最善の解決策はusing、ヘッダーファイルにディレクティブを含めず、ソースファイルからの使用を最小限に抑える(さらには完全に削除する)ことです。
using
::名前空間で問題が発生した場合は、グローバルに移動するために使用できますnamespaceが、最もクリーンな方法はディレクティブをクリアすることです。
::
namespace
編集:これはC++に適用されます。