~ubuntu-branches/ubuntu/gutsy/c++-annotations/gutsy

« back to all changes in this revision

Viewing changes to yo/concrete/predicates.yo

  • Committer: Bazaar Package Importer
  • Author(s): Frank B. Brokken
  • Date: 2007-06-15 19:31:12 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20070615193112-i48grmnykrf1ipqf
Tags: 7.0.0-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
represented by its second argument, and returns 0 otherwise.
13
13
 
14
14
Existing unary predicate functions may be specified with the
15
 
tt(PredicateFunction1) template class, defining a unary predicate class. Its
 
15
tt(PredicateFunction1) class template, defining a unary predicate class. Its
16
16
tt(typedef) ti(argument_type) is required by, e.g., function adapters:
17
17
        verbinsert(UNARYPRED)(concrete/examples/predicates.h)
18
18
    Existing binary predicate functions may be specified with the
19
 
tt(PredicateFunction2) template class, defining a binary predicate class. Its
 
19
tt(PredicateFunction2) class template, defining a binary predicate class. Its
20
20
tt(typedef)s ti(first_argument_type), ti(second_argument_type) and
21
21
ti(result_type) are required by, e.g., function adapters:
22
22
        verbinsert(BINPRED)(concrete/examples/predicates.h)
29
29
be another function or a useful member may be available from an object of
30
30
another class. In that case an object acting as em(man in the middle) might
31
31
come in handy. The following class tt(PredicateObject1) performs exactly that
32
 
function. It defines a template class whose parameters refer to a class and a
 
32
function. It defines a class template whose parameters refer to a class and a
33
33
data type. Its constructors expect a pointer or reference to an object of the
34
34
template parameter's class as well as a pointer to a member function of that
35
35
class implementing a predicate. By default it's the class's function object
36
36
operator. Here is its definition:
37
37
        verbinsert(PREDOBJ1)(concrete/examples/predicates.h)
38
38
    The class tt(PredicateObject2) can be used to construct a
39
 
    emi(binary predicate) object. Here the template class has three
 
39
    emi(binary predicate) object. Here the class template has three
40
40
parameters: the class type of the object passed to its constructor as well as
41
41
the types of the two arguments of the binary predicate member that's called:
42
42
        verbinsert(PREDOBJ2)(concrete/examples/predicates.h)