Here I have templated struct that matches type with CborConfig tempate specialization

CborConfig will have more parameters in future and all of them will be accessed via alias members, so I've used variadic (T...) parameter whule matching.

-------
template CborConfig(_nonSerializedAttribute)
{
        struct CborConfig
        {
                alias nonSerializedAttribute = _nonSerializedAttribute;
        }
}

/// Default non-serialized attribute type
struct NonSerialized{}

/// This CborConfig instantiation will be used by default.
alias defaultCborConfig = CborConfig!(NonSerialized, NonSerialized);

struct AccepterT(Config : CborConfig!(T) = defaultCborConfig, T...)
{
        pragma(msg, T);
}

// template f379.accepter cannot deduce function from argument types !()()
void accepter(Config : CborConfig!(T) = defaultCborConfig, T...)()
{
        pragma(msg, T);
}
-------
^^^^^^^
http://dpaste.dzfl.pl/5f1d5d5d9e19

Instead I need to use template constraint which is less compact.
http://dpaste.dzfl.pl/571ae84d783e

Why such behavior happens?

Reply via email to