D - invariant
- "Sean L. Palmer" <seanpalmer earthlink.net> Jun 15 2002
- "Walter" <walter digitalmars.com> Jun 16 2002
- "Sandor Hojtsy" <hojtsy index.hu> Jun 18 2002
Can invariant be used without the () ? It doesn't seem necessary.
invariant()
{
assert(1 <= day && day <= 31);
assert(0 <= hour && hour < 24);
}
Jun 15 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); }
Jun 16 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
Jun 18 2002









"Walter" <walter digitalmars.com> 