Clash When Using Function as Template Value-Parameters?

Vijay Nayar madric at gmail.com
Tue May 29 12:37:04 UTC 2018


On Tuesday, 29 May 2018 at 11:36:11 UTC, Yuxuan Shui wrote:
>
> No, wait a second. (a)=>a is in default argument list, so it is 
> in the global scope. And it was instantiated when you 
> instantiate BTree with char.

Could you explain that part a bit for me?  Yes, (a) => a is a 
default value, but when you say it is in the global scope, are 
you saying that a single object "(a) => a" is created in the 
global scope and not created for each template argument list, 
e.g. "BTree!int" and "BTree!char"?

I actually do not know in what scope such objects would be 
created, I had assumed it was per template-parameter list, but 
are you saying this is not the case?


More information about the Digitalmars-d mailing list