![]() |
Section 8.1.2.5: |
![]() |
The type definitions in this class specification fall into two groups :-
This class is provided to permit explicit narrowing from the general abstract class $OB to the argument class T. It may then be used as a substitute for the 'one line' typecase statement.
This creation operation serves merely to encapsulate the class argument type. There is no internal state other than this.
Since there are no arguments the post-condition is vacuously true.
This creation operation merely encapsulates the class argument type for use when casting objects.
This is the single 'working' feature of this class, permitting an in-line typecase to be written. Note that if the argument happens not to be of type T then an exception will be raised.
Since the argument can be of any type then this is vacuously true!
Note that this post-condition is always valid, since otherwise an exception has been raised.
For the meaning of the raise statement see its specification in section 6.7.12. The specification of the typeof auxiliary function is given in Section 6.9.
This routine allows an explicit typecase 'cast' to be made to an object of the class argument type. An exception is raised if anything is not of class T.
![]() |
Language Index | ![]() |
Library Index | ![]() |
Basic Index |
Comments or enquiries should be made to
Keith
Hopper. Page last modified: Thursday, 16 November 2000. |
![]() |