[Boost-bugs] [Boost C++ Libraries] #4569: [patch] fusion::unfused reusability / perfect forwarding

Subject: [Boost-bugs] [Boost C++ Libraries] #4569: [patch] fusion::unfused reusability / perfect forwarding
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-08-19 11:29:35


#4569: [patch] fusion::unfused reusability / perfect forwarding
------------------------------+---------------------------------------------
 Reporter: anonymous | Owner: djowel
     Type: Feature Requests | Status: new
Milestone: To Be Determined | Component: fusion
  Version: Boost 1.44.0 | Severity: Problem
 Keywords: |
------------------------------+---------------------------------------------
 attached is a patch to unfused.hpp, used by fusion::make_unfused.

 what it does:
  * "fused" currently forces you to store a function object in order to use
 the "unfusing" interface. this patch makes the interface of unfused
 reusable by other classes, by introducing a CRTP class "unfuse_interface",
 that is used by unfused.
 simplified example:

 {{{

 class unfused : unfused_interface<unfused,...>{
 private:
   friend class unfused_interface;
   result call(Args &args){
     //unfused::operator()(...) was called. args is a sequence
     //of the passed arguments
     return stored_fused_functor(args);
   }
   Function stored_fused_functor;
 };

 }}}

  * perfect forwarding:

 "unfused" only takes non-const references as arguments.
 this patch changes that to the compromise of boost::bind():
 perfect forwarding for up to 2 arguments, beyond that either all arguments
 are const refs, or all arguments are non-const refs.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4569>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:04 UTC