Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r65514 - sandbox/variadic_templates/boost/composite_storage/layout
From: cppljevans_at_[hidden]
Date: 2010-09-21 08:41:50


Author: cppljevans
Date: 2010-09-21 08:41:40 EDT (Tue, 21 Sep 2010)
New Revision: 65514
URL: http://svn.boost.org/trac/boost/changeset/65514

Log:
Added #include for mpl/next.hpp in operators_*.hpp.
Used type_traits/is_empty in layout_of to minimize size_of value.

Text files modified:
   sandbox/variadic_templates/boost/composite_storage/layout/layout_of.hpp | 10 ++++++++++
   sandbox/variadic_templates/boost/composite_storage/layout/operators_all_of_aligned.hpp | 1 +
   sandbox/variadic_templates/boost/composite_storage/layout/operators_one_of_maybe.hpp | 1 +
   3 files changed, 12 insertions(+), 0 deletions(-)

Modified: sandbox/variadic_templates/boost/composite_storage/layout/layout_of.hpp
==============================================================================
--- sandbox/variadic_templates/boost/composite_storage/layout/layout_of.hpp (original)
+++ sandbox/variadic_templates/boost/composite_storage/layout/layout_of.hpp 2010-09-21 08:41:40 EDT (Tue, 21 Sep 2010)
@@ -9,6 +9,9 @@
 // warranty, and with no claim as to its suitability for any purpose.
 //
 #include <boost/composite_storage/buffers/char_buf.hpp>
+#include <boost/mpl/integral_c.hpp>
+#include <boost/mpl/if.hpp>
+#include <boost/type_traits/is_empty.hpp>
 
 namespace boost
 {
@@ -57,12 +60,19 @@
>
   struct
 size_of
+: mpl::if_
+ < is_empty<T>
+ , mpl::integral_c<std::size_t,0>
+ , mpl::integral_c<std::size_t,sizeof(T)>
+ >::type
 {
+ #if 0
         static
       std::size_t const
     value
     =sizeof(T)
     ;
+ #endif
 };
 
 struct components_aligned_yes

Modified: sandbox/variadic_templates/boost/composite_storage/layout/operators_all_of_aligned.hpp
==============================================================================
--- sandbox/variadic_templates/boost/composite_storage/layout/operators_all_of_aligned.hpp (original)
+++ sandbox/variadic_templates/boost/composite_storage/layout/operators_all_of_aligned.hpp 2010-09-21 08:41:40 EDT (Tue, 21 Sep 2010)
@@ -15,6 +15,7 @@
 #include <boost/composite_storage/alignment/compose.hpp>
 #include <boost/composite_storage/alignment/aligned_offset.hpp>
 #include <boost/composite_storage/special_components.hpp>
+#include <boost/mpl/next.hpp>
 
 namespace boost
 {

Modified: sandbox/variadic_templates/boost/composite_storage/layout/operators_one_of_maybe.hpp
==============================================================================
--- sandbox/variadic_templates/boost/composite_storage/layout/operators_one_of_maybe.hpp (original)
+++ sandbox/variadic_templates/boost/composite_storage/layout/operators_one_of_maybe.hpp 2010-09-21 08:41:40 EDT (Tue, 21 Sep 2010)
@@ -14,6 +14,7 @@
 #include <boost/composite_storage/buffers/rval_ref_buf.hpp>
 #include <boost/composite_storage/alignment/compose.hpp>
 #include <boost/composite_storage/special_components.hpp>
+#include <boost/mpl/next.hpp>
 
 namespace boost
 {


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