In fact,
a normal using directive without an alias (for example, using First-
Alias::Demo;) would have allowed us to use the name Example without any further
qualification at all. It??™s also worth noting that one extern alias can cover multiple
assemblies, and several extern aliases can all refer to the same assembly. To specify
an external alias in Visual Studio (2005 or 2008), just select the assembly reference
within Solution Explorer and modify the Aliases value in the Properties window, as
shown in figure 7.3.
Hopefully I don??™t need to persuade you to
avoid this kind of situation wherever you possibly
can. It can be necessary to work with assemblies
from different third parties who happen to have
used the same fully qualified type name. Where
you have more control over the naming, however,
make sure that your names never lead you into
this territory in the first place.
Our next feature is almost a meta-feature. The
exact purpose it serves depends on which compiler
you??™re using, because its whole purpose is to
enable control over compiler-specific features??”
but we??™ll concentrate on the Microsoft compiler.
7.5 Pragma directives
Describing pragma directives in general is extremely easy: a pragma directive is a preprocessing
directive represented by a line beginning with #pragma. The rest of the line
can contain any text at all.
Pages:
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387