File: namespaces.yo

package info (click to toggle)
c%2B%2B-annotations 10.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 10,536 kB
  • ctags: 3,247
  • sloc: cpp: 19,157; makefile: 1,521; ansic: 165; sh: 128; perl: 90
file content (16 lines) | stat: -rw-r--r-- 907 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
bf(C++) introduces the notion of a emi(namespace): all symbols are defined
in a larger context, called a em(namespace). Namespaces are used to avoid
    i(name conflicts) that could arise when a programmer would like to define
a function like tt(sin) operating on em(degrees), but does not want to lose
the capability of using the standard tt(sin) function, operating on
em(radians).

Namespaces are covered extensively in chapter ref(NAMESPACE). For now it
should be noted that most compilers require the explicit declaration of a
emi(standard namespace): tt(std). So, unless otherwise indicated, it is
stressed that all examples in the Annotations now implicitly use the
    hi(using namespace std)
        verb(        using namespace std;)
    declaration. So, if you actually intend to compile examples given in
the annotations(), make sure that the sources start with the above tt(using)
declaration.