File: usingmath.yo

package info (click to toggle)
c%2B%2B-annotations 13.02.02-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,576 kB
  • sloc: cpp: 25,297; makefile: 1,523; ansic: 165; sh: 126; perl: 90; fortran: 27
file content (19 lines) | stat: -rw-r--r-- 1,121 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Now that the tt(Math) module has been developed it can be used by a
program. The exported facilities offered by a module are available after
importing the module. Note that although a module may tt(export import) its
partitions only partition components defined in their tt(export) compound are
available to source files not belonging to the module itself. As
tt(Math:Utility) exports tt(<cstddef>) source files importing tt(Math)
automatically also can use tt(cstddef's) features.

Here's a tt(main) function importing tt(Math) and using its facilities to add
two positive integral numbers. Header files are not used anymore, and the
implementation of the tt(main) function is equal to the implementation when
using header files. However, compared to the latter implementation the
compilation of a program using modules requires significantly less time, and
the design of modules using partitions may offer better isolation of
components that are mere building blocks of the those modules. 

Here is the implementation of the tt(main) function using the tt(Math) module:
    verbinsert(-as4 examples/partition/main.cc)