Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r65805 - sandbox/variadic_templates/libs/composite_storage/sandbox
From: cppljevans_at_[hidden]
Date: 2010-10-07 10:34:41


Author: cppljevans
Date: 2010-10-07 10:34:38 EDT (Thu, 07 Oct 2010)
New Revision: 65805
URL: http://svn.boost.org/trac/boost/changeset/65805

Log:
WHAT:
  Added aligned size output together with comments
  explaining why it's used.
WHY:
  Previous output showed different size values for
  tagPs and Ptags. This shows the same aligned size.

Text files modified:
   sandbox/variadic_templates/libs/composite_storage/sandbox/layout_all.1.cpp | 31 +++++++++++++++++++++++++++++--
   1 files changed, 29 insertions(+), 2 deletions(-)

Modified: sandbox/variadic_templates/libs/composite_storage/sandbox/layout_all.1.cpp
==============================================================================
--- sandbox/variadic_templates/libs/composite_storage/sandbox/layout_all.1.cpp (original)
+++ sandbox/variadic_templates/libs/composite_storage/sandbox/layout_all.1.cpp 2010-10-07 10:34:38 EDT (Thu, 07 Oct 2010)
@@ -143,6 +143,34 @@
         HeadComposed head;
         this->operator()(head);
     }
+
+ template
+ < typename Composed
+ >
+ static
+ void
+ _(void)
+ {
+ typedef
+ alignment::aligned_offset
+ < Composed::size
+ , Composed::align
+ >
+ aligned_offset
+ /* aligned_offset::value is the size required
+ * to assure that when two elements of composite
+ * are in a vector, the 2nd would be aligned
+ * properly.
+ */
+ ;
+ std::cout
+ <<"aligned size="
+ <<aligned_offset::value
+ <<"\n";
+ print_layout_all pla;
+ Composed composed;
+ pla(composed);
+ }
 };
 
   template
@@ -161,8 +189,7 @@
         typedef
       typename layout_all<Pack>::type
     layout_result;
- print_layout_all pla;
- pla(layout_result());
+ print_layout_all::_<layout_result>();
 }
 
 }//exit layout namespace


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