|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r54151 - in sandbox/monotonic/boost/monotonic: . detail extra
From: christian.schladetsch_at_[hidden]
Date: 2009-06-21 17:58:21
Author: cschladetsch
Date: 2009-06-21 17:58:20 EDT (Sun, 21 Jun 2009)
New Revision: 54151
URL: http://svn.boost.org/trac/boost/changeset/54151
Log:
added extra/ and detail/ directories
Added:
sandbox/monotonic/boost/monotonic/detail/
sandbox/monotonic/boost/monotonic/detail/link.hpp
- copied unchanged from r54134, /sandbox/monotonic/boost/monotonic/link.hpp
sandbox/monotonic/boost/monotonic/extra/
sandbox/monotonic/boost/monotonic/extra/chain.hpp
- copied unchanged from r54134, /sandbox/monotonic/boost/monotonic/chain.hpp
sandbox/monotonic/boost/monotonic/extra/inline_clone_allocator.hpp
- copied unchanged from r54134, /sandbox/monotonic/boost/monotonic/inline_clone_allocator.hpp
sandbox/monotonic/boost/monotonic/extra/list.hpp
- copied unchanged from r54134, /sandbox/monotonic/boost/monotonic/list.hpp
sandbox/monotonic/boost/monotonic/extra/map.hpp
- copied unchanged from r54134, /sandbox/monotonic/boost/monotonic/map.hpp
sandbox/monotonic/boost/monotonic/extra/ptr_list.hpp
- copied unchanged from r54134, /sandbox/monotonic/boost/monotonic/ptr_list.hpp
sandbox/monotonic/boost/monotonic/extra/set.hpp
- copied unchanged from r54134, /sandbox/monotonic/boost/monotonic/set.hpp
sandbox/monotonic/boost/monotonic/extra/vector.hpp
- copied unchanged from r54134, /sandbox/monotonic/boost/monotonic/vector.hpp
Removed:
sandbox/monotonic/boost/monotonic/chain.hpp
sandbox/monotonic/boost/monotonic/inline_clone_allocator.hpp
sandbox/monotonic/boost/monotonic/link.hpp
sandbox/monotonic/boost/monotonic/list.hpp
sandbox/monotonic/boost/monotonic/map.hpp
sandbox/monotonic/boost/monotonic/ptr_list.hpp
sandbox/monotonic/boost/monotonic/set.hpp
sandbox/monotonic/boost/monotonic/static_storage.h
sandbox/monotonic/boost/monotonic/vector.hpp
Deleted: sandbox/monotonic/boost/monotonic/chain.hpp
==============================================================================
--- sandbox/monotonic/boost/monotonic/chain.hpp 2009-06-21 17:58:20 EDT (Sun, 21 Jun 2009)
+++ (empty file)
@@ -1,262 +0,0 @@
-// Copyright (C) 2009 Christian Schladetsch
-//
-// 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_MONOTONIC_CHAIN_H
-#define BOOST_MONOTONIC_CHAIN_H
-
-#include <boost/monotonic/allocator.hpp>
-#include <boost/utility/iter_range.hpp>
-#include <boost/iterator.hpp>
-#include <boost/iterator/iterator_categories.hpp>
-
-namespace boost
-{
- namespace monotonic
- {
- /// a list of vectors that are tied together to present a contiguous sequence
- ///
- /// this is to provide a sequence type that is 'between' a list and a vector. it
- /// has slower access speed than a vector, but faster access speed than a list.
- ///
- /// unlike a vector, a chain cannot be resized
- ///
- /// this has limited utility outside of the context of a monotonic allocator.
- /// the reason to use it there is to avoid resizing a vector using a monotonic
- /// allocator, which is very wasteful. so, the trade-off is slightly slower
- /// access but ability to extend without resizing. then again, given that the
- /// main reason to use a monotonic allocator is speed, there may be limited
- /// application even there.
- ///
- template <class T, size_t ChunkSize = 64>
- struct chain
- {
- typedef chain<T, ChunkSize> Rope;
- typedef allocator<T> Allocator;
- typedef vector<T> Vector;
- typedef list<Vector> Strands;
- typedef const_iter_range<Strands> ConstStrandsIterators;
- typedef iter_range<Strands> StrandsIterators;
- typedef const_iter_range<Vector> ConstVectorIterators;
- typedef iter_range<Vector> VectorIterators;
-
- typedef T value_type;
- typedef T &reference;
- typedef const T &const_reference;
-
- template <class R, class S, class V, class Derived>
- struct iterator_base : boost::iterator<random_access_traversal_tag, T>
- {
- typedef R Rope;
- typedef S StrandIterators;
- typedef V VectorIterators;
- Rope *parent;
- StrandIterators strand;
- VectorIterators vec;
-
- iterator_base() { }
- iterator_base(Rope &P)
- : parent(&P) { }
- iterator_base(Rope &P, StrandIterators const &S)
- : parent(&P), strand(S) { }
- iterator_base(Rope &P, StrandIterators const &S, VectorIterators const &V)
- : parent(&P), strand(S), vec(V) { }
- Derived &This()
- {
- return static_cast<Derived &>(*this);
- }
- Derived &operator++()
- {
- if (!++vec)
- {
- if (!++strand)
- {
- return This();
- }
- vec = *strand;
- }
- return This();
- }
- Derived operator++(int)
- {
- Derived tmp = This();
- ++*this;
- return tmp;
- }
- bool operator==(iterator_base const &B) const
- {
- return parent == B.parent && strand == B.strand && vec == B.vec;
- }
- bool operator!=(iterator_base const &B) const
- {
- return !(*this == B);
- }
- };
- struct iterator : iterator_base<Rope, StrandsIterators, VectorIterators, iterator>
- {
- typedef iterator_base<Rope, StrandsIterators, VectorIterators, iterator> Parent;
- iterator() { }
- iterator(Rope &P)
- : Parent(P) { }
- iterator(Rope &P, StrandsIterators const &S)
- : Parent(P, S) { }
- iterator(Rope &P, StrandsIterators const &S, VectorIterators const &V)
- : Parent(P, S, V) { }
- T const &operator*() const
- {
- return *Parent::vec;
- }
- T &operator*()
- {
- return *Parent::vec;
- }
- };
- typedef iterator Iter;
- struct const_iterator : iterator_base<Rope const, ConstStrandsIterators, ConstVectorIterators, const_iterator>
- {
- typedef iterator_base<Rope const, ConstStrandsIterators, ConstVectorIterators, const_iterator> Parent;
- const_iterator() { }
- const_iterator(Rope const &P)
- : Parent(P) { }
- const_iterator(Iter const &X)
- : Parent(*X.parent, X.strand, X.vec)
- { }
- const_iterator(Rope const &P, ConstStrandsIterators const &S)
- : Parent(P, S) { }
- const_iterator(Rope const &P, ConstStrandsIterators const &S, ConstVectorIterators const &V)
- : Parent(P, S, V) { }
- T const &operator*() const
- {
- return *Parent::vec;
- }
- };
-
- private:
- Allocator alloc;
- Strands strands;
-
- public:
- chain() { }
- chain(Allocator const &A)
- : alloc(A), strands(A) { }
- chain(size_t len, Allocator const &A)
- : alloc(A), strands(A)
- {
- // TODO
- }
- chain(size_t len, T const &X, Allocator const &A)
- : alloc(A), strands(A)
- {
- strands.push_back(Vector(alloc));
- strands.back().resize(len, X);
- }
- template <class II>
- chain(II F, II L, Allocator const &A)
- : alloc(A), strands(A)
- {
- strands.push_back(Vector(alloc));
- Vector &vec = strands.back();
- size_t len = std::distance(F,L);
- vec.resize(len);
- typename Vector::iterator G = vec.begin();
- for (size_t N = 0; N < len; ++F, ++G)
- *G = *F;
- }
-
- size_t size() const
- {
- size_t len = 0;
- BOOST_FOREACH(Vector const &vec, strands)
- {
- len += vec.size();
- }
- return len;
- }
- bool empty() const
- {
- return strands.empty() || size() == 0;
- }
- const_iterator begin() const
- {
- if (strands.empty())
- return const_iterator(*this);
- return const_iterator(*this, strands, strands.front());
- }
- const_iterator end() const
- {
- if (strands.empty())
- return const_iterator(*this);
- return const_iterator(*this, strands.end(), strands.back().end());
- }
- iterator begin()
- {
- if (strands.empty())
- return iterator(*this);
- return iterator(*this, strands, strands.front());
- }
- iterator end()
- {
- if (strands.empty())
- return iterator(*this);
- return iterator(*this, strands.end(), strands.back().end());
- }
- void push_back(T const &X)
- {
- bool require_new_vec = strands.empty();
- require_new_vec = require_new_vec || strands.back().size() == strands.back().capacity();
- if (require_new_vec)
- {
- strands.push_back(Vector(alloc));
- strands.back().reserve(ChunkSize);
- }
- strands.back().push_back(X);
- }
-
- T &at(size_t index)
- {
- size_t offset = 0;
- BOOST_FOREACH(Vector &vec, strands)
- {
- size_t local = index - offset;
- if (local < vec.size())
- {
- return vec.at(local);
- }
- offset += vec.size();
- if (offset > index)
- break;
- }
- throw std::out_of_range("chain");
- }
- T const &at(size_t index) const
- {
- size_t offset = 0;
- BOOST_FOREACH(Vector const &vec, strands)
- {
- size_t local = index - offset;
- if (local < vec.size())
- {
- return vec.at(local);
- }
- offset += vec.size();
- if (offset < index)
- break;
- }
- throw std::out_of_range("chain");
- }
- T &operator[](size_t index)
- {
- return at(index);
- }
- T const &operator[](size_t index) const
- {
- return at(index);
- }
- };
- }
-}
-
-#endif // BOOST_MONOTONIC_CHAIN_H
-
-//EOF
Deleted: sandbox/monotonic/boost/monotonic/inline_clone_allocator.hpp
==============================================================================
--- sandbox/monotonic/boost/monotonic/inline_clone_allocator.hpp 2009-06-21 17:58:20 EDT (Sun, 21 Jun 2009)
+++ (empty file)
@@ -1,41 +0,0 @@
-// Copyright (C) 2009 Christian Schladetsch
-//
-// 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_MONOTONIC_INLINE_CLONE_ALLOCATOR_H
-#define BOOST_MONOTONIC_INLINE_CLONE_ALLOCATOR_H
-
-#include <boost/monotonic/allocator.hpp>
-
-namespace boost
-{
- namespace monotonic
- {
- /// custom clone allocator for ptr-containers using a monotonic allocator.
- /// see http://www.boost.org/doc/libs/1_38_0/libs/ptr_container/doc/reference.html for details.
- struct inline_clone_allocator
- {
- template< class U >
- static U* allocate_clone( const U& r )
- {
- // can't allocate clone without access to the monotonic allocator.
- // this is a design fault in boost::ptr_container.
- return 0;
- }
-
- template< class U >
- static void deallocate_clone( const U* clone )
- {
- if (clone)
- clone->U::~U();
- }
- };
-
- } // namespace monotonic
-
-} // namespace boost
-
-#endif // BOOST_MONOTONIC_INLINE_CLONE_ALLOCATOR_H
-
-//EOF
Deleted: sandbox/monotonic/boost/monotonic/link.hpp
==============================================================================
--- sandbox/monotonic/boost/monotonic/link.hpp 2009-06-21 17:58:20 EDT (Sun, 21 Jun 2009)
+++ (empty file)
@@ -1,86 +0,0 @@
-// Copyright (C) 2009 Christian Schladetsch
-//
-// 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_MONOTONIC_ALLOCATOR_DETAIL_LINK_HPP
-#define BOOST_MONOTONIC_ALLOCATOR_DETAIL_LINK_HPP
-
-//#include <boost/monotonic/allocator_base.hpp>
-
-namespace boost
-{
- namespace monotonic
- {
- namespace detail
- {
- /// a link in the chain of heap-based memory buffers used by a storage<> structure
- template <class Al>
- struct Link : storage_base
- {
- typedef Al CharAllocator;
-
- private:
- size_t capacity, cursor;
- char *buffer;
- CharAllocator alloc;
-
- public:
- Link() : capacity(0), cursor(0), buffer(0)
- {
- }
- template <class Al2>
- Link(Al2 const &al, size_t cap)
- : capacity(cap), cursor(0), buffer(0), alloc(typename Al2::template rebind<char>::other(al))
- {
- buffer = alloc.allocate(capacity);
- if (buffer == 0)
- capacity = 0;
- }
- size_t max_size() const
- {
- return capacity;
- }
- size_t remaining() const
- {
- return capacity - cursor;
- }
- void reset()
- {
- cursor = 0;
- }
- void release()
- {
- alloc.deallocate(buffer, 1);
- }
- size_t used() const
- {
- return cursor;
- }
- inline void *allocate(size_t num_bytes, size_t alignment)
- {
- size_t extra = cursor & (alignment - 1);
- if (extra > 0)
- extra = alignment - extra;
- size_t required = num_bytes + extra;
- if (capacity - cursor < required)
- return 0;
- char *ptr = buffer + cursor;
- cursor += required;
- return ptr + extra;
- }
- friend bool operator<(Link const &A, Link const &B)
- {
- return A.remaining() < B.remaining();
- }
- };
-
- } // namespace detail
-
- } // namespace monotonic
-
-} // namespace boost
-
-#endif // BOOST_MONOTONIC_ALLOCATOR_DETAIL_LINK_HPP
-
-//EOF
Deleted: sandbox/monotonic/boost/monotonic/list.hpp
==============================================================================
--- sandbox/monotonic/boost/monotonic/list.hpp 2009-06-21 17:58:20 EDT (Sun, 21 Jun 2009)
+++ (empty file)
@@ -1,111 +0,0 @@
-// Copyright (C) 2009 Christian Schladetsch
-//
-// 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_MONOTONIC_LIST_H
-#define BOOST_MONOTONIC_LIST_H
-
-#include <list>
-#include <boost/monotonic/allocator.hpp>
-#include <boost/monotonic/container.hpp>
-
-namespace boost
-{
- namespace monotonic
- {
- /// A list that uses a monotonic allocator by default
- template <class T>
- struct list : detail::monotonic_container<list<T> >
- {
- typedef allocator<T> Allocator;
- typedef std::list<T, Allocator> List, Implementation;
- typedef detail::monotonic_container<std::list<T, Allocator> > Parent;
- typedef typename List::iterator iterator;
- typedef typename List::const_iterator const_iterator;
- typedef typename List::size_type size_type;
- typedef typename List::value_type value_type;
- typedef typename List::reference reference;
- typedef typename List::const_reference const_reference;
- typedef list<T> This;
-
- private:
- Implementation impl;
-
- public:
- list() { }
- list(Allocator const &A)
- : impl(A) { }
- template <class II>
- list(II F, II L, Allocator const &A)
- : impl(F,L,A) { }
-
- Allocator get_allocator()
- {
- return impl.get_allocator();
- }
- bool empty() const
- {
- return impl.empty();
- }
- size_type size() const
- {
- return impl.size();
- }
- void push_back(value_type const &value)
- {
- impl.push_back(value);
- }
- void pop_back()
- {
- impl.pop_back();
- }
- void push_front(value_type const &value)
- {
- impl.push_front(value);
- }
- void pop_front()
- {
- impl.pop_front();
- }
- iterator begin()
- {
- return impl.begin();
- }
- iterator end()
- {
- return impl.end();
- }
- const_iterator begin() const
- {
- return impl.begin();
- }
- const_iterator end() const
- {
- return impl.end();
- }
- value_type const &front() const
- {
- return impl.front();
- }
- value_type &front()
- {
- return impl.front();
- }
- value_type const &back() const
- {
- return impl.back();
- }
- value_type &back()
- {
- return impl.back();
- }
- };
-
- } // namespace monotonic
-
-} // namespace boost
-
-#endif // BOOST_MONOTONIC_LIST_H
-
-//EOF
Deleted: sandbox/monotonic/boost/monotonic/map.hpp
==============================================================================
--- sandbox/monotonic/boost/monotonic/map.hpp 2009-06-21 17:58:20 EDT (Sun, 21 Jun 2009)
+++ (empty file)
@@ -1,125 +0,0 @@
-// Copyright (C) 2009 Christian Schladetsch
-//
-// 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_MONOTONIC_MAP_H
-#define BOOST_MONOTONIC_MAP_H
-
-#include <boost/monotonic/allocator.hpp>
-#include <boost/monotonic/container.hpp>
-
-namespace boost
-{
- namespace monotonic
- {
- /// A map that uses a monotonic allocator, and respects that allocator
- /// when creating new referent instances
- template <class K, class T, class P = std::less<K> >
- struct map : detail::monotonic_container<map<K,T,P> >
- {
- typedef detail::monotonic_container<map<K,T,P> > Parent;
- typedef detail::Create<detail::is_monotonic<T>::value, T> Create;
-
- typedef P Predicate;
- typedef allocator<K> Allocator;
- typedef std::map<K,T,P,Allocator > Map, Implementation;
- typedef typename Map::iterator iterator;
- typedef typename Map::const_iterator const_iterator;
- typedef typename Map::mapped_type mapped_type;
- typedef typename Map::value_type value_type;
- typedef typename Map::key_type key_type;
- typedef typename Map::size_type size_type;
-
- private:
- Implementation impl;
- Predicate pred;
-
- public:
-
- map() { }
- map(Allocator const &A)
- : impl(Predicate(), A) { }
- map(Predicate Pr, Allocator const &A)
- : impl(Pr, A), pred(Pr) { }
- template <class II>
- map(II F, II L, Allocator const &A, Predicate const &Pr = Predicate())
- : impl(F,L,Pr,A), pred(Pr) { }
- template <class II>
- map(II F, II L, Predicate const &Pr, Allocator const &A)
- : impl(F,L,Pr,A), pred(Pr) { }
-
- Allocator get_allocator() const
- {
- return impl.get_allocator();
- }
- void clear()
- {
- impl.clear();
- }
- size_type size() const
- {
- return impl.size();
- }
- bool empty() const
- {
- return impl.empty();
- }
- iterator begin()
- {
- return impl.begin();
- }
- iterator end()
- {
- return impl.end();
- }
- const_iterator begin() const
- {
- return impl.begin();
- }
- const_iterator end() const
- {
- return impl.end();
- }
-
- void insert(const value_type& value)
- {
- impl.insert(value);
- }
- void erase(iterator first)
- {
- impl.erase(first);
- }
- void erase(iterator first, iterator last)
- {
- impl.erase(first, last);
- }
- size_type erase(key_type const &key)
- {
- return impl.erase(key);
- }
- mapped_type& operator[](const key_type& key)
- {
- iterator where = impl.lower_bound(key);
- if (where == impl.end() || pred(key, where->first))
- {
- where = impl.insert(where, value_type(key, Create::Given(this->Parent::get_storage())));
- }
- return where->second;
- }
- iterator find(key_type const &key)
- {
- return impl.find(key);
- }
- const_iterator find(key_type const &key) const
- {
- return impl.find(key);
- }
- };
-
- }
-}
-
-#endif // BOOST_MONOTONIC_MAP_H
-
-//EOF
Deleted: sandbox/monotonic/boost/monotonic/ptr_list.hpp
==============================================================================
--- sandbox/monotonic/boost/monotonic/ptr_list.hpp 2009-06-21 17:58:20 EDT (Sun, 21 Jun 2009)
+++ (empty file)
@@ -1,47 +0,0 @@
-// Copyright (C) 2009 Christian Schladetsch
-//
-// 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_MONOTONIC_PTR_LIST_H
-#define BOOST_MONOTONIC_PTR_LIST_H
-
-#include <boost/ptr_container/ptr_list.hpp>
-#include <boost/monotonic/allocator.hpp>
-#include <boost/monotonic/inline_clone_allocator.hpp>
-
-namespace boost
-{
- namespace monotonic
- {
- /// A boost::ptr_list<T> that uses a monotonic allocator, and a custom clone allocator
- template <class T>
- struct ptr_list : boost::ptr_list<T, inline_clone_allocator, allocator<T> >
- {
- typedef allocator<T> Allocator;
- typedef boost::ptr_list<T, inline_clone_allocator, Allocator> List;
-
- ptr_list()
- {
- }
- ptr_list(storage_base &storage) // Copyright (C) 2009 Christian Schladetsch
- //
- // 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)
-
-
- : List(Allocator(storage))
- {
- }
- ptr_list(Allocator const &A)
- : List(A)
- {
- }
- };
-
- }
-}
-
-#endif // BOOST_MONOTONIC_PTR_LIST_H
-
-//EOF
Deleted: sandbox/monotonic/boost/monotonic/set.hpp
==============================================================================
--- sandbox/monotonic/boost/monotonic/set.hpp 2009-06-21 17:58:20 EDT (Sun, 21 Jun 2009)
+++ (empty file)
@@ -1,41 +0,0 @@
-// Copyright (C) 2009 Christian Schladetsch
-//
-// 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_MONOTONIC_SET_H
-#define BOOST_MONOTONIC_SET_H
-
-#include <set>
-#include <boost/monotonic/allocator.hpp>
-
-namespace boost
-{
- namespace monotonic
- {
- /// A std::set<T,P> that uses a monotonic allocator
- template <class T, class P = std::less<T> >
- struct set : std::set<T,P, allocator<T> >
- {
- typedef allocator<T> Allocator;
- typedef P Predicate;
- typedef std::set<T,P,allocator<T> > Set;
-
- set() { }
- set(Allocator const &A)
- : Set(Predicate(), A) { }
- set(Predicate Pr, Allocator const &A)
- : Set(Pr, A) { }
- template <class II>
- set(II F, II L, Allocator const &A)
- : Set(F,L,Predicate(),A) { }
- template <class II>
- set(II F, II L, Predicate const &Pr, Allocator const &A)
- : Set(F,L,Pr,A) { }
- };
- }
-}
-
-#endif // BOOST_MONOTONIC_SET_H
-
-//EOF
Deleted: sandbox/monotonic/boost/monotonic/static_storage.h
==============================================================================
--- sandbox/monotonic/boost/monotonic/static_storage.h 2009-06-21 17:58:20 EDT (Sun, 21 Jun 2009)
+++ (empty file)
@@ -1,6 +0,0 @@
-#pragma error
-
-this file has been renamed to boost\monotonic\static_storage.hpp
-
-see https://svn.boost.org/svn/boost/sandbox/monotonic/boost/monotonic/static_storage.hpp
-
Deleted: sandbox/monotonic/boost/monotonic/vector.hpp
==============================================================================
--- sandbox/monotonic/boost/monotonic/vector.hpp 2009-06-21 17:58:20 EDT (Sun, 21 Jun 2009)
+++ (empty file)
@@ -1,133 +0,0 @@
-// Copyright (C) 2009 Christian Schladetsch
-//
-// 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_MONOTONIC_VECTOR_H
-#define BOOST_MONOTONIC_VECTOR_H
-
-#include <boost/monotonic/allocator.hpp>
-#include <boost/monotonic/container.hpp>
-
-namespace boost
-{
- namespace monotonic
- {
- /// a vector that uses a monotonic allocator by default
- template <class T>
- struct vector : detail::monotonic_container<vector<T> >
- {
- typedef detail::monotonic_container<std::vector<T, allocator<T> > > Parent;
- typedef detail::Create<detail::is_monotonic<T>::value, T> Create;
- typedef allocator<T> Allocator;
- typedef std::vector<T,Allocator> Vector;
- typedef typename Vector::iterator iterator;
- typedef typename Vector::const_iterator const_iterator;
- typedef typename Vector::size_type size_type;
- typedef typename Vector::value_type value_type;
- typedef typename Vector::reference reference;
- typedef typename Vector::const_reference const_reference;
-
-
- private:
- Vector impl;
-
- public:
- vector() { }
- vector(Allocator const &A)
- : impl(A) { }
- vector(size_t N, T const &X, Allocator const &A)
- : impl(N,X,A) { }
- template <class II>
- vector(II F, II L, Allocator const &A)
- : impl(F,L,A) { }
-
- Allocator get_allocator() const
- {
- return impl.get_allocator();
- }
- bool empty() const
- {
- return impl.empty();
- }
- size_type size() const
- {
- return impl.size();
- }
- void resize(size_type size)
- {
- impl.resize(size);//, Creator::Create(GetStorage()));
- }
- void reserve(size_type size)
- {
- impl.reserve(size);
- }
- size_type capacity() const
- {
- return impl.capacity();
- }
- reference at(size_type index)
- {
- return impl.at(index);
- }
- const_reference at(size_type index) const
- {
- return impl.at(index);
- }
- reference operator[](size_type index)
- {
- return impl[index];
- }
- const_reference operator[](size_type index) const
- {
- return impl[index];
- }
- void push_back(value_type const &value)
- {
- impl.push_back(value);
- }
- void pop_back()
- {
- impl.pop_back();
- }
- iterator begin()
- {
- return impl.begin();
- }
- iterator end()
- {
- return impl.end();
- }
- const_iterator begin() const
- {
- return impl.begin();
- }
- const_iterator end() const
- {
- return impl.end();
- }
- value_type const &front() const
- {
- return impl.front();
- }
- value_type &front()
- {
- return impl.front();
- }
- value_type const &back() const
- {
- return impl.back();
- }
- value_type &back()
- {
- return impl.back();
- }
- };
-
- } // namespace monotonic
-
-} // namespace boost
-
-#endif // BOOST_MONOTONIC_VECTOR_H
-
-//EOF
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