4 static int t_count
= 0, f_count
= 0;
8 Console
.WriteLine (t
&& f
);
14 Console
.WriteLine (t
&& t
);
23 static MyBool t { get { Console.WriteLine ("t"); t_count++; return new MyBool (true); }}
24 static MyBool f { get { Console.WriteLine ("f"); f_count++; return new MyBool (false); }}
27 public struct MyBool
{
30 public MyBool (bool v
) { this.v = v; }
32 public static MyBool
operator & (MyBool x
, MyBool y
) {
33 return new MyBool (x
.v
& y
.v
);
36 public static MyBool
operator | (MyBool x
, MyBool y
) {
37 return new MyBool (x
.v
| y
.v
);
40 public static bool operator true (MyBool x
) {
44 public static bool operator false (MyBool x
) {
48 public override string ToString () { return v.ToString (); }