On 2019-12-04 19:23:07 +0000, Steven Schveighoffer said:

Is one a delegate and one a function pointer? This can easily happen for untyped lambdas.

Not sure if the code-snippets already give an explanation but the differences I have are:

1. Working case

template filter(alias pred)
{
        auto filter(TObservable)(auto ref TObservable observable)
        {
        static struct FilterObservable
        {
                                ...
                        }

                        return FilterObservable(observable);
        }
}

2. Non-Working case

template filter(alias pred)
{
   auto filter(TObservable)(auto ref TObservable observable)
   {
       return FilterObservable!(pred, TObservable)(observable);
   }
}

struct FilterObservable(alias pred, TObservable)
{
        ...
}

The constructor has the same implementaion in both cases.

--
Robert M. Münch
http://www.saphirion.com
smarter | better | faster

Reply via email to