Cannot distinguish between template function wtih 0 args and 1 arg

Cauterite via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Aug 8 01:14:45 PDT 2016


On Monday, 8 August 2016 at 02:36:24 UTC, Engine Machine wrote:
> Error: template Mem cannot deduce function from argument types 
> !(cast(eException)1280L, "main.d", 38u, "main.WinMain")(int), 
> candidates are:
> Mem(T, B = eX, string file = __FILE__, uint line = __LINE__, 
> string func = __FUNCTION__)(size_t bytes)
> Mem(T, B = eX, string file = __FILE__, uint line = __LINE__, 
> string func = __FUNCTION__)()

 From this error message it looks like the `B = eX` parameter is 
not getting matched up against the value `cast(eException)1280L` 
as you are hoping for. Probably because `1280L` is a value and 
it's expecting a type.
Try replacing it with something like `alias B = eX` or `enum B = 
eX`.


More information about the Digitalmars-d-learn mailing list