Boost logo

Boost :

From: Sohail Somani (sohail_at_[hidden])
Date: 2008-05-27 17:58:14


David Abrahams wrote:
> I just discovered that while none of my standard containers are
> "move-aware" in the way needed by boost::thread, I can use boost::array
> to store threads by simply move-assigning new threads into the elements
> it contains:
>
> boost::array<boost::thread, 100> thread_q;
>
> for (int i = 0; i < 100; ++i)
> thread_q[i] = boost::thread( some_function );
>
> it ain't perfect, but given that the number of cores on any real machine
> is limited these days, you can do a lot with a fixed-size array of
> thread. Pretty cool; it sure beats using shared_ptr.

Why doesn't it require std::move or boost::move? I thought this was
required to move anything. Looks like there is some sort of conversion
operator.

-- 
Sohail Somani
http://uint32t.blogspot.com

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