Show: Object Pascal C++
Display Preferences

Namespace Alias

From Appmethod Topics
Jump to: navigation, search

Go Up to C++ namespaces Index

You can use an alternate name to refer to a namespace identifier. An alias is useful when you need to refer to a long, unwieldy namespace identifier.

  namespace BORLAND_SOFTWARE_CORPORATION {
     /* namespace-body */
     namespace NESTED_BORLAND_SOFTWARE_CORPORATION {
        /* namespace-body */
        }
     }
  // Alias namespace
  namespace BI = BORLAND_SOFTWARE_CORPORATION;
  // Use access qualifier to alias a nested namespace
  namespace NBI = BORLAND_SOFTWARE_CORPORATION::NESTED_BORLAND_SOFTWARE_CORPORATION;
Personal tools
In other languages