select

fnA select(bool cond : true, A, B)(A a, lazy B b)

Select one of two functions to run via template parameter.

Parameters

condA bool which determines which function is run
aThe first function
bThe second function

Returns

a without evaluating b if cond is true.

Otherwise, returns b without evaluating a.

fnB select(bool cond : false, A, B)(lazy A a, B b)

Ditto