- I don't understand why the library needs
to deal with access control. Why can't
the user just use public: private: protected:
as usual?
The user can use the access specifiers outside the macros:
CONTRACT_CLASS(
class (x)
) {
CONTRACT_CLASS_INVARIANT( void )
protected: typedef int size_type; // access specifier outside macros
CONTRACT_FUNCTION(
public void (f) ( void ) // access specifier in macros
) {}
};
However, the access specifiers also needs to be in the macros because
private and protected functions do not check class invariants.