File: add.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 (22 lines) | stat: -rw-r--r-- 1,320 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
20
21
22
Different from the tt(Math:Utility) partition the tt(Math:Add) partition
em(does) depend on another partition: it depends on tt(Math:Utility). Like
tt(Utility's modutility.cc) it starts its tt(modadd.cc) file by exporting its
partition name. But then it imports tt(:Utility), since that partition is used
by tt(Math:Add), making available em(all) components of that partition. 

Since tt(:Utility) already imports tt(<sstddef> :Add) can also use
tt(size_t). For tt(:Add) the tt(:Utility) partition wouldn't have to specify
tt(export) in front of tt(import <stddef>) since all components of imported
partitions are available to both the module and its partitions. But by using
tt(export import <cstddef>) users of the tt(Math) module automatically receive
tt(<cstddef>'s) definitions (among which tt(size_t)). Here's the tt(Math::Add)
partition interface unit (again: notice that the interface doesn't contain an
export compound):
    verbinsert(-as4 examples/partition/math/add/modadd.cc)

For this partition no members were defined inline (although that would also
have been possible). Instead all members were defined in separate source
files. Here is tt(class Add's) constructor:
    verbinsert(-as4 examples/partition/math/add/add1.cc)
and its tt(sum) member:
    verbinsert(-as4 examples/partition/math/add/sum.cc)