Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58364 - in sandbox/fiber/libs/fiber: doc examples
From: oliver.kowalke_at_[hidden]
Date: 2009-12-13 14:12:02


Author: olli
Date: 2009-12-13 14:12:01 EST (Sun, 13 Dec 2009)
New Revision: 58364
URL: http://svn.boost.org/trac/boost/changeset/58364

Log:
- test future updated

Text files modified:
   sandbox/fiber/libs/fiber/doc/overview.qbk | 2 ++
   sandbox/fiber/libs/fiber/examples/future.cpp | 39 +--------------------------------------
   2 files changed, 3 insertions(+), 38 deletions(-)

Modified: sandbox/fiber/libs/fiber/doc/overview.qbk
==============================================================================
--- sandbox/fiber/libs/fiber/doc/overview.qbk (original)
+++ sandbox/fiber/libs/fiber/doc/overview.qbk 2009-12-13 14:12:01 EST (Sun, 13 Dec 2009)
@@ -34,6 +34,8 @@
 which includes all the other headers in turn. The classes and functions reside in namespaces
 `boost::fibers` and `boost::this_fiber`.
 
+[note __boost_fiber__ requires [*Boost Library 1.41.0] .]
+
 [warning This library is NOT an official Boost library]
 
 [note Please note that __boost_fiber__ is not optimized yet.]

Modified: sandbox/fiber/libs/fiber/examples/future.cpp
==============================================================================
--- sandbox/fiber/libs/fiber/examples/future.cpp (original)
+++ sandbox/fiber/libs/fiber/examples/future.cpp 2009-12-13 14:12:01 EST (Sun, 13 Dec 2009)
@@ -10,43 +10,6 @@
 #include <boost/fiber.hpp>
 #include <boost/fiber/spin/future.hpp>
 
-class callable
-{
-private:
- struct impl
- {
- virtual ~impl() {}
-
- virtual void exec() = 0;
- };
-
- template< typename T >
- class timpl : public impl
- {
- private:
- boost::fibers::spin::packaged_task< T > pt_;
-
- public:
- timpl( boost::fibers::spin::packaged_task< T > & pt) :
- pt_( boost::move( pt) )
- {}
-
- void exec()
- { pt_(); }
- };
-
- boost::shared_ptr< impl > impl_;
-
-public:
- template< typename T >
- callable( boost::fibers::spin::packaged_task< T > & pt) :
- impl_( new timpl< T >( pt) )
- {}
-
- void operator()()
- { impl_->exec(); }
-};
-
 inline
 std::string helloworld_fn()
 { return "Hello World"; }
@@ -59,7 +22,7 @@
 
                 boost::fibers::spin::packaged_task< std::string > pt( helloworld_fn);
                 boost::fibers::spin::unique_future< std::string > fu = pt.get_future();
- sched.make_fiber( callable( pt) );
+ sched.make_fiber( boost::move( pt) );
 
                 for (;;)
                 {


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk