Menu

#43 can I avoid CONTRACT_CLASS_INVARIANT( void ) when no invariants?

Future
accepted
None
Functionality
trivial
0.4.0
enhancement
2012-05-31
2012-05-08
No

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.

Discussion

  • Lorenzo Caminiti

    • milestone changed from Release to Future
     
  • Lorenzo Caminiti

    • priority changed from major to trivial
    • status changed from new to accepted
     

Log in to post a comment.