On Friday, December 01, 2017 03:39:12 helxi via Digitalmars-d-learn wrote:
> 1. Template specialisation.
> Why is this useful?:
> T getResponse(T = int)(string question); And how does it differ
> from
> int getResponse(string question); ?
>
> Context: http://ddili.org/ders/d.en/templates.html : Sec
On Friday, 1 December 2017 at 03:39:12 UTC, helxi wrote:
1. Template specialisation.
Why is this useful?:
T getResponse(T = int)(string question); And how does it differ
from
int getResponse(string question); ?
Because you can change the T at the call site. Let me give you a
real world exam
On Friday, 1 December 2017 at 03:39:12 UTC, helxi wrote:
1. Template specialisation.
Why is this useful?:
T getResponse(T = int)(string question); And how does it differ
from
int getResponse(string question); ?
Good Q. Without thinking more it looks like a pointless example.
The only differe
1. Template specialisation.
Why is this useful?:
T getResponse(T = int)(string question); And how does it differ
from
int getResponse(string question); ?
Context: http://ddili.org/ders/d.en/templates.html : Section:
"Default template parameters"
2. "Generic locking".
Is it possible to specia