repo.or.cz
/
mono-project.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Take stars out of types where they make more sense.
[mono-project.git]
/
mcs
/
tests
/
gtest-052.cs
blob
f513eeeb03358f4bc6aa7a50716d3bd326c54390
1
// We create an instance of a type parameter which has the new() constraint.
2
using
System
;
3
4
public class
Foo
<
T
>
5
where T
:
new
()
6
{
7
public
T
Create
()
8
{
9
return new
T
();
10
}
11
}
12
13
class
X
14
{
15
public
X
()
16
{ }
17
18
void
Hello
()
19
{
20
Console
.
WriteLine
(
"Hello World"
);
21
}
22
23
public static void
Main
()
24
{
25
Foo
<
X
>
foo
=
new
Foo
<
X
> ();
26
foo
.
Create
().
Hello
();
27
}
28
}