Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r50283 - trunk/boost/flyweight
From: joaquin_at_[hidden]
Date: 2008-12-15 15:27:52


Author: joaquin
Date: 2008-12-15 15:27:50 EST (Mon, 15 Dec 2008)
New Revision: 50283
URL: http://svn.boost.org/trac/boost/changeset/50283

Log:
added direct tagging of specifiers through PTS as this avoids certain type instantiations that marker derivation can't prevent
Text files modified:
   trunk/boost/flyweight/assoc_container_factory.hpp | 11 +++++++++++
   trunk/boost/flyweight/hashed_factory.hpp | 14 ++++++++++++++
   trunk/boost/flyweight/intermodule_holder.hpp | 12 +++++++++++-
   trunk/boost/flyweight/set_factory.hpp | 14 ++++++++++++++
   trunk/boost/flyweight/static_holder.hpp | 10 ++++++++++
   5 files changed, 60 insertions(+), 1 deletions(-)

Modified: trunk/boost/flyweight/assoc_container_factory.hpp
==============================================================================
--- trunk/boost/flyweight/assoc_container_factory.hpp (original)
+++ trunk/boost/flyweight/assoc_container_factory.hpp 2008-12-15 15:27:50 EST (Mon, 15 Dec 2008)
@@ -53,6 +53,17 @@
   BOOST_MPL_AUX_LAMBDA_SUPPORT(1,assoc_container_factory_class,(Container))
 };
 
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+/* This is preferred to deriving from factory_marker since checking for
+ * derivation forces the instantiation of the specifier, which is not
+ * needed when the specifier is a placeholder expression.
+ */
+
+template<typename Container>
+struct is_factory<assoc_container_factory_class<Container> >:
+ boost::mpl::true_{};
+#endif
+
 /* assoc_container_factory_class specifier */
 
 template<

Modified: trunk/boost/flyweight/hashed_factory.hpp
==============================================================================
--- trunk/boost/flyweight/hashed_factory.hpp (original)
+++ trunk/boost/flyweight/hashed_factory.hpp 2008-12-15 15:27:50 EST (Mon, 15 Dec 2008)
@@ -88,6 +88,20 @@
     5,hashed_factory_class,(Entry,Key,Hash,Pred,Allocator))
 };
 
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+/* This is preferred to deriving from factory_marker since checking for
+ * derivation forces the instantiation of the specifier, which is not
+ * needed when the specifier is a placeholder expression.
+ */
+
+template<
+ typename Entry,typename Key,
+ typename Hash,typename Pred,typename Allocator
+>
+struct is_factory<hashed_factory_class<Entry,Key,Hash,Pred,Allocator> >:
+ boost::mpl::true_{};
+#endif
+
 /* hashed_factory_class specifier */
 
 template<

Modified: trunk/boost/flyweight/intermodule_holder.hpp
==============================================================================
--- trunk/boost/flyweight/intermodule_holder.hpp (original)
+++ trunk/boost/flyweight/intermodule_holder.hpp 2008-12-15 15:27:50 EST (Mon, 15 Dec 2008)
@@ -35,7 +35,7 @@
 namespace flyweights{
 
 template<typename C>
-struct intermodule_holder_class
+struct intermodule_holder_class:holder_marker
 {
   static C& get()
   {
@@ -174,6 +174,16 @@
   BOOST_MPL_AUX_LAMBDA_SUPPORT(1,intermodule_holder_class,(C))
 };
 
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+/* This is preferred to deriving from holder_marker since checking for
+ * derivation forces the instantiation of the specifier, which is not
+ * needed when the specifier is a placeholder expression.
+ */
+
+template<typename C>
+struct is_holder<intermodule_holder_class<C> >:boost::mpl::true_{};
+#endif
+
 /* intermodule_holder_class specifier */
 
 struct intermodule_holder:holder_marker

Modified: trunk/boost/flyweight/set_factory.hpp
==============================================================================
--- trunk/boost/flyweight/set_factory.hpp (original)
+++ trunk/boost/flyweight/set_factory.hpp 2008-12-15 15:27:50 EST (Mon, 15 Dec 2008)
@@ -56,6 +56,20 @@
     4,set_factory_class,(Entry,Key,Compare,Allocator))
 };
 
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+/* This is preferred to deriving from factory_marker since checking for
+ * derivation forces the instantiation of the specifier, which is not
+ * needed when the specifier is a placeholder expression.
+ */
+
+template<
+ typename Entry,typename Key,
+ typename Compare,typename Allocator
+>
+struct is_factory<set_factory_class<Entry,Key,Compare,Allocator> >:
+ boost::mpl::true_{};
+#endif
+
 /* set_factory_class specifier */
 
 template<

Modified: trunk/boost/flyweight/static_holder.hpp
==============================================================================
--- trunk/boost/flyweight/static_holder.hpp (original)
+++ trunk/boost/flyweight/static_holder.hpp 2008-12-15 15:27:50 EST (Mon, 15 Dec 2008)
@@ -38,6 +38,16 @@
   BOOST_MPL_AUX_LAMBDA_SUPPORT(1,static_holder_class,(C))
 };
 
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+/* This is preferred to deriving from holder_marker since checking for
+ * derivation forces the instantiation of the specifier, which is not
+ * needed when the specifier is a placeholder expression.
+ */
+
+template<typename C>
+struct is_holder<static_holder_class<C> >:boost::mpl::true_{};
+#endif
+
 /* static_holder_class specifier */
 
 struct static_holder:holder_marker


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