
I am trying to replicate the function object: struct find_with_n_set { int n; find_with_n_set(int n) : n(n) {} bool operator()(const shared_ptr<Object> &ptr) { return ptr && ptr->GetBitset().test(n); } }; I think I have done it with the expression: _1 && bind(&dynamic_bitset<>::test, bind(&Object::GetBitset, *_1), n) It seems to work, so I'm guessing it is correct. Is there a better way to write it though, because it seems rather difficult to read. Thanks, Kevin Martin

On Mon, May 5, 2008 at 8:19 AM, Kevin Martin
I think I have done it with the expression:
_1 && bind(&dynamic_bitset<>::test, bind(&Object::GetBitset, *_1), n)
It seems to work, so I'm guessing it is correct. Is there a better way to write it though, because it seems rather difficult to read.
You might prefer _1->*&Object::GetBitset to the inner bind, but I'm not convinced it can get much better.
participants (2)
-
Kevin Martin
-
Scott McMurray