
24 Sep
2005
24 Sep
'05
5:28 a.m.
Howard Hinnant wrote: [...]
template <class C> struct container_not_full { container_not_full(const C& c) : c_(c) {} bool operator()() const {return c_.size() != c_.capacity();} private: const C& c_; };
struct container_not_full { typedef bool result_type; template<class C> bool operator()( C const & c ) const { return c.size() != c.capacity(); } }; [...]
void bounded_queue::send (int m) { lock lk(mut_); queue_is_full_so_.wait(lk, container_not_full<Metrowerks::cdeque<int> >(the_queue_));
queue_is_full_so_.wait( lk, bind( container_not_full(), ref( the_queue_ ) ); ;-)