On 3/23/14, Uranuz <neura...@gmail.com> wrote:
> I have a question how I could combine template parameters
> deduction with setting default values for template parameters. I
> will start directly from a piece of code.

You can use eponymous templates for this. E.g.:

-----
template decodeURICustom(string allowedSpecChars = null, bool
formEncoding = false)
{
    string decodeURICustom(T)(T source) pure
    {
        return "";
    }
}

alias decodeURICustom!("!$&'()*+,;=") decodeURIHost;

void main()
{
    string str    = "http://www.dlang.org";;
    string result = decodeURICustom(str);
}
-----

Reply via email to