Boost logo

Boost :

Subject: [boost] [thread] Conformance with N2497 move semantics
From: vicente.botet (vicente.botet_at_[hidden])
Date: 2008-11-12 04:40:35


Hi Anthony,

N2497 includes the following thread constructor overloadings
    template <class F> explicit thread(F f);
    template <class F, class ...Args> thread(F&& f, Args&&... args);
    void swap(thread&&);

Boost.Threads try to conforms to N2497 as muh as possible. Boost.Threads
defines already

#ifdef BOOST_HAS_RVALUE_REFS
template <class F> thread(F&& f);
#else
#ifdef BOOST_NO_SFINAE
template <class F> explicit thread(F f);
#else
template <class F>explicit thread(F f,
        typename disable_if<
            boost::is_convertible<F&, detail::thread_move_t<F> >,
                dummy* >::type=0);
#endif
template <class F>explicit thread(detail::thread_move_t<F> f);
template <class F,class ...Args> thread(F f, Args... args)

I have some questions.
Is there any deep raison for which
    template <class F> explicit thread(F f);
should not always be defined?

Is there any deep raison to emulate
    template <class F,class ...Args> thread(F f, Args... args)
instead of
    template <class F,class ...Args> thread(F&& f, Args... args)

Could
    template <class F, class ...Args> thread(F&& f, Args&&... args);
rally be emulated?

You provide 'void swap(thread&)'. Could 'void swap(thread&&)' be emulated?

Do you know if the following overloadings are taken in account by the
boost::swap utility?
    void swap(thread& x, thread& y);
    void swap(thread&& x, thread& y);
    void swap(thread& x, thread&& y);

Thanks in advance,

Vicente


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