Use bind to populate a deque<bool>
Hi, I am trying to use the transform algorithm to populate a deque<bool> : vector<int> orgList; deque<bool> skipped; transform(orgList.begin(), orgList.end(), back_inserter(skipped ) , _1 = false); But this does not compile, please tell me what did I do wrong? Thank you. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
yinglcs2@yahoo.com wrote:
Hi,
I am trying to use the transform algorithm to populate a deque<bool> :
vector<int> orgList; deque<bool> skipped;
transform(orgList.begin(), orgList.end(), back_inserter(skipped ) , _1 = false);
But this does not compile, please tell me what did I do wrong? Thank you.
_1 is a function parameter, not a return value. Your use of transform here does not make sense. Here's a better way: deque<bool> skipped(orgList.size(), false); Sebastian Redl
participants (2)
-
Sebastian Redl
-
yinglcs2@yahoo.com