Update of /cvsroot/boost/boost/boost/interprocess/containers
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29744/containers

Modified Files:
        deque.hpp flat_map.hpp flat_set.hpp list.hpp 
Log Message:
no message

Index: deque.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/interprocess/containers/deque.hpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- deque.hpp   12 Jun 2007 17:07:08 -0000      1.9
+++ deque.hpp   23 Jun 2007 12:52:18 -0000      1.10
@@ -57,8 +57,7 @@
 #include <boost/interprocess/detail/min_max.hpp>
 #include <boost/interprocess/detail/mpl.hpp>
 #include <boost/interprocess/interprocess_fwd.hpp>
-#include <boost/iterator.hpp>
-#include <boost/iterator/reverse_iterator.hpp>
+#include <iterator>
 #include <cstddef>
 #include <iterator>
 #include <memory>
@@ -70,7 +69,6 @@
 #include <boost/type_traits/has_trivial_destructor.hpp>
 
 namespace boost {
-
 namespace interprocess {
 
 /// @cond
@@ -154,7 +152,7 @@
    //  A pointer in the range [map, map + map_size) points to an allocated node
    //    if and only if the pointer is in the range [start.node, finish.node].
    class const_iterator 
-      : public boost::iterator<std::random_access_iterator_tag, 
+      : public std::iterator<std::random_access_iterator_tag, 
                               val_alloc_val,  val_alloc_diff, 
                               val_alloc_cptr, val_alloc_cref>
    {
@@ -500,8 +498,8 @@
    typedef typename Base::iterator       iterator;
    typedef typename Base::const_iterator const_iterator;
 
-   typedef boost::reverse_iterator<const_iterator> const_reverse_iterator;
-   typedef boost::reverse_iterator<iterator> reverse_iterator;
+   typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+   typedef std::reverse_iterator<iterator> reverse_iterator;
 
    /// @cond
    protected:                      // Internal typedefs
@@ -617,8 +615,8 @@
          const allocator_type& a = allocator_type()) : Base(a) 
    {
       //Dispatch depending on integer/iterator
-      const bool aux_boolean = boost::is_integral<InpIt>::value;
-      typedef bool_<aux_boolean> Result;
+      const bool aux_boolean = detail::is_convertible<InpIt, 
std::size_t>::value;
+      typedef detail::bool_<aux_boolean> Result;
       this->priv_initialize_dispatch(first, last, Result());
    }
 
@@ -671,8 +669,8 @@
    template <class InpIt>
    void assign(InpIt first, InpIt last) {
       //Dispatch depending on integer/iterator
-      const bool aux_boolean = boost::is_integral<InpIt>::value;
-      typedef bool_<aux_boolean> Result;
+      const bool aux_boolean = detail::is_convertible<InpIt, 
std::size_t>::value;
+      typedef detail::bool_<aux_boolean> Result;
       this->priv_assign_dispatch(first, last, Result());
    }
 
@@ -821,8 +819,8 @@
    void insert(iterator pos, InpIt first, InpIt last) 
    {
       //Dispatch depending on integer/iterator
-      const bool aux_boolean = boost::is_integral<InpIt>::value;
-      typedef bool_<aux_boolean> Result;
+      const bool aux_boolean = detail::is_convertible<InpIt, 
std::size_t>::value;
+      typedef detail::bool_<aux_boolean> Result;
       this->priv_insert_dispatch(pos, first, last, Result());
    }
 
@@ -845,11 +843,12 @@
          this->priv_reserve_elements_at_back(new_size);
 
          while(n--){
+            //T default_constructed = move(T());
             T default_constructed;
-            if(boost::is_scalar<T>::value){
+/*            if(boost::is_scalar<T>::value){
                //Value initialization
                new(&default_constructed)T();
-            }
+            }*/
             this->push_back(move(default_constructed));
          }
       }
@@ -986,14 +985,14 @@
    }
 
    template <class Integer>
-   void priv_initialize_dispatch(Integer n, Integer x, true_) 
+   void priv_initialize_dispatch(Integer n, Integer x, detail::true_) 
    {
       this->priv_initialize_map(n);
       this->priv_fill_initialize(x);
    }
 
    template <class InpIt>
-   void priv_initialize_dispatch(InpIt first, InpIt last, false_) 
+   void priv_initialize_dispatch(InpIt first, InpIt last, detail::false_) 
    {
       typedef typename std::iterator_traits<InpIt>::iterator_category ItCat;
       this->priv_range_initialize(first, last, ItCat());
@@ -1012,11 +1011,11 @@
    }
 
    template <class Integer>
-   void priv_assign_dispatch(Integer n, Integer val, true_)
+   void priv_assign_dispatch(Integer n, Integer val, detail::true_)
       { this->priv_fill_assign((size_type) n, (T) val); }
 
    template <class InpIt>
-   void priv_assign_dispatch(InpIt first, InpIt last, false_) 
+   void priv_assign_dispatch(InpIt first, InpIt last, detail::false_) 
    {
       typedef typename std::iterator_traits<InpIt>::iterator_category ItCat;
       this->priv_assign_aux(first, last, ItCat());
@@ -1051,7 +1050,7 @@
 
    template <class Integer>
    void priv_insert_dispatch(iterator pos, Integer n, Integer x,
-                           true_) 
+                           detail::true_) 
    {
       this->priv_fill_insert(pos, (size_type) n, (value_type) x);
    }
@@ -1059,7 +1058,7 @@
    template <class InpIt>
    void priv_insert_dispatch(iterator pos,
                            InpIt first, InpIt last,
-                           false_) 
+                           detail::false_) 
    {
       typedef typename std::iterator_traits<InpIt>::iterator_category ItCat;
       this->insert(pos, first, last, ItCat());

Index: flat_map.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/interprocess/containers/flat_map.hpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- flat_map.hpp        12 Jun 2007 17:07:08 -0000      1.5
+++ flat_map.hpp        23 Jun 2007 12:52:18 -0000      1.6
@@ -24,6 +24,7 @@
 #include <memory>
 #include <boost/interprocess/containers/detail/flat_tree.hpp>
 #include <boost/interprocess/detail/utilities.hpp>
+#include <boost/type_traits/has_trivial_destructor.hpp>
 #include <boost/interprocess/detail/mpl.hpp>
 #include <boost/interprocess/detail/move.hpp>
 
@@ -67,12 +68,12 @@
 template <class Key, class T, class Pred, class Alloc>
 class flat_map 
 {
-   /// @endcond
+   /// @cond
    private:
    //This is the real tree stored here. It's based on a movable pair
    typedef detail::flat_tree<Key, 
                            detail::pair<Key, T>, 
-                           select1st< detail::pair<Key, T> >, 
+                           detail::select1st< detail::pair<Key, T> >, 
                            Pred, 
                            typename Alloc::template
                               rebind<detail::pair<Key, T> >::other> 
impl_tree_t;
@@ -80,7 +81,7 @@
    //This is the tree that we should store if pair was movable
    typedef detail::flat_tree<Key, 
                            std::pair<Key, T>, 
-                           select1st< std::pair<Key, T> >, 
+                           detail::select1st< std::pair<Key, T> >, 
                            Pred, 
                            Alloc> tree_t;
 
@@ -700,14 +701,14 @@
    //This is the real tree stored here. It's based on a movable pair
    typedef detail::flat_tree<Key, 
                            detail::pair<Key, T>, 
-                           select1st< detail::pair<Key, T> >, 
+                           detail::select1st< detail::pair<Key, T> >, 
                            Pred, 
                            typename Alloc::template
                               rebind<detail::pair<Key, T> >::other> 
impl_tree_t;
 
    typedef detail::flat_tree<Key, 
                            std::pair<Key, T>, 
-                           select1st< std::pair<Key, T> >, 
+                           detail::select1st< std::pair<Key, T> >, 
                            Pred, 
                            Alloc> tree_t;
 //   tree_t m_flat_tree;  // flat tree representing flat_multimap

Index: flat_set.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/interprocess/containers/flat_set.hpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- flat_set.hpp        12 Jun 2007 17:07:08 -0000      1.5
+++ flat_set.hpp        23 Jun 2007 12:52:18 -0000      1.6
@@ -60,8 +60,7 @@
 {
    /// @cond
    private:
-   typedef detail::flat_tree<T, T, 
-                     identity<T>, Pred, Alloc> tree_t;
+   typedef detail::flat_tree<T, T, detail::identity<T>, Pred, Alloc> tree_t;
    tree_t m_flat_tree;  // flat tree representing flat_set
    /// @endcond
 
@@ -577,8 +576,7 @@
 {
    /// @cond
    private:
-   typedef detail::flat_tree<T, T, 
-                     identity<T>, Pred, Alloc> tree_t;
+   typedef detail::flat_tree<T, T, detail::identity<T>, Pred, Alloc> tree_t;
    tree_t m_flat_tree;  // flat tree representing flat_multiset
    /// @endcond
 

Index: list.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/interprocess/containers/list.hpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- list.hpp    12 Jun 2007 17:07:08 -0000      1.7
+++ list.hpp    23 Jun 2007 12:52:18 -0000      1.8
@@ -52,9 +52,6 @@
 
 #include <boost/interprocess/interprocess_fwd.hpp>
 #include <boost/interprocess/detail/move.hpp>
-#include <boost/iterator.hpp>
-#include <boost/iterator/reverse_iterator.hpp>
-#include <boost/type_traits/is_integral.hpp>
 #include <boost/interprocess/detail/utilities.hpp>
 #include <boost/type_traits/has_trivial_destructor.hpp>
 #include <boost/interprocess/detail/mpl.hpp>
@@ -65,6 +62,7 @@
 #include <memory>
 #include <functional>
 #include <algorithm>
+#include <stdexcept>
 
 namespace boost {
 namespace interprocess {
@@ -84,6 +82,10 @@
          , boost::intrusive::safe_link
          , VoidPointer>   IlistData;
 
+   list_node()
+      : m_data()
+   {}
+
    #ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE
    template<class Convertible>
    list_node(const Convertible &conv)
@@ -161,6 +163,9 @@
    {  new(detail::get_pointer(ptr)) Node(forward<Convertible>(value));  }
    #endif
 
+   static void construct(const NodePtr &ptr)
+   {  new(detail::get_pointer(ptr)) Node();  }
+
    static void destroy(const NodePtr &ptr)
    {  detail::get_pointer(ptr)->~Node();  }
 
@@ -186,6 +191,15 @@
    }
    #endif
 
+   NodePtr create_node()
+   {
+      NodePtr p = NodeAlloc::allocate(1);
+      Deallocator node_deallocator(p, *this);
+      self_t::construct(p);
+      node_deallocator.release();
+      return (p);
+   }
+
    void destroy_node(NodePtr node)
    {
       self_t::destroy(node);
@@ -316,7 +330,7 @@
    public:
    //! Const iterator used to iterate through a list. 
    class const_iterator
-      : public boost::iterator<std::bidirectional_iterator_tag, 
+      : public std::iterator<std::bidirectional_iterator_tag, 
                                  value_type,         list_difference_type, 
                                  list_const_pointer, list_const_reference>
    {
@@ -410,9 +424,9 @@
    };
 
    //! Iterator used to iterate backwards through a list. 
-   typedef boost::reverse_iterator<iterator>        reverse_iterator;
+   typedef std::reverse_iterator<iterator>        reverse_iterator;
    //! Const iterator used to iterate backwards through a list. 
-   typedef boost::reverse_iterator<const_iterator>  const_reverse_iterator;
+   typedef std::reverse_iterator<const_iterator>  const_reverse_iterator;
 
    //! <b>Effects</b>: Constructs a list taking the allocator as parameter.
    //! 
@@ -499,7 +513,7 @@
    //!
    //! <b>Complexity</b>: Linear to the number of elements in the list.
    void clear()
-   {  this->m_ilist.clear_and_destroy(Destroyer(*this));  }
+   {  this->m_ilist.clear_and_dispose(Destroyer(*this));  }
 
    //! <b>Effects</b>: Returns an iterator to the first element contained in 
the list.
    //! 
@@ -740,13 +754,8 @@
       }
       else{
          size_type n = new_size - len;
-         while(n--){
-            T default_constructed;
-            if(boost::is_scalar<T>::value){
-               //Value initialization hack. Fix me!
-               new(&default_constructed)T();
-            }
-            this->push_back(move(default_constructed));
+         for (size_type i = 0; i < n; ++i){
+            this->m_ilist.push_back(*this->create_node());
          }
       }
    }
@@ -832,8 +841,8 @@
    template <class InpIt>
    void insert(iterator p, InpIt first, InpIt last) 
    {
-      const bool aux_boolean = boost::is_integral<InpIt>::value;
-      typedef bool_<aux_boolean> Result;
+      const bool aux_boolean = detail::is_convertible<InpIt, 
std::size_t>::value;
+      typedef detail::bool_<aux_boolean> Result;
       this->priv_insert_dispatch(p, first, last, Result());
    }
 
@@ -879,7 +888,7 @@
    //!
    //! <b>Complexity</b>: Amortized constant time.
    iterator erase(iterator p) 
-   {  return iterator(this->m_ilist.erase_and_destroy(p.get(), 
Destroyer(*this))); }
+   {  return iterator(this->m_ilist.erase_and_dispose(p.get(), 
Destroyer(*this))); }
 
    //! <b>Requires</b>: first and last must be valid iterator to elements in 
*this.
    //!
@@ -889,7 +898,7 @@
    //!
    //! <b>Complexity</b>: Linear to the distance between first and last.
    iterator erase(iterator first, iterator last)
-   {  return iterator(this->m_ilist.erase_and_destroy(first.get(), last.get(), 
Destroyer(*this))); }
+   {  return iterator(this->m_ilist.erase_and_dispose(first.get(), last.get(), 
Destroyer(*this))); }
 
    //! <b>Effects</b>: Assigns the n copies of val to *this.
    //!
@@ -908,8 +917,8 @@
    template <class InpIt>
    void assign(InpIt first, InpIt last) 
    {
-      const bool aux_boolean = boost::is_integral<InpIt>::value;
-      typedef bool_<aux_boolean> Result;
+      const bool aux_boolean = detail::is_convertible<InpIt, 
std::size_t>::value;
+      typedef detail::bool_<aux_boolean> Result;
       this->priv_assign_dispatch(first, last, Result());
    }
 
@@ -1053,7 +1062,7 @@
    void remove_if(Pred pred)
    {
       typedef ValueCompareToNodeCompare<Pred> Predicate;
-      this->m_ilist.remove_and_destroy_if(Predicate(pred), Destroyer(*this));
+      this->m_ilist.remove_and_dispose_if(Predicate(pred), Destroyer(*this));
    }
 
    //! <b>Effects</b>: Removes adjacent duplicate elements or adjacent 
@@ -1081,7 +1090,7 @@
    void unique(BinaryPredicate binary_pred)
    {
       typedef ValueCompareToNodeCompare<BinaryPredicate> Predicate;
-      this->m_ilist.unique_and_destroy(Predicate(binary_pred), 
Destroyer(*this));
+      this->m_ilist.unique_and_dispose(Predicate(binary_pred), 
Destroyer(*this));
    }
 
    //! <b>Requires</b>: The lists x and *this must be distinct. 
@@ -1197,7 +1206,7 @@
    template <class InputIter>
    void priv_insert_dispatch(iterator p,
                              InputIter first, InputIter last,
-                             false_)
+                             detail::false_)
    {
       for ( ; first != last; ++first){
          this->insert(p, *first);
@@ -1205,7 +1214,7 @@
    }
 
    template<class Integer>
-   void priv_insert_dispatch(iterator p, Integer n, Integer x, true_) 
+   void priv_insert_dispatch(iterator p, Integer n, Integer x, detail::true_) 
    {  this->priv_fill_insert(p, n, x);  }
 
    void priv_fill_assign(size_type n, const T& val) 
@@ -1221,12 +1230,12 @@
    }
 
    template <class Integer>
-   void priv_assign_dispatch(Integer n, Integer val, true_)
+   void priv_assign_dispatch(Integer n, Integer val, detail::true_)
    {  this->priv_fill_assign((size_type) n, (T) val); }
 
    template <class InputIter>
    void priv_assign_dispatch(InputIter first2, InputIter last2,
-                                       false_)
+                                       detail::false_)
    {
       iterator first1   = this->begin();
       iterator last1    = this->end();


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs

Reply via email to