Function constraint vs const parameter?

Jonathan Crapuchettes jcrapuchettes at gmail.com
Wed Jun 6 10:02:03 PDT 2012


I'm running into a problem with the following function definition when passing 
in a const(string[]).

public T condenseCountyList(T)(const T inputList) if (is(Unqual!T : string) || 
is(Unqual!T : string[]))

I'm getting the "Error: template common.condenseCountyList does not match any 
function template declaration" when calling the function as

condenseCountyList(countyList);

, but if I changed the calling code to

condenseCountyList(cast(string[])countyList)

dmd is happy.

How do I need to change the function constraint to make this work?

Thank you,
Jonathan Crapuchttes


More information about the Digitalmars-d-learn mailing list