Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2001-06-27 14:48:09


At 03:06 PM 6/27/2001, williamkempf_at_[hidden] wrote:

>Interface 2:
>
>namespace thread
>{
> class ref
> {
> public:
> ref();
> ref(const ref& other);
> ~ref();
>
> ref& swap(const ref& other);
> ref& operator=(const ref& other);
>
> bool operator==(const ref& other) const;
> bool operator!=(const ref& other) const;
>
> bool is_current() const;
> bool is_alive() const;
>
> void join();
> };
>
> ref create(detail::threadproc proc);
> void sleep(const xtime& xt);
> void yield();
>}

Is there a reason for not having a creating constructor?

    ref(detail::threadproc proc); // calls thread::create()

Without having put a lot of thought into it, that would seem to be an
ease-of-use enhancement.

--Beman


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