Template specification conflict

simendsjo simendsjo at gmail.com
Tue Aug 2 04:06:10 PDT 2011

The following program gives me
"Error: template t.S.__ctor(C) if(isSomeChar!(C)) conflicts with 
constructor t.S.this at t.d(4)"

Is this because char etc can be converted to uint? Shouldn't the 
template specification make this unambiguous?

import std.traits;

struct S {
     this(uint i) {}
     this(C)(C c) if(isSomeChar!C) {}

void main() {}

More information about the Digitalmars-d-learn mailing list