Friday, November 26, 2010

Using Directives

If a name in one namespace clashes with a name in another namespace, and both namespaces are in using-directives, it is not a compiler error if the name is not used.

This sometimes causes problems to suddenly appear, and motivates minimizing the scope of using statements. For example, it is not recommended having using statements in header files.

Reference: The C++ Programming Language by Bjarne Stroustrup. Addison-Wesley, 2000. Section: C.10.1

No comments:

Post a Comment