February 03, 2012 Function signature constraint syntax | ||||
---|---|---|---|---|
| ||||
Quick question: I have a function that takes an alias parameter:
struct X { ... };
void func(alias G)(object O) {
...
X x = ...;
G(x);
...
}
How do I write a signature constraint that essentially specifies that G should take a parameter of type X and return void?
T
--
When solving a problem, take care that you do not become part of the problem.
|
February 03, 2012 Re: Function signature constraint syntax | ||||
---|---|---|---|---|
| ||||
Posted in reply to H. S. Teoh | void func(alias G)(object O) if (is(typeof(G(O)) == void)) { "H. S. Teoh" <hsteoh@quickfur.ath.cx> wrote in message news:mailman.295.1328245356.25230.digitalmars-d-learn@puremagic.com... > Quick question: I have a function that takes an alias parameter: > > struct X { ... }; > > void func(alias G)(object O) { > ... > X x = ...; > G(x); > ... > } > > How do I write a signature constraint that essentially specifies that G should take a parameter of type X and return void? > > > T > > -- > When solving a problem, take care that you do not become part of the problem. |
Copyright © 1999-2021 by the D Language Foundation