Thread overview
invariant
Jun 15, 2002
Sean L. Palmer
Jun 16, 2002
Walter
Jun 18, 2002
Sandor Hojtsy
June 15, 2002
Can invariant be used without the () ?  It doesn't seem necessary.

 invariant()
	{
	    assert(1 <= day && day <= 31);
	    assert(0 <= hour && hour < 24);
	}



June 16, 2002
Yes. I never could decide if () should be required, so at the moment they are optional. Note that there are no parameters to invariant's in any case.

"Sean L. Palmer" <seanpalmer@earthlink.net> wrote in message news:aegc1o$n0j$1@digitaldaemon.com...
> Can invariant be used without the () ?  It doesn't seem necessary.
>
>  invariant()
> {
>     assert(1 <= day && day <= 31);
>     assert(0 <= hour && hour < 24);
> }
>
>
>


June 18, 2002
"Sean L. Palmer" <seanpalmer@earthlink.net> wrote in message news:aegc1o$n0j$1@digitaldaemon.com...
> Can invariant be used without the () ?  It doesn't seem necessary.
>
>  invariant()
> {
>     assert(1 <= day && day <= 31);
>     assert(0 <= hour && hour < 24);
> }

Especially compared to unittest without ( )
Since they have/mimic function like behaviour, I would be happy to see ( )
for both.
Sandor