Is there anything preventing us from adding constraints on the auto function return value? I mean, such language extension seems to be quite useful.

For example, it would be no longer necessary to provide method bodies for functions with auto return values.

In many cases this would eliminate the need for introducing an interface.

interface returnsDuckTyped
{
    auto foo() if(isInputRange(auto));
}

Reply via email to