;

    template<typename Executor>
    generic_executor_ref(Executor& ex)
    //: ex(make_shared<executor_ref<Executor> >(ex)) // todo check why this doesn't works with C++03
    : ex( new executor_ref<Executor>(ex) )
    {
    }

    //generic_executor_ref(generic_executor_ref const& other) noexcept    {}
    //generic_executor_ref& operator=(generic_executor_ref const& other) noexcept    {}


    /**
     * \par Effects
     * Close the \c executor for submissions.
     * The worker threads will work until there is no more closures to run.
     */
    void close() { ex->close(); }

    /**
     * \par Returns
     * Whether the pool is closed for submissions.
     */
    bool closed() { return ex->closed(); }

    /**
     * \par Requires
     * \c Closure is a model of Callable(void()) and a model of CopyConstructible/MoveConstructible.
     *
     * \par Effects
     * The specified closure will be scheduled for execution at some point in the future.
     * If invoked closure throws an exception the thread pool will call std::terminate, as is the case with threads.
     *
     * \par Synchronization
     * Completion of closure on a particular thread happens before destruction of thread's thread local variables.
     *
     * \par Throws
     * \c sync_queue_is_closed if the thread pool is closed.
     * Whatever exception that can be throw while storing the closure.
     */

    void submit(BOOST_THREAD_RV_REF(work) closure)
    {
      ex->submit(boost::move(closure));
    }

#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
    template <typename Closure>
    void submit(Closure & closure)
    {
      //work w ((closure));
      //submit(boost::move(w));
      submit(work(closure));
    }
#endif
    void submit(void (*closure)())
    {
      work w ((closure));
      submit(boost::move(w));
      //submit(work(closure));
    }

    template <typename Closure>
    void submit(BOOST_THREAD_FWD_REF(Closure) closure)
    {
      work w((boost::forward<Closure>(closure)));
      submit(boost::move(w));
    }

//   