How to define a predicate as a function argument

Posted by devoured elysium on Stack Overflow See other posts from Stack Overflow or by devoured elysium
Published on 2010-04-24T03:47:11Z Indexed on 2010/04/24 3:53 UTC
Read the original article Hit count: 291

Filed under:
|
|

I want to be able to write something as

void Start(some condition that might evaluate to either true or false) {
    //function will only really start if the predicate evaluates to true
}

I'd guess it must be something of the form:

void Start(Predicate predicate) {
}

How can I check inside my Start function whenever the predicate evaluated to true or false? Is my use of a predicate correct?

Thanks

© Stack Overflow or respective owner

Related posts about c#

Related posts about predicate