Boost logo

Boost Users :

Subject: Re: [Boost-users] c2248 with a queue!
From: Adam Romanek (a.romanek_at_[hidden])
Date: 2011-07-20 03:35:52


Hi,

it's hard to say where the problem is as you presented the code that is
probably not relevant to the problem. It won't even compile as the queue
is first named 'the_data' and then it's used as 'the_queue'.

It would be more useful if you presented the code that is related to the
actual errors from the compiler, e.g. the line on which the compiler
says the problem is.

wbr,
Adam Romanek

On 07/20/2011 09:21 AM, Sean Farrow wrote:
> ...
>
> --begin code—
>
> #include<queue>
>
> #include<boost/thread/mutex.hpp>
>
> #include<boost/thread/condition_variable.hpp>
>
> template<typename Data>
>
> classconcurrent_queue {
>
> private:
>
> boost::mutex the_mutex;
>
> boost::condition_variable the_condition_variable;
>
> std::queue<Data> the_data;
>
> public:
>
> void push(Data const& data)
>
> {
>
> boost::mutex::scoped_lock lock(the_mutex);
>
> the_queue.push(data);
>
> lock.unlock();
>
> the_condition_variable.notify_one();
>
> }
>
> };
>
> --end code--
>
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net