- milestone changed from Release to Future
Can I avoid requiring to specify CONTRACT_CLASS_INVARIANT( void ) all together when there are no class invariant?
For example, given that the class name is unique, I can generate a template outside the class declaration contract_signature_##class_name##_ that contains the typedefs for class_type, base_type0, etc. If so then I don't need the CONTRACT_CLASS macro to open the class { so I don't need the CONTRACT_CLASS_INVARIANT macro to close the artificail { opened by the user. Then I could use a base class contract_invariant<class_type> that defines some default class-invariant virtual functions that the CONTRACT_CLASS_INVARIANT will override but only when specified.
If possible, this will be backward compatible because CONTRACT_CLASS_INVARIANT( void ) can still be used even if it is no longer required.
Log in to post a comment.