Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2005-09-24 00:28:06


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_ ) );

;-)


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk