Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r69271 - sandbox/variadic_templates/boost/composite_storage/pack/multiple_dispatch
From: cppljevans_at_[hidden]
Date: 2011-02-25 09:42:19


Author: cppljevans
Date: 2011-02-25 09:42:18 EST (Fri, 25 Feb 2011)
New Revision: 69271
URL: http://svn.boost.org/trac/boost/changeset/69271

Log:
WHAT:
  Reverted to previous version without use of
  host_abstract.
WHY:
  As shown in predator_prey.cpp in libs/composite_storage/sandbox/pack,
  boost::bind can be used to avoid the need. Also, this method
  keeps reifier_visitor's purpose more focused: converting abstract
  class instances to concrete class instances before applying a
  functor to concrete class argument list.

Text files modified:
   sandbox/variadic_templates/boost/composite_storage/pack/multiple_dispatch/reifier_visitor.hpp | 46 ++++++++++++++++++---------------------
   1 files changed, 21 insertions(+), 25 deletions(-)

Modified: sandbox/variadic_templates/boost/composite_storage/pack/multiple_dispatch/reifier_visitor.hpp
==============================================================================
--- sandbox/variadic_templates/boost/composite_storage/pack/multiple_dispatch/reifier_visitor.hpp (original)
+++ sandbox/variadic_templates/boost/composite_storage/pack/multiple_dispatch/reifier_visitor.hpp 2011-02-25 09:42:18 EST (Fri, 25 Feb 2011)
@@ -10,6 +10,10 @@
 //
 #include <boost/composite_storage/pack/multiple_dispatch/replace_source_with_target_ptr.hpp>
 #include <boost/mpl/pair.hpp>
+#include <boost/mpl/eval_if.hpp>
+#include <boost/mpl/identity.hpp>
+#include <boost/mpl/has_xxx.hpp>
+BOOST_MPL_HAS_XXX_TRAIT_DEF(type)
 
 namespace boost
 {
@@ -155,10 +159,21 @@
 };
   template
   < typename ReifierVisitor
- , typename ConcreteHosts
+ , typename ConcreteHead
>
 struct reifier_visit_concrete_seq
-;
+{
+ typename ReifierVisitor::first
+ visit(ConcreteHead const&a_host)const
+ {
+ typedef
+ typename ReifierVisitor::second
+ self_derived;
+ self_derived const&
+ self_value=static_cast<self_derived const&>(*this);
+ return self_value.push_back_concrete(a_host);
+ }
+};
   template
   < typename ReifierVisitor
   , typename... ConcreteHosts
@@ -185,7 +200,7 @@
 {
 };
   template
- < typename HostAbsract
+ < typename HostAbstract
>
 struct hosts_concrete
   /**@brief
@@ -194,24 +209,7 @@
    * to the HostAbstract abstract class.
    */
 ;
- template
- < typename HostConcrete
- >
-struct host_abstract
- /**@brief
- * Metafunction returning Abstract class
- * of which HostConcrete is a member.
- * IOW, does inverse of hosts_concrete.
- */
-{
- typedef
- HostConcrete
- type
- //By default, HostConcrete is member
- //of a type hierarchy starting at
- //HostConcrete.
- ;
-};
+
   template
   < typename ReifyApply
   , typename ArgsConcreteAbstract
@@ -264,10 +262,8 @@
>
>
   , typename hosts_concrete
- < typename host_abstract
- < typename remove_cv
- < HeadAbstract
- >::type
+ < typename remove_cv
+ < HeadAbstract
>::type
>::type
>


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