C
C#8mo ago
Tom

✅ Predicates

Have you ever "add" more than one function to predicate definition: e.g. Predicate<T> p = func1; and then p += func2; If so in what circumstances? From my limited experience it does not make much sense, however compiler has nothing against that 😉 Maybe just because Predicate is based on delegate...
6 Replies
this_is_pain
this_is_pain8mo ago
it's used for events i personally not like that
jcotton42
jcotton428mo ago
Yes, but that won't and or or the predicates together. You'll just get the result of the last in the list.
Tom
TomOP8mo ago
exactly
jcotton42
jcotton428mo ago
And yeah, all delegates are multicast unfortunately.
Tom
TomOP8mo ago
thanks for input, let's wait, maybe someone will come up with "making-sense" example of utilizing that...
jcotton42
jcotton428mo ago
This by the way is why many events have their "return value" in a passed parameter.

Did you find this page helpful?