Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r63396 - in sandbox/intro/boost/intro: . detail
From: strasser_at_[hidden]
Date: 2010-06-27 14:53:18


Author: stefans
Date: 2010-06-27 14:53:13 EDT (Sun, 27 Jun 2010)
New Revision: 63396
URL: http://svn.boost.org/trac/boost/changeset/63396

Log:
GCC fixes
Added:
   sandbox/intro/boost/intro/apply_members.hpp (contents, props changed)
   sandbox/intro/boost/intro/apply_members_binary.hpp (contents, props changed)
Removed:
   sandbox/intro/boost/intro/apply.hpp
   sandbox/intro/boost/intro/apply_binary.hpp
Text files modified:
   sandbox/intro/boost/intro/apply_recursive.hpp | 45 +++++++++++++++++-----------
   sandbox/intro/boost/intro/array_extension.hpp | 1
   sandbox/intro/boost/intro/container.hpp | 2 +
   sandbox/intro/boost/intro/detail/flat_map.hpp | 1
   sandbox/intro/boost/intro/detail/map_insert_view.hpp | 4 +-
   sandbox/intro/boost/intro/detail/optional_map.hpp | 8 ++--
   sandbox/intro/boost/intro/detail/optional_set.hpp | 8 ++--
   sandbox/intro/boost/intro/detail/pooled_set.hpp | 17 +++++-----
   sandbox/intro/boost/intro/detail/pooled_unordered_set.hpp | 16 +++++-----
   sandbox/intro/boost/intro/detail/set_insert_view.hpp | 4 +-
   sandbox/intro/boost/intro/dispatch_polymorphic.hpp | 62 +++++++++++++++++++++------------------
   sandbox/intro/boost/intro/introspect.hpp | 3 +
   sandbox/intro/boost/intro/memory_archive.hpp | 2
   sandbox/intro/boost/intro/move.hpp | 59 ++++++++++++++++++++++---------------
   sandbox/intro/boost/intro/print.hpp | 19 ++++++++---
   sandbox/intro/boost/intro/reset_shared.hpp | 9 +---
   sandbox/intro/boost/intro/serialize.hpp | 51 +++++++++++++++++++++----------
   17 files changed, 181 insertions(+), 130 deletions(-)

Deleted: sandbox/intro/boost/intro/apply.hpp
==============================================================================
--- sandbox/intro/boost/intro/apply.hpp 2010-06-27 14:53:13 EDT (Sun, 27 Jun 2010)
+++ (empty file)
@@ -1,68 +0,0 @@
-// Copyright Stefan Strasser 2010.
-// 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_INTRO_APPLY_HPP
-#define BOOST_INTRO_APPLY_HPP
-
-#include <boost/intro/introspect.hpp>
-#include <boost/intro/detail/has_complement_operator.hpp>
-#include <boost/intro/detail/complement.hpp>
-#include <boost/type_traits/remove_const.hpp>
-#include <boost/utility/enable_if.hpp>
-
-
-namespace boost{
-namespace intro{
-namespace detail{
-template<class,class>
-struct applier;
-}
-
-template<class F,class T>
-void apply(F const &f,T &t){
- intro::for_each_local<T>(detail::applier<F,T>(f,t));
-}
-
-
-namespace detail{
-
-template<class F,class Class,class T,T Class::*Ptr,class Semantics>
-void apply(F const &f,Class &c,
- member_t<typename remove_const<Class>::type,T,Ptr,Semantics>){
- f(c.*Ptr,Semantics());
-}
-
-template<class F,class Class,class Base>
-void apply(F const &f,Class &c,base_class<Base>){
- typename mpl::if_<is_const<Class>,Base const,Base>::type &base=c;
- using intro::apply;
- apply(f,base); //recurse into base classes
-}
-
-template<class F,class Class>
-struct applier{
- applier(F const &f,Class &c) : f(f),c(c){}
- typedef void result_type;
- template<class Local>
- void operator()(Local local) const{
- apply(f,c,local);
- }
- applier<complement<F>,Class> operator~() const{
- return applier<complement<F>,Class>(complement<F>(f),c);
- }
-private:
- F const f;
- Class &c;
-};
-
-template<class F,class Class>
-struct has_complement_operator<applier<F,Class> >
- : has_complement_operator<F>{};
-
-}
-}
-}
-
-#endif

Deleted: sandbox/intro/boost/intro/apply_binary.hpp
==============================================================================
--- sandbox/intro/boost/intro/apply_binary.hpp 2010-06-27 14:53:13 EDT (Sun, 27 Jun 2010)
+++ (empty file)
@@ -1,73 +0,0 @@
-// Copyright Stefan Strasser 2010.
-// 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_INTRO_APPLY_BINARY_HPP
-#define BOOST_INTRO_APPLY_BINARY_HPP
-
-#include <boost/intro/introspect.hpp>
-#include <boost/type_traits/remove_const.hpp>
-#include <boost/bind.hpp>
-#include <boost/intro/detail/complement.hpp>
-#include <boost/intro/detail/has_complement_operator.hpp>
-
-
-namespace boost{
-namespace intro{
-namespace detail{
-template<class,class,class>
-struct binary_applier;
-}
-
-template<class F,class T,class T2>
-void apply_binary(F const &f,T &t,T2 &t2){
- T const &t2const=t2; (void)t2const;//T and T2 must only differ in const-ness
- T2 const &t1const=t; (void)t1const;
- intro::for_each_local<T>(detail::binary_applier<F,T,T2>(f,t,t2));
-}
-
-
-namespace detail{
-
-template<class F,class Class,class Class2,class T,T Class::*Ptr,class Semantics>
-void apply_binary(F const &f,Class &c,Class2 &c2,
- member_t<typename remove_const<Class>::type,T,Ptr,Semantics>){
- f(c.*Ptr,c2.*Ptr,Semantics());
-}
-
-template<class F,class Class,class Class2,class Base>
-void apply_binary(F const &f,Class &c,Class2 &c2,base_class<Base>){
- typename mpl::if_<is_const<Class>,Base const,Base>::type &base=c;
- typename mpl::if_<is_const<Class2>,Base const,Base>::type &base2=c2;
- using intro::apply_binary;
- apply_binary(f,base,base2); //recurse into base classes
-}
-
-template<class F,class T,class T2>
-struct binary_applier{
- binary_applier(F const &f,T &t,T2 &t2) : f(f),t(t),t2(t2){}
- typedef void result_type;
- template<class Local>
- void operator()(Local local) const{
- apply_binary(f,t,t2,local);
- }
- binary_applier<complement<F>,T,T2> operator~() const{
- return binary_applier<complement<F>,T,T2>(complement<F>(f),t,t2);
- }
-private:
- F const f;
- T &t;
- T2 &t2;
-};
-
-template<class F,class T,class T2>
-struct has_complement_operator<binary_applier<F,T,T2> >
- : has_complement_operator<F>{};
-
-
-}
-}
-}
-
-#endif

Added: sandbox/intro/boost/intro/apply_members.hpp
==============================================================================
--- (empty file)
+++ sandbox/intro/boost/intro/apply_members.hpp 2010-06-27 14:53:13 EDT (Sun, 27 Jun 2010)
@@ -0,0 +1,68 @@
+// Copyright Stefan Strasser 2010.
+// 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_INTRO_APPLY_MEMBERS_HPP
+#define BOOST_INTRO_APPLY_MEMBERS_HPP
+
+#include <boost/intro/introspect.hpp>
+#include <boost/intro/detail/has_complement_operator.hpp>
+#include <boost/intro/detail/complement.hpp>
+#include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
+
+
+namespace boost{
+namespace intro{
+namespace detail{
+template<class,class>
+struct applier;
+}
+
+template<class F,class T>
+void apply_members(F const &f,T &t){
+ intro::for_each_local<T>(detail::applier<F,T>(f,t));
+}
+
+
+namespace detail{
+
+template<class F,class Class,class T,T Class::*Ptr,class Semantics>
+void apply_members(F const &f,Class &c,
+ member_t<typename remove_const<Class>::type,T,Ptr,Semantics>){
+ f(c.*Ptr,Semantics());
+}
+
+template<class F,class Class,class Base>
+void apply_members(F const &f,Class &c,base_class<Base>){
+ typename mpl::if_<is_const<Class>,Base const,Base>::type &base=c;
+ using intro::apply_members;
+ apply_members(f,base); //recurse into base classes
+}
+
+template<class F,class Class>
+struct applier{
+ applier(F const &f,Class &c) : f(f),c(c){}
+ typedef void result_type;
+ template<class Local>
+ void operator()(Local local) const{
+ apply_members(f,c,local);
+ }
+ applier<complement<F>,Class> operator~() const{
+ return applier<complement<F>,Class>(complement<F>(f),c);
+ }
+private:
+ F const f;
+ Class &c;
+};
+
+template<class F,class Class>
+struct has_complement_operator<applier<F,Class> >
+ : has_complement_operator<F>{};
+
+}
+}
+}
+
+#endif

Added: sandbox/intro/boost/intro/apply_members_binary.hpp
==============================================================================
--- (empty file)
+++ sandbox/intro/boost/intro/apply_members_binary.hpp 2010-06-27 14:53:13 EDT (Sun, 27 Jun 2010)
@@ -0,0 +1,73 @@
+// Copyright Stefan Strasser 2010.
+// 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_INTRO_APPLY_MEMBERS_BINARY_HPP
+#define BOOST_INTRO_APPLY_MEMBERS_BINARY_HPP
+
+#include <boost/intro/introspect.hpp>
+#include <boost/type_traits/remove_const.hpp>
+#include <boost/bind.hpp>
+#include <boost/intro/detail/complement.hpp>
+#include <boost/intro/detail/has_complement_operator.hpp>
+
+
+namespace boost{
+namespace intro{
+namespace detail{
+template<class,class,class>
+struct binary_applier;
+}
+
+template<class F,class T,class T2>
+void apply_members_binary(F const &f,T &t,T2 &t2){
+ T const &t2const=t2; (void)t2const;//T and T2 must only differ in const-ness
+ T2 const &t1const=t; (void)t1const;
+ intro::for_each_local<T>(detail::binary_applier<F,T,T2>(f,t,t2));
+}
+
+
+namespace detail{
+
+template<class F,class Class,class Class2,class T,T Class::*Ptr,class Semantics>
+void apply_members_binary(F const &f,Class &c,Class2 &c2,
+ member_t<typename remove_const<Class>::type,T,Ptr,Semantics>){
+ f(c.*Ptr,c2.*Ptr,Semantics());
+}
+
+template<class F,class Class,class Class2,class Base>
+void apply_members_binary(F const &f,Class &c,Class2 &c2,base_class<Base>){
+ typename mpl::if_<is_const<Class>,Base const,Base>::type &base=c;
+ typename mpl::if_<is_const<Class2>,Base const,Base>::type &base2=c2;
+ using intro::apply_members_binary;
+ apply_members_binary(f,base,base2); //recurse into base classes
+}
+
+template<class F,class T,class T2>
+struct binary_applier{
+ binary_applier(F const &f,T &t,T2 &t2) : f(f),t(t),t2(t2){}
+ typedef void result_type;
+ template<class Local>
+ void operator()(Local local) const{
+ apply_members_binary(f,t,t2,local);
+ }
+ binary_applier<complement<F>,T,T2> operator~() const{
+ return binary_applier<complement<F>,T,T2>(complement<F>(f),t,t2);
+ }
+private:
+ F const f;
+ T &t;
+ T2 &t2;
+};
+
+template<class F,class T,class T2>
+struct has_complement_operator<binary_applier<F,T,T2> >
+ : has_complement_operator<F>{};
+
+
+}
+}
+}
+
+#endif

Modified: sandbox/intro/boost/intro/apply_recursive.hpp
==============================================================================
--- sandbox/intro/boost/intro/apply_recursive.hpp (original)
+++ sandbox/intro/boost/intro/apply_recursive.hpp 2010-06-27 14:53:13 EDT (Sun, 27 Jun 2010)
@@ -6,7 +6,7 @@
 #ifndef BOOST_INTRO_APPLY_RECURSIVE_HPP
 #define BOOST_INTRO_APPLY_RECURSIVE_HPP
 
-#include <boost/intro/apply.hpp>
+#include <boost/intro/apply_members.hpp>
 #include <boost/intro/dispatch_polymorphic.hpp>
 #include <boost/intro/detail/pooled_unordered_set.hpp>
 #include <boost/intro/detail/optional_set.hpp>
@@ -51,37 +51,46 @@
 
 }
 
+namespace detail{
+
+template<class,class>
+struct recursive_member_applier;
+
 template<class F,class Data,class T,class Semantics>
-void apply_member_recursive(F const &f,Data &data,T &t,Semantics){
- detail::apply_member_recursive(f,data,t,Semantics(),
- typename mpl::has_key<typename Semantics::set,polymorphic>::type(),
- typename mpl::has_key<typename Semantics::set,shared>::type());
+void apply_member_recursive(F const &f,Data &data,T &t,Semantics,mpl::false_ poly,mpl::false_ shared_){
+ f(t,Semantics()); //TODO sollte das bei undo-en nach apply_recursive passieren?
+ apply_recursive(f,data,t,Semantics());
 }
 
-namespace detail{
-
+template<class F,class Data,class T,class Semantics>
+void apply_member_recursive(F const &f,Data &data,T &t,Semantics,mpl::false_ poly,mpl::true_ shared_){
+ if(data.register_applied_object(t))
+ detail::apply_member_recursive(f,data,t,Semantics(),poly,mpl::false_());
+}
 template<class F,class Data,class T,class Semantics,bool Shared>
 void apply_member_recursive(F const &f,Data &data,T &t,Semantics,mpl::true_ poly,mpl::bool_<Shared>){
     dispatch_polymorphic(
- bind(
+ boost::bind(
             detail::recursive_member_applier<F,Data>(f,data),
             _1,
             Semantics(),
             mpl::false_(),
             mpl::bool_<Shared>()
         ),t);
-}
-template<class F,class Data,class T,class Semantics>
-void apply_member_recursive(F const &f,Data &data,T &t,Semantics,mpl::false_ poly,mpl::true_ shared_){
- if(data.register_applied_object(t))
- detail::apply_member_recursive(f,data,t,Semantics(),poly,mpl::false_());
 }
+
+
+}
+
 template<class F,class Data,class T,class Semantics>
-void apply_member_recursive(F const &f,Data &data,T &t,Semantics,mpl::false_ poly,mpl::false_ shared_){
- f(t,Semantics()); //TODO sollte das bei undo-en nach apply_recursive passieren?
- apply_recursive(f,data,t,Semantics());
+void apply_member_recursive(F const &f,Data &data,T &t,Semantics){
+ detail::apply_member_recursive(f,data,t,Semantics(),
+ typename mpl::has_key<typename Semantics::set,polymorphic>::type(),
+ typename mpl::has_key<typename Semantics::set,shared>::type());
 }
 
+namespace detail{
+
 template<class F,class Data>
 struct recursive_member_applier{
     typedef void result_type;
@@ -110,8 +119,8 @@
 
 template<class F,class Data,class T>
 void apply_recursive_class(F const &f,Data &data,T &t,mpl::true_ is_class_){
- using intro::apply;
- apply(detail::recursive_member_applier<F,Data>(f,data),t);
+ using intro::apply_members;
+ apply_members(detail::recursive_member_applier<F,Data>(f,data),t);
 }
 
 template<class F,class Data,class T>

Modified: sandbox/intro/boost/intro/array_extension.hpp
==============================================================================
--- sandbox/intro/boost/intro/array_extension.hpp (original)
+++ sandbox/intro/boost/intro/array_extension.hpp 2010-06-27 14:53:13 EDT (Sun, 27 Jun 2010)
@@ -10,6 +10,7 @@
 #include <boost/type_traits/is_pod.hpp>
 #include <iterator>
 #include <algorithm>
+#include <cstring>
 
 namespace boost{
 namespace intro{

Modified: sandbox/intro/boost/intro/container.hpp
==============================================================================
--- sandbox/intro/boost/intro/container.hpp (original)
+++ sandbox/intro/boost/intro/container.hpp 2010-06-27 14:53:13 EDT (Sun, 27 Jun 2010)
@@ -5,6 +5,8 @@
 #include <boost/mpl/if.hpp>
 #include <boost/type_traits/is_const.hpp>
 #include <boost/intro/detail/indent_streambuf.hpp>
+#include <boost/intro/serialize.hpp>
+#include <boost/intro/apply_recursive.hpp>
 #include <ostream>
 
 namespace boost{

Modified: sandbox/intro/boost/intro/detail/flat_map.hpp
==============================================================================
--- sandbox/intro/boost/intro/detail/flat_map.hpp (original)
+++ sandbox/intro/boost/intro/detail/flat_map.hpp 2010-06-27 14:53:13 EDT (Sun, 27 Jun 2010)
@@ -9,6 +9,7 @@
 #include <vector>
 #include <utility>
 #include <algorithm>
+#include <functional>
 
 namespace boost{
 namespace intro{

Modified: sandbox/intro/boost/intro/detail/map_insert_view.hpp
==============================================================================
--- sandbox/intro/boost/intro/detail/map_insert_view.hpp (original)
+++ sandbox/intro/boost/intro/detail/map_insert_view.hpp 2010-06-27 14:53:13 EDT (Sun, 27 Jun 2010)
@@ -33,8 +33,8 @@
     typedef typename Map::size_type size_type;
     typedef typename Map::difference_type difference_type;
 
- map_insert_view(Map &map,const_reference element,key_equal const &eq=key_equal())
- : eq(eq),map(map),element(element){}
+ map_insert_view(Map &map,const_reference element,key_equal const &eq_=key_equal())
+ : eq(eq_),map(map),element(element){}
 
     bool empty() const{ return false; }
     size_type size() const{ return map.size() + 1; }

Modified: sandbox/intro/boost/intro/detail/optional_map.hpp
==============================================================================
--- sandbox/intro/boost/intro/detail/optional_map.hpp (original)
+++ sandbox/intro/boost/intro/detail/optional_map.hpp 2010-06-27 14:53:13 EDT (Sun, 27 Jun 2010)
@@ -41,9 +41,9 @@
         return *map;
     }
     iterator begin(){ return map ? map->begin() : empty_map.begin(); }
- const_iterator begin() const{ return map ? map->begin() : empty_map.begin(); }
+ const_iterator begin() const{ if(map) return map->begin(); else return empty_map.begin(); }
     iterator end(){ return map ? map->end() : empty_map.end(); }
- const_iterator end() const{ return map ? map->end() : empty_map.end(); }
+ const_iterator end() const{ if(map) return map->end(); else return empty_map.end(); }
     bool empty() const{ return !map || map->empty(); }
     size_type size() const{ return map ? map->size() : 0; }
     size_type max_size() const{ return empty_map.max_size(); }
@@ -68,13 +68,13 @@
     }
     void clear(){ if(map) map->clear(); }
     iterator find(key_type const &x){ return map ? map->find(x) : empty_map.end(); }
- const_iterator find(key_type const &x) const{ return map ? map->find(x) : empty_map.end(); }
+ const_iterator find(key_type const &x) const{ if(map) return map->find(x); else return empty_map.end(); }
     size_type count(key_type const &x) const{ return map ? map->count(x) : 0; }
     std::pair<iterator,iterator> equal_range(key_type const &x){
         return map ? map->equal_range(x) : std::make_pair(empty_map.end(),empty_map.end());
     }
     std::pair<const_iterator,const_iterator> equal_range(key_type const &x) const{
- return map ? map->equal_range(x) : std::make_pair(empty_map.end(),empty_map.end());
+ if(map) return map->equal_range(x); else return std::make_pair(empty_map.end(),empty_map.end());
     }
 private:
     optional<Map> map;

Modified: sandbox/intro/boost/intro/detail/optional_set.hpp
==============================================================================
--- sandbox/intro/boost/intro/detail/optional_set.hpp (original)
+++ sandbox/intro/boost/intro/detail/optional_set.hpp 2010-06-27 14:53:13 EDT (Sun, 27 Jun 2010)
@@ -40,9 +40,9 @@
         return *set;
     }
     iterator begin(){ return set ? set->begin() : empty_set.begin(); }
- const_iterator begin() const{ return set ? set->begin() : empty_set.begin(); }
+ const_iterator begin() const{ if(set) return set->begin(); else return empty_set.begin(); }
     iterator end(){ return set ? set->end() : empty_set.end(); }
- const_iterator end() const{ return set ? set->end() : empty_set.end(); }
+ const_iterator end() const{ if(set) return set->end(); else return empty_set.end(); }
     bool empty() const{ return !set || set->empty(); }
     size_type size() const{ return set ? set->size() : 0; }
     size_type max_size() const{ return empty_set.max_size(); }
@@ -66,13 +66,13 @@
     }
     void clear(){ if(set) set->clear(); }
     iterator find(const_reference x){ return set ? set->find(x) : empty_set.end(); }
- const_iterator find(const_reference x) const{ return set ? set->find(x) : empty_set.end(); }
+ const_iterator find(const_reference x) const{ if(set) return set->find(x); else return empty_set.end(); }
     size_type count(const_reference x) const{ return set ? set->count(x) : 0; }
     std::pair<iterator,iterator> equal_range(const_reference x){
         return set ? set->equal_range(x) : std::make_pair(empty_set.end(),empty_set.end());
     }
     std::pair<const_iterator,const_iterator> equal_range(const_reference x) const{
- return set ? set->equal_range(x) : std::make_pair(empty_set.end(),empty_set.end());
+ if(set) return set->equal_range(x); else return std::make_pair(empty_set.end(),empty_set.end());
     }
 private:
     optional<Set> set;

Modified: sandbox/intro/boost/intro/detail/pooled_set.hpp
==============================================================================
--- sandbox/intro/boost/intro/detail/pooled_set.hpp (original)
+++ sandbox/intro/boost/intro/detail/pooled_set.hpp 2010-06-27 14:53:13 EDT (Sun, 27 Jun 2010)
@@ -28,7 +28,6 @@
         node,
         intrusive::base_hook<hook>
> set_type;
-
 public:
     typedef T key_type;
     typedef key_type value_type;
@@ -40,7 +39,6 @@
     typedef value_type const *const_pointer;
     typedef immutable_iterator<pointer> iterator;
     typedef immutable_iterator<const_pointer> const_iterator;
-
     iterator begin(){
         if(empty()) return end();
         else return iterator(&*set.begin());
@@ -56,7 +54,7 @@
         typename set_type::insert_commit_data commit_data;
         std::pair<typename set_type::iterator,bool> ret=
             this->set.insert_check(x,
- node::less<Compare>(Compare()),commit_data);
+ typename node::template less<Compare>(Compare()),commit_data);
         if(ret.second){
             ret.first=this->set.insert_commit(*this->node_pool.new_(in_place(x)),commit_data);
             return std::make_pair(&ret.first->key,true);
@@ -65,13 +63,13 @@
     size_type size() const{ return set.size(); }
     template<class Key,class KeyValueCompare>
     iterator find(Key const &key,KeyValueCompare compare){
- typename set_type::iterator it=this->set.find(key,node::less<KeyValueCompare>(compare));
+ typename set_type::iterator it=this->set.find(key,typename node::template less<KeyValueCompare>(compare));
         if(it == this->set.end()) return iterator(0); //TODO use real iterator
         else return iterator(&it->key);
     }
     template<class Key,class KeyValueCompare>
     const_iterator find(Key const &key,KeyValueCompare compare) const{
- typename set_type::const_iterator it=this->set.find(key,hash,node::less<KeyValueCompare>(compare));
+ typename set_type::const_iterator it=this->set.find(key,typename node::template less<KeyValueCompare>(compare));
         if(it == this->set.end()) return const_iterator(0);
         else return const_iterator(&it->key);
     }
@@ -84,12 +82,12 @@
         template<class Base>
         struct less{
             explicit less(Base const &base) : base(base){}
- template<class T>
- bool operator()(T const &o1,node const &o2) const{
+ template<class K>
+ bool operator()(K const &o1,node const &o2) const{
                 return base(o1,o2.key);
             }
- template<class T>
- bool operator()(node const &o1,T const &o2) const{
+ template<class K>
+ bool operator()(node const &o1,K const &o2) const{
                 return base(o1.key,o2);
             }
         private:
@@ -97,6 +95,7 @@
         };
         value_type key;
     };
+
     expo_pool<node,InitialCapacity,2> node_pool;
     set_type set;
 };

Modified: sandbox/intro/boost/intro/detail/pooled_unordered_set.hpp
==============================================================================
--- sandbox/intro/boost/intro/detail/pooled_unordered_set.hpp (original)
+++ sandbox/intro/boost/intro/detail/pooled_unordered_set.hpp 2010-06-27 14:53:13 EDT (Sun, 27 Jun 2010)
@@ -62,7 +62,7 @@
         typename set_type::insert_commit_data commit_data;
         std::pair<typename set_type::iterator,bool> ret=
             this->set.insert_check(x,Hash(),
- node::equal_to<Equal>(Equal()),commit_data);
+ typename node::template equal_to<Equal>(Equal()),commit_data);
         if(ret.second){
             ret.first=this->set.insert_commit(*this->node_pool.new_(in_place(x)),commit_data);
             this->buckets.rehash(this->set);
@@ -73,18 +73,18 @@
     //exception at the moment, shortly before the entire map
     //is destroyed
     size_type erase(const_reference x){
- return this->set.erase(x,Hash(),node::equal_to<Equal>(Equal()));
+ return this->set.erase(x,Hash(),typename node::template equal_to<Equal>(Equal()));
     }
     size_type size() const{ return set.size(); }
     template<class Key,class KeyHasher,class KeyValueEqual>
     iterator find(Key const &key,KeyHasher hash,KeyValueEqual equal){
- typename set_type::iterator it=this->set.find(key,hash,node::equal_to<KeyValueEqual>(equal));
+ typename set_type::iterator it=this->set.find(key,hash,typename node::template equal_to<KeyValueEqual>(equal));
         if(it == this->set.end()) return iterator(0); //TODO use real iterator
         else return iterator(&it->key);
     }
     template<class Key,class KeyHasher,class KeyValueEqual>
     const_iterator find(Key const &key,KeyHasher hash,KeyValueEqual equal) const{
- typename set_type::const_iterator it=this->set.find(key,hash,node::equal_to<KeyValueEqual>(equal));
+ typename set_type::const_iterator it=this->set.find(key,hash,typename node::template equal_to<KeyValueEqual>(equal));
         if(it == this->set.end()) return const_iterator(0);
         else return const_iterator(&it->key);
     }
@@ -100,12 +100,12 @@
         template<class Base>
         struct equal_to{
             explicit equal_to(Base const &base) : base(base){}
- template<class T>
- bool operator()(T const &o1,node const &o2) const{
+ template<class K>
+ bool operator()(K const &o1,node const &o2) const{
                 return base(o1,o2.key);
             }
- template<class T>
- bool operator()(node const &o1,T const &o2) const{
+ template<class K>
+ bool operator()(node const &o1,K const &o2) const{
                 return base(o1.key,o2);
             }
         private:

Modified: sandbox/intro/boost/intro/detail/set_insert_view.hpp
==============================================================================
--- sandbox/intro/boost/intro/detail/set_insert_view.hpp (original)
+++ sandbox/intro/boost/intro/detail/set_insert_view.hpp 2010-06-27 14:53:13 EDT (Sun, 27 Jun 2010)
@@ -32,8 +32,8 @@
     typedef typename Set::size_type size_type;
     typedef typename Set::difference_type difference_type;
 
- set_insert_view(Set &set,const_reference element,key_equal const &eq=key_equal())
- : eq(eq),set(set),element(element){}
+ set_insert_view(Set &set,const_reference element,key_equal const &eq_=key_equal())
+ : eq(eq_),set(set),element(element){}
 
     bool empty() const{ return false; }
     size_type size() const{ return set.size() + 1; }

Modified: sandbox/intro/boost/intro/dispatch_polymorphic.hpp
==============================================================================
--- sandbox/intro/boost/intro/dispatch_polymorphic.hpp (original)
+++ sandbox/intro/boost/intro/dispatch_polymorphic.hpp 2010-06-27 14:53:13 EDT (Sun, 27 Jun 2010)
@@ -14,7 +14,6 @@
 #include <boost/intro/introspect.hpp>
 #include <boost/type_traits/is_polymorphic.hpp>
 #include <boost/assert.hpp>
-#include <boost/bind.hpp>
 
 
 namespace boost{
@@ -24,33 +23,6 @@
 
 namespace detail{
 
-template<class Algo,class Base,class Derived>
-struct register_class{
- virtual void instantiate(){
- reg.instantiate();
- }
- struct reg_type{
- reg_type(){
- //std::cerr << typeid(Base).name() << " is base of " << typeid(Derived).name() << " for " << typeid(Algo).name() << std::endl << std::endl;
- this->reg(typename is_const<Base>::type());
- }
- void reg(mpl::true_){
- polymorphic_dispatcher<Algo,Base>::register_derived<Derived const>();
- }
- void reg(mpl::false_){
- polymorphic_dispatcher<Algo,Base>::register_derived<Derived>();
- }
- virtual void instantiate(){}
- };
- static reg_type reg;
- typedef void type;
-};
-
-
-template<class Algo,class Base,class Derived>
-typename register_class<Algo,Base,Derived>::reg_type
-register_class<Algo,Base,Derived>::reg;
-
 struct adl_tag{};
 template<class Algo,class Base>
 void register_classes(Algo const *,Base *,int,adl_tag){}
@@ -136,7 +108,41 @@
     return polymorphic_dispatcher<F,T>::dispatch(f,t);
 }
 
+namespace detail{
+
+template<void (*)()> struct instantiate_function{};
 
+template<class Algo,class Base,class Derived>
+struct register_class{
+#ifdef BOOST_MSVC
+ virtual void instantiate(){ reg.instantiate(); }
+#else
+ static void instantiate(){ reg.instantiate(); }
+ typedef instantiate_function<&register_class::instantiate> _;
+#endif
+ struct reg_type{
+ reg_type(){
+ //std::cerr << typeid(Base).name() << " is base of " << typeid(Derived).name() << " for " << typeid(Algo).name() << std::endl << std::endl;
+ this->reg(typename is_const<Base>::type());
+ }
+ void reg(mpl::true_){
+ polymorphic_dispatcher<Algo,Base>::template register_derived<Derived const>();
+ }
+ void reg(mpl::false_){
+ polymorphic_dispatcher<Algo,Base>::template register_derived<Derived>();
+ }
+ void instantiate(){}
+ };
+ static reg_type reg;
+ typedef void type;
+};
+
+
+template<class Algo,class Base,class Derived>
+typename register_class<Algo,Base,Derived>::reg_type
+register_class<Algo,Base,Derived>::reg;
+
+}
 }
 }
 

Modified: sandbox/intro/boost/intro/introspect.hpp
==============================================================================
--- sandbox/intro/boost/intro/introspect.hpp (original)
+++ sandbox/intro/boost/intro/introspect.hpp 2010-06-27 14:53:13 EDT (Sun, 27 Jun 2010)
@@ -21,6 +21,7 @@
 #include <boost/fusion/include/mpl.hpp>
 #include <boost/noncopyable.hpp>
 #include <boost/utility/enable_if.hpp>
+#include <typeinfo>
 
 
 namespace boost{
@@ -194,7 +195,7 @@
     std::type_info const *last_local=0;
     try{
         introspect( //ADL
- apply_mapping<apply_catcher<F,T> >(apply_catcher<F,T>(f,last_local)),
+ apply_mapping<apply_catcher<F,T>,T>(apply_catcher<F,T>(f,last_local)),
             type<typename remove_const<T>::type>()
         );
     }catch(...){

Modified: sandbox/intro/boost/intro/memory_archive.hpp
==============================================================================
--- sandbox/intro/boost/intro/memory_archive.hpp (original)
+++ sandbox/intro/boost/intro/memory_archive.hpp 2010-06-27 14:53:13 EDT (Sun, 27 Jun 2010)
@@ -26,7 +26,7 @@
 
 class memory_oarchive
     : public detail::memory_oarchive_base
- , public char_oarchive<vector_back_insert_iterator<detail::memory_oarchive_base::buffer_type> >{
+ , public char_oarchive<vector_back_insert_iterator<detail::auto_buffer<char,256> > >{
     typedef vector_back_insert_iterator<buffer_type> iterator_type;
     typedef char_oarchive<iterator_type> archive_type;
 public:

Modified: sandbox/intro/boost/intro/move.hpp
==============================================================================
--- sandbox/intro/boost/intro/move.hpp (original)
+++ sandbox/intro/boost/intro/move.hpp 2010-06-27 14:53:13 EDT (Sun, 27 Jun 2010)
@@ -6,7 +6,7 @@
 #ifndef BOOST_INTRO_MOVE_HPP
 #define BOOST_INTRO_MOVE_HPP
 
-#include <boost/intro/apply_binary.hpp>
+#include <boost/intro/apply_members_binary.hpp>
 #include <boost/intro/reset_shared.hpp>
 #include <boost/intro/detail/map_insert_view.hpp>
 #include <boost/intro/detail/pooled_unordered_map.hpp>
@@ -40,18 +40,10 @@
     void register_object(T *,T *){}
 };
 
+class undo_mover;
+
 template<class Data>
 class mover{
- struct undo{
- undo() : mover_(data){}
- template<class T,class Semantics>
- void operator()(T &src,T &dest,Semantics) const{
- mover_(dest,src,Semantics());
- }
- private:
- null_move_data data;
- mover<null_move_data> mover_;
- };
 public:
     explicit mover(Data &data) : data(data){}
     template<class T,class Semantics>
@@ -64,9 +56,9 @@
     void operator()(reference<T> &src,reference<T> &dest,Semantics) const{
         this->insert_shared(src,dest,typename mpl::has_key<typename Semantics::set,shared>::type());
         new (&dest) reference<T>(src.get());
- src.~reference();
+ src.~reference<T>();
     }
- undo operator ~() const{ return undo(); }
+ undo_mover operator ~() const;
 private:
     template<class T>
     void insert_shared(T &src,T &dest,mpl::true_ shared) const{
@@ -76,7 +68,6 @@
     void insert_shared(T &src,T &dest,mpl::false_ shared) const{}
     template<class T,class Semantics>
     void operator()(T &src,T &dest,Semantics,mpl::true_ iscl) const{
- using intro::move;
         move(data,src,dest,Semantics());
     }
     template<class T,class Semantics>
@@ -87,6 +78,35 @@
     Data &data;
 };
 
+class undo_mover{
+public:
+ undo_mover() : mover_(data){}
+ template<class T,class Semantics>
+ void operator()(T &src,T &dest,Semantics) const{
+ mover_(dest,src,Semantics());
+ }
+private:
+ null_move_data data;
+ mover<null_move_data> mover_;
+};
+
+template<class Data>
+undo_mover mover<Data>::operator~() const{ return undo_mover(); }
+
+}
+
+template<class Data,class T,class Semantics>
+void move(Data &data,T &src,T &dest,Semantics){
+ apply_members_binary(detail::mover<Data>(data),src,dest);
+}
+
+template<class Data,class T>
+void move(Data &data,T &src,T &dest){
+ move(data,src,dest,typename default_semantics<T>::type());
+}
+
+namespace detail{
+
 template<class T,class Semantics>
 void move(T &src,T &dest,Semantics,mpl::true_ shared){
     typedef detail::optional_map<detail::pooled_unordered_map<void *,void *,4> > omap_type;
@@ -95,7 +115,7 @@
     using intro::move;
     move(data,src,dest);
     try{
- typedef detail::map_insert_view<oset_type> map_type;
+ typedef detail::map_insert_view<omap_type> map_type;
         map_type map(omap,std::make_pair(&src,&dest));
         reset_shared_data<map_type> resdata(map);
         reset_shared(resdata,dest);
@@ -125,15 +145,6 @@
 
 }
 
-template<class Data,class T,class Semantics>
-void move(Data &data,T &src,T &dest,Semantics){
- apply_binary(detail::mover<Data>(data),src,dest);
-}
-
-template<class Data,class T>
-void move(Data &data,T &src,T &dest){
- move(data,src,dest,typename default_semantics<T>::type());
-}
 
 template<class T,class Semantics>
 void move(T &src,T &dest,Semantics){

Modified: sandbox/intro/boost/intro/print.hpp
==============================================================================
--- sandbox/intro/boost/intro/print.hpp (original)
+++ sandbox/intro/boost/intro/print.hpp 2010-06-27 14:53:13 EDT (Sun, 27 Jun 2010)
@@ -39,6 +39,10 @@
     out << t;
 }
 
+template<class,class>
+class printer;
+
+
 template<class T,class Transformation>
 void print(T const &t,std::ostream &out,Transformation const &transform,mpl::false_ ptrorint){
     out << '{' << std::endl;
@@ -48,12 +52,21 @@
     out << '}';
 }
 
+}
+
+template<class T,class Transformation>
+void print(T const &t,std::ostream &out,Transformation const &transform){
+ detail::print(t,out,transform,mpl::bool_<is_pointer<T>::type::value || is_arithmetic<T>::type::value>());
+}
 
 template<class T,class Transformation>
 void print(reference<T> const &t,std::ostream &out,Transformation const &transform){
     print(&t.get(),out,transform);
 }
 
+namespace detail{
+
+
 template<class T>
 char const *typeid_name(){
     char const *name=typeid(T).name();
@@ -99,14 +112,8 @@
     Transformation transform;
 };
 
-
-
 }
 
-template<class T,class Transformation>
-void print(T const &t,std::ostream &out,Transformation const &transform){
- detail::print(t,out,transform,mpl::bool_<is_pointer<T>::type::value || is_arithmetic<T>::type::value>());
-}
 
 class print_transformation{
 public:

Modified: sandbox/intro/boost/intro/reset_shared.hpp
==============================================================================
--- sandbox/intro/boost/intro/reset_shared.hpp (original)
+++ sandbox/intro/boost/intro/reset_shared.hpp 2010-06-27 14:53:13 EDT (Sun, 27 Jun 2010)
@@ -20,9 +20,6 @@
     template<class T>
     T *translate(T *t) const{
         typename Map::const_iterator it=map.find(t);
- std::cerr << "translation for " << t << ": ";
- if(it == map.end()) std::cerr << "not found\n";
- else std::cerr << it->second << std::endl;
         if(it == map.end()) return t;
         else return static_cast<T *>(it->second);
     }
@@ -48,13 +45,13 @@
     template<class T,class Semantics>
     void operator()(reference<T> &t,Semantics) const{
         T &tmp=this->get(t.get(),Semantics());
- t.~reference();
+ t.~reference<T>();
         new (&t) reference<T>(tmp);
     }
     template<class T,class Semantics>
     void operator()(reference<T> const &t,Semantics) const{
         T &tmp=this->get(t.get(),Semantics());
- t.~reference();
+ t.~reference<T>();
         new (&t) reference<T>(tmp);
     }
     //TODO operator~
@@ -80,7 +77,7 @@
     T &get(T &t,mpl::true_ poly,mpl::true_ shared) const{
         //TODO optimization: the same object is dispatched shortly
         //thereafter by apply_recursive
- return dispatch_polymorphic(bind(getter<T>(),cref(*this),_1),t);
+ return dispatch_polymorphic(boost::bind(getter<T>(),cref(*this),_1),t);
     }
     template<class T,bool Poly>
     T &get(T &t,mpl::bool_<Poly>,mpl::false_ shared) const{

Modified: sandbox/intro/boost/intro/serialize.hpp
==============================================================================
--- sandbox/intro/boost/intro/serialize.hpp (original)
+++ sandbox/intro/boost/intro/serialize.hpp 2010-06-27 14:53:13 EDT (Sun, 27 Jun 2010)
@@ -1,7 +1,7 @@
 #ifndef BOOST_INTRO_SERIALIZE_HPP
 #define BOOST_INTRO_SERIALIZE_HPP
 
-#include <boost/intro/apply.hpp>
+#include <boost/intro/apply_members.hpp>
 #include <boost/intro/dispatch_polymorphic.hpp>
 #include <boost/intro/detail/pooled_unordered_map.hpp>
 #include <boost/intro/detail/optional_map.hpp>
@@ -34,19 +34,17 @@
 };
 
 
-template<class Archive,class Data,class T,class Semantics>
-void serialize_member(Archive &ar,Data &data,T const &t,Semantics){
- detail::serialize_member(ar,data,t,Semantics(),
- typename mpl::has_key<typename Semantics::set,polymorphic>::type(),
- typename mpl::has_key<typename Semantics::set,shared>::type());
-}
 
 namespace detail{
 
+template<class,class>
+struct member_serializer;
+
+
 template<class Archive,class Data,class T,class Semantics,bool Shared>
 void serialize_member(Archive &ar,Data &data,T const &t,Semantics,mpl::true_ poly,mpl::bool_<Shared>){
     dispatch_polymorphic(
- bind(
+ boost::bind(
             detail::member_serializer<Archive,Data>(ar,data),
             _1,
             Semantics(),
@@ -55,6 +53,11 @@
         ),t);
 }
 template<class Archive,class Data,class T,class Semantics>
+void serialize_member(Archive &ar,Data &data,T const &t,Semantics,mpl::false_ poly,mpl::false_ shared_){
+ serialize(ar,data,t,Semantics());
+}
+
+template<class Archive,class Data,class T,class Semantics>
 void serialize_member(Archive &ar,Data &data,T const &t,Semantics,mpl::false_ poly,mpl::true_ shared_){
     std::pair<unsigned int,bool> ret=data.register_object(t);
     ar << ret.first;
@@ -62,11 +65,18 @@
         detail::serialize_member(ar,data,t,Semantics(),poly,mpl::false_());
     }
 }
+
+}
+
 template<class Archive,class Data,class T,class Semantics>
-void serialize_member(Archive &ar,Data &data,T const &t,Semantics,mpl::false_ poly,mpl::false_ shared_){
- serialize(ar,data,t,Semantics());
+void serialize_member(Archive &ar,Data &data,T const &t,Semantics){
+ detail::serialize_member(ar,data,t,Semantics(),
+ typename mpl::has_key<typename Semantics::set,polymorphic>::type(),
+ typename mpl::has_key<typename Semantics::set,shared>::type());
 }
 
+namespace detail{
+
 
 template<class Archive,class Data>
 struct member_serializer{
@@ -80,7 +90,7 @@
     template<class T,class Semantics,bool Shared>
     void operator()(T const &t,Semantics,mpl::false_ poly,mpl::bool_<Shared> sha) const{
         //called by polymorphic dispatch
- std::pair<unsigned int,bool> ret=data.register_type<T>();
+ std::pair<unsigned int,bool> ret=data.template register_type<T>();
         ar << ret.first;
         if(ret.second){
             char const *name=typeid(T).name();
@@ -97,8 +107,8 @@
 
 template<class Archive,class Data,class T>
 void serialize_class(Archive &ar,Data &data,T const &t,mpl::true_ is_class_){
- using intro::apply;
- apply(detail::member_serializer<Archive,Data>(ar,data),t);
+ using intro::apply_members;
+ apply_members(detail::member_serializer<Archive,Data>(ar,data),t);
 }
 
 template<class Archive,class Data,class T>
@@ -122,6 +132,16 @@
     intro::serialize_member(ar,data,t.get(),typename Semantics::indir_semantics());
 }
 
+}
+
+
+template<class Archive,class Data,class T,class Semantics>
+void serialize(Archive &ar,Data &data,T const &t,Semantics){
+ detail::serialize_class(ar,data,t,typename is_class<T>::type());
+}
+
+namespace detail{
+
 struct type_info_less{
     bool operator()(std::type_info const *t1,std::type_info const *t2) const{
 #ifdef BOOST_MSVC
@@ -135,6 +155,7 @@
     }
 };
 
+
 template<class Archive,class T,class Semantics>
 void serialize(Archive &ar,T const &t,Semantics,mpl::false_ shared){
     typedef detail::optional_map<detail::pooled_unordered_map<void const *,unsigned int,4> > omap_type;
@@ -158,11 +179,7 @@
     serialize(ar,data,t,Semantics());
 }
 
-}
 
-template<class Archive,class Data,class T,class Semantics>
-void serialize(Archive &ar,Data &data,T const &t,Semantics){
- detail::serialize_class(ar,data,t,typename is_class<T>::type());
 }
 
 


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