The main language constructs added are signatures and signature pointers. For example, the signature declaration
signature S
{
int foo (void);
int bar (int);
};
defines a new abstract type S
with member functions
int foo (void)
and int bar (int)
. Signature
types cannot be instantiated since they don't provide any
implementation. Only signature pointers and signature references can
be defined. For example,
C obj;
S * p = &obj;
defines a signature pointer p
and initializes it to point to
an object of class type C
, where C
is required
to contain the public member functions
int foo (void)
and int bar (int)
. The member function call
int i = p->foo ();
executes then obj.foo ()
.
Class C
is called an implementation of the abstract type
S
. In this example, we could have made S
an abstract virtual class and C
a subclass of S
,
and we would have had the same effect. The advantages of signatures over
abstract virtual classes are
-fhandle-signatures
for compiling C++ code containing signatures.
The following bugs are known:
p->operator+(17)
, but not with operator or conversion syntax.
The following language constructs and features are not yet implemented:
sigof
(signature of a class) construct,
Besides bug fixes, the main features that have been implemented since the last release are default implementations of signature member functions and opaque types. Classes that are defined using multiple inheritance can now be used as implementations of signature types.
For examples of what works and what doesn't, see the test files in the
signature testsuite. All test programs
are supposed to print "PASS\n"
to stdout
when compiled with G++-2.7.2.