Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r50485 - in sandbox/mirror: boost/mirror/intrinsic boost/mirror/visitors libs/mirror/example/special
From: chochlik_at_[hidden]
Date: 2009-01-05 12:44:26


Author: matus.chochlik
Date: 2009-01-05 12:44:25 EST (Mon, 05 Jan 2009)
New Revision: 50485
URL: http://svn.boost.org/trac/boost/changeset/50485

Log:
[mirror 0.3.x]
- minor bugfixes
Added:
   sandbox/mirror/boost/mirror/intrinsic/empty.hpp (contents, props changed)
Text files modified:
   sandbox/mirror/boost/mirror/intrinsic/size.hpp | 2 ++
   sandbox/mirror/boost/mirror/visitors/meta_path_sample.hpp | 7 ++++---
   sandbox/mirror/boost/mirror/visitors/sample.hpp | 2 +-
   sandbox/mirror/libs/mirror/example/special/boost_tuple.cpp | 2 +-
   4 files changed, 8 insertions(+), 5 deletions(-)

Added: sandbox/mirror/boost/mirror/intrinsic/empty.hpp
==============================================================================
--- (empty file)
+++ sandbox/mirror/boost/mirror/intrinsic/empty.hpp 2009-01-05 12:44:25 EST (Mon, 05 Jan 2009)
@@ -0,0 +1,73 @@
+/**
+ * \file boost/mirror/intrinsic/empty.hpp
+ * Gets count of meta-attributes/meta-inheritences/etc.
+ *
+ * Copyright 2008 Matus Chochlik. Distributed under the Boost
+ * Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ */
+
+#ifndef BOOST_MIRROR_INTRINSIC_EMPTY_HPP
+#define BOOST_MIRROR_INTRINSIC_EMPTY_HPP
+
+#include <boost/mpl/empty.hpp>
+
+#include <boost/mirror/meta_attributes.hpp>
+#include <boost/mirror/meta_inheritance.hpp>
+
+namespace boost {
+namespace mirror {
+namespace detail {
+
+ /** Declaration of the default at_impl
+ * helper template.
+ */
+ template <class MetaObjectSequence>
+ struct empty_impl { };
+
+ /** Specialization of at_impl<MetaObjectSequence>
+ * for meta_class_attributes<>
+ */
+ template <class Class, class VariantTag>
+ struct empty_impl<meta_class_attributes<Class, VariantTag> >
+ : mpl::empty<
+ typename meta_class_attributes<
+ Class,
+ VariantTag
+ >::type_list
+ >{ };
+
+ /** Specialization of for_each_impl<MetaObjectSequence>
+ * for meta_class_all_attributes<>
+ */
+ template <class Class, class VariantTag>
+ struct empty_impl<meta_class_all_attributes<Class, VariantTag> >
+ : mpl::empty<
+ typename meta_class_all_attributes<
+ Class,
+ VariantTag
+ >::type_list
+ >{ };
+
+ /** Specialization of for_each_impl<MetaObjectSequence>
+ * for meta_base_classes<>
+ */
+ template <class Class, class VariantTag>
+ struct empty_impl<meta_base_classes<Class, VariantTag> >
+ : mpl::empty<
+ typename meta_base_classes<
+ Class,
+ VariantTag
+ >::list
+ >{ };
+
+} // namespace detail
+
+template <class MetaObjectSequence>
+struct empty : detail::empty_impl<MetaObjectSequence> { };
+
+} // namespace mirror
+} // namespace boost
+
+#endif //include guard
+

Modified: sandbox/mirror/boost/mirror/intrinsic/size.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/intrinsic/size.hpp (original)
+++ sandbox/mirror/boost/mirror/intrinsic/size.hpp 2009-01-05 12:44:25 EST (Mon, 05 Jan 2009)
@@ -10,6 +10,8 @@
 #ifndef BOOST_MIRROR_INTRINSIC_SIZE_HPP
 #define BOOST_MIRROR_INTRINSIC_SIZE_HPP
 
+#include <boost/mpl/size.hpp>
+
 #include <boost/mirror/meta_attributes.hpp>
 #include <boost/mirror/meta_inheritance.hpp>
 

Modified: sandbox/mirror/boost/mirror/visitors/meta_path_sample.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/visitors/meta_path_sample.hpp (original)
+++ sandbox/mirror/boost/mirror/visitors/meta_path_sample.hpp 2009-01-05 12:44:25 EST (Mon, 05 Jan 2009)
@@ -18,8 +18,9 @@
 // traits
 #include <boost/mirror/traits/reflects_virtual_inheritance.hpp>
 #include <boost/mirror/traits/reflects_global_scope.hpp>
-// container size
+// container size and emptiness
 #include <boost/mirror/intrinsic/size.hpp>
+#include <boost/mirror/intrinsic/empty.hpp>
 //
 // meta-path related stuff
 #include <boost/mirror/meta_path/export_paths_and_nodes.hpp>
@@ -149,7 +150,7 @@
         template <class MetaClass, class BaseClasses, class Context>
         inline void enter_base_classes(MetaClass, BaseClasses, Context)
         {
- if(!mpl::empty<BaseClasses>::value)
+ if(!empty<BaseClasses>::value)
                         print_node(BaseClasses(), Context());
         }
         
@@ -172,7 +173,7 @@
         template <class MetaClass, class MetaAttributes, class Context>
         void enter_attributes(MetaClass, MetaAttributes, Context)
         {
- if(!mpl::empty<MetaAttributes>::value)
+ if(!empty<MetaAttributes>::value)
                         print_node(MetaAttributes(), Context());
         }
 

Modified: sandbox/mirror/boost/mirror/visitors/sample.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/visitors/sample.hpp (original)
+++ sandbox/mirror/boost/mirror/visitors/sample.hpp 2009-01-05 12:44:25 EST (Mon, 05 Jan 2009)
@@ -213,7 +213,7 @@
                 print_indentation();
                 cts::bcout() <<
                         "<value depth='" <<
- mpl::size<Context>::value <<
+ mpl::size<typename Context::paths_and_nodes >::value <<
                         "'>" <<
                         *ptr_to_inst <<
                         "</value>" <<

Modified: sandbox/mirror/libs/mirror/example/special/boost_tuple.cpp
==============================================================================
--- sandbox/mirror/libs/mirror/example/special/boost_tuple.cpp (original)
+++ sandbox/mirror/libs/mirror/example/special/boost_tuple.cpp 2009-01-05 12:44:25 EST (Mon, 05 Jan 2009)
@@ -81,7 +81,7 @@
         typedef B (C)(char, wchar_t);
         typedef A D[2][3];
         typedef ::boost::optional< ::boost::any> Z;
- typedef ::boost::variant< A, B, C, D> V;
+ typedef ::boost::variant< A, B, C&, D> V;
         typedef tuple<int, double, const string *> T1;
         typedef tuple<const A, volatile B, C&, D, V, Z> T2;
         typedef pair<T1, T2> T3;


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