我希望能夠寫的東西作爲如何界定謂詞作爲函數參數
void Start(some condition that might evaluate to either true or false) {
//function will only really start if the predicate evaluates to true
}
我猜它一定是形式的東西:
void Start(Predicate predicate) {
}
我怎樣才能檢查裏面我的開始函數,只要謂詞評估爲真或假?我使用的謂詞是否正確?
謝謝