1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
A generalized alternative to the tt(using) declaration is the
emi(using directive):
verb(
using namespace CppAnnotations;
)
Following this directive, em(all) entities defined in the
tt(CppAnnotations) namespace are used as if they were declared by tt(using)
declarations.
While the tt(using) directive is a quick way to
hi(namespace: import all names) import all the names of a namespace (assuming
the namespace has previously been declared or defined), it is at the same time
a somewhat dirty way to do so, as it is less clear what entity will be used in
a particular block of code.
If, e.g., tt(cos) is defined in the tt(CppAnnotations) namespace,
tt(CppAnnotations::cos) will be used when tt(cos) is called. However, if
tt(cos) is em(not) defined in the tt(CppAnnotations) namespace, the standard
tt(cos) function will be used. The tt(using) directive does not document as
clearly as the tt(using) declaration what entity will be used. Therefore use
caution when applying the tt(using) directive.
|