Boost logo

Boost-Commit :

From: chochlik_at_[hidden]
Date: 2008-07-05 07:42:09


Author: matus.chochlik
Date: 2008-07-05 07:42:09 EDT (Sat, 05 Jul 2008)
New Revision: 47096
URL: http://svn.boost.org/trac/boost/changeset/47096

Log:
 - Fixed a array type name extent formatting bug
Text files modified:
   sandbox/mirror/boost/mirror/detail/decorated_type_name.hpp | 32 ++++++++++++++++++--------------
   sandbox/mirror/boost/mirror/detail/full_name_builder.hpp | 3 ++-
   sandbox/mirror/libs/mirror/example/registering/types.cpp | 4 +++-
   3 files changed, 23 insertions(+), 16 deletions(-)

Modified: sandbox/mirror/boost/mirror/detail/decorated_type_name.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/detail/decorated_type_name.hpp (original)
+++ sandbox/mirror/boost/mirror/detail/decorated_type_name.hpp 2008-07-05 07:42:09 EDT (Sat, 05 Jul 2008)
@@ -28,9 +28,11 @@
         {
                 bstring left;
                 bstring right;
- bstring temp(build_name(full_or_base, left, right));
+ bstring ex(BOOST_STR_LIT(" "));
+ bstring temp(build_name(full_or_base, left, right, ex));
                 left.append(temp);
                 left.append(right);
+ left.append(ex);
                 return left;
         }
 
@@ -40,14 +42,16 @@
         inline static bstring build_name(
                 mpl::bool_<FullName> full_or_base,
                 bstring& left,
- bstring& right
+ bstring& right,
+ bstring& ex
         )
         {
- Decorator D(left, right);
+ Decorator D(left, right, ex);
                 return MetaType::build_name(
                         full_or_base,
                         left,
- right
+ right,
+ ex
                 );
         }
 
@@ -95,7 +99,7 @@
 struct type_name_decorator<T*>
 : type_name_right_postfix_decorator
 {
- inline type_name_decorator(bstring&, bstring& _right)
+ inline type_name_decorator(bstring&, bstring& _right, bstring&)
         : type_name_right_postfix_decorator(_right, BOOST_STR_LIT(" *"))
         { }
 };
@@ -106,7 +110,7 @@
 struct type_name_decorator<T&>
 : type_name_right_postfix_decorator
 {
- inline type_name_decorator(bstring&, bstring& _right)
+ inline type_name_decorator(bstring&, bstring& _right, bstring&)
         : type_name_right_postfix_decorator(_right, BOOST_STR_LIT(" &"))
         { }
 };
@@ -116,7 +120,7 @@
 struct type_name_decorator<const T>
 : type_name_right_postfix_decorator
 {
- inline type_name_decorator(bstring&, bstring& _right)
+ inline type_name_decorator(bstring&, bstring& _right, bstring&)
         : type_name_right_postfix_decorator(_right, BOOST_STR_LIT(" const"))
         { }
 };
@@ -126,7 +130,7 @@
 struct type_name_decorator<volatile T>
 : type_name_right_postfix_decorator
 {
- inline type_name_decorator(bstring&, bstring& _right)
+ inline type_name_decorator(bstring&, bstring& _right, bstring&)
         : type_name_right_postfix_decorator(_right, BOOST_STR_LIT(" volatile"))
         { }
 };
@@ -136,7 +140,7 @@
 struct type_name_decorator<const volatile T>
 : type_name_right_postfix_decorator
 {
- inline type_name_decorator(bstring&, bstring& _r)
+ inline type_name_decorator(bstring&, bstring& _r, bstring&)
         : type_name_right_postfix_decorator(_r, BOOST_STR_LIT(" const volatile"))
         { }
 };
@@ -145,9 +149,9 @@
 template <typename T>
 struct type_name_decorator< T[] >
 {
- inline type_name_decorator(bstring&, bstring& _right)
+ inline type_name_decorator(bstring&, bstring&, bstring& _ex)
         {
- _right.append(BOOST_STR_LIT(" []"));
+ _ex.append(BOOST_STR_LIT("[]"));
         }
 };
 
@@ -162,7 +166,7 @@
                 typedef typename detail::static_int_to_str<Size>
                         size_string;
                 // init with '['
- bstring res(BOOST_STR_LIT(" ["));
+ bstring res(BOOST_STR_LIT("["));
                 //
                 // setup a buffer for the number
                 const size_t max_size = size_string::length::value+1;
@@ -176,10 +180,10 @@
                 return res;
         }
 public:
- inline type_name_decorator(bstring&, bstring& _right)
+ inline type_name_decorator(bstring&, bstring&, bstring& _ex)
         {
                 static bstring s_postfix(init_postfix());
- _right.append(s_postfix);
+ _ex.append(s_postfix);
         }
 };
 

Modified: sandbox/mirror/boost/mirror/detail/full_name_builder.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/detail/full_name_builder.hpp (original)
+++ sandbox/mirror/boost/mirror/detail/full_name_builder.hpp 2008-07-05 07:42:09 EDT (Sat, 05 Jul 2008)
@@ -87,7 +87,8 @@
                 inline static const bstring& build_name(
                         mpl::bool_<FullName> full_or_base,
                         bstring& left,
- bstring& right
+ bstring& right,
+ bstring& ex
                 )
                 {
                         return get_name(full_or_base);

Modified: sandbox/mirror/libs/mirror/example/registering/types.cpp
==============================================================================
--- sandbox/mirror/libs/mirror/example/registering/types.cpp (original)
+++ sandbox/mirror/libs/mirror/example/registering/types.cpp 2008-07-05 07:42:09 EDT (Sat, 05 Jul 2008)
@@ -180,7 +180,9 @@
         bcout << "|44| " << BOOST_MIRRORED_TYPE(const volatile ::baz*) ::full_name() << endl;
         bcout << "|44| " << BOOST_MIRRORED_TYPEDEF(::, foobar) ::full_name() << endl;
         //
- bcout << "|45| " << BOOST_MIRRORED_TYPE(::bar[][1][2][3][4][5][6][7][8][9]) ::full_name() << endl;
+ typedef ::bar * const * t45 [][1][2][3][4][5][6][7][8][9];
+ bcout << typeid(t45).name() << endl;
+ bcout << "|45| " << BOOST_MIRRORED_TYPE(t45) ::full_name() << endl;
         //
         return 0;
 }


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