I'm trying to change the integer values in a vector using transform and an if_then_else control structure from Boost Lambda. However my compiler is not appreciating my efforts. The code I am attempting is:
transform(theVec.begin(), theVec.end(), theVec.begin(),
if_then_else(bind(rand) % ratio == 0, _1 = bind(rand) % maxSize, _1));
I tried simplifying it to the following:
transform(theVec.begin(), theVec.end(), theVec.begin(),
if_then_else(0 == 0, _1 = MaxIntSizeCFG, _1));
but the compiler tells me: no matching function for call to 'if_then_else(..........' I read that the return values from control structures is void, so is my attempted usage in this case entirely wrong?
Thanks in advance for your time!