bearophile wrote:
canalpay:
Thanks, But this example works:
void main()
{
T input(T)()
{}
}
Why ?
You are right. Beside allowing nested functions (this is well known), it seems
D2 also accepts the definition (with template constraint too) and instantiation
of simple templates insi
canalpay:
> Thanks, But this example works:
> void main()
> {
> T input(T)()
> {}
>
> }
>
> Why ?
You are right. Beside allowing nested functions (this is well known), it seems
D2 also accepts the definition (with template constraint too) and instantiation
of simple templates inside f
bearophile Wrote:
> In D2 you can't define templates inside functions.
>
> Bye,
> bearophile
Thanks, But this example works:
void main()
{
T input(T)()
{}
}
Why ?
canalpay:
> void main()
> {
> T input(T)()
> {}
>
> T input(T : string)()
> {}
> }
In D2 you can't define templates inside functions.
Bye,
bearophile
void main()
{
T input(T)()
{}
T input(T : string)()
{}
}
Error message :
isimsiz.d(6): found 'input' when expecting ';' following statement
isimsiz.d(6): found ':' when expecting ')'
isimsiz.d(6): found 'string' when expecting ';' following statement
isimsiz.d(6): found ')' inst