repo.or.cz
/
mcs.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
2007-05-25 Jonathan Chambers <joncham@gmail.com>
[mcs.git]
/
tests
/
gtest-044.cs
blob
679bbb1339bcc3228df120dc0467bae7fe93f223
1
// Operators and generic types.
2
3
using
System
;
4
5
class
X
<
T
>
6
{
7
public int
Count
;
8
9
public
X
(
int
count
)
10
{
11
this
.
Count
=
count
;
12
}
13
14
public static
X
<
T
>
operator
++ (
X
<
T
>
operand
) {
15
return new
X
<
T
> (
operand
.
Count
+
1
);
16
}
17
}
18
19
class
Test
20
{
21
static void
Main
()
22
{
23
X
<
long
>
x
=
new
X
<
long
> (
5
);
24
Console
.
WriteLine
(
x
.
Count
);
25
x
++;
26
Console
.
WriteLine
(
x
.
Count
);
27
}
28
}