|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r60008 - in sandbox/statistics/detail/assign/boost/assign/auto_size/detail: . policy
From: erwann.rogard_at_[hidden]
Date: 2010-02-28 19:29:51
Author: e_r
Date: 2010-02-28 19:29:51 EST (Sun, 28 Feb 2010)
New Revision: 60008
URL: http://svn.boost.org/trac/boost/changeset/60008
Log:
m
Removed:
sandbox/statistics/detail/assign/boost/assign/auto_size/detail/array_interface.hpp
sandbox/statistics/detail/assign/boost/assign/auto_size/detail/array_wrapper.hpp
sandbox/statistics/detail/assign/boost/assign/auto_size/detail/policy/array.hpp
Deleted: sandbox/statistics/detail/assign/boost/assign/auto_size/detail/array_interface.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/detail/array_interface.hpp 2010-02-28 19:29:51 EST (Sun, 28 Feb 2010)
+++ (empty file)
@@ -1,141 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// assign::detail::array_interface.hpp //
-// //
-// (C) Copyright 2010 Erwann Rogard //
-// Use, modification and distribution are subject to 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_ASSIGN_AUTO_SIZE_DETAIL_ARRAY_INTERFACE_ER_2010_HPP
-#define BOOST_ASSIGN_AUTO_SIZE_DETAIL_ARRAY_INTERFACE_ER_2010_HPP
-#include <algorithm>
-#include <boost/mpl/bool.hpp>
-#include <boost/array.hpp>
-#include <boost/range.hpp>
-#include <boost/assign/auto_size/detail/has_copy_semantics.hpp>
-
-namespace boost{
-namespace assign{
-namespace detail{
-namespace auto_size{
-
- template<typename T,int N,template<typename> class Ref>
- struct ref_array{
- typedef boost::array<typename Ref<T>::type,N> type;
- };
-
- // Requirements:
- // D must implement:
- // const ref_array_& ref_array_impl()const
- // ref_array& ref_array_impl()
- template<typename T,int N,template<typename> class Ref,typename D>
- struct array_interface{
- typedef typename Ref<T>::type ref_;
- typedef typename ref_array<T,N,Ref>::type ref_array_;
-
- typedef ref_ value_type;
- typedef typename
- boost::range_iterator<ref_array_>::type iterator;
- typedef typename boost::range_iterator<
- const ref_array_>::type const_iterator;
- typedef typename
- boost::range_size<ref_array_>::type size_type;
- typedef typename boost::range_difference<
- ref_array_>::type difference_type;
-
- iterator begin()
- {
- return boost::begin(this->ref_array());
- }
- iterator end()
- {
- return boost::end(this->ref_array());
- }
-
- const_iterator begin()const
- {
- return boost::begin(this->ref_array());
- }
- const_iterator end()const
- {
- return boost::end(this->ref_array());
- }
-
- size_type size() const
- {
- return ref_array_::size();
- }
- bool empty() const
- {
- return !(this->size());
- }
-
- typedef typename ref_array_::reference reference;
- typedef typename
- ref_array_::const_reference const_reference;
-
- reference operator[](size_type i){ return (this->ref_array())[i]; }
- const_reference operator[](size_type i)const{
- return (this->array())[i]; }
-
- reference front(){ return (this->ref_array()).front(); }
- const_reference front() const{ return (this->ref_array()).front(); }
- reference back(){ return (this->ref_array()).back(); }
- const_reference back() const{ return (this->ref_array()).back(); }
-
- void swap(ref_array_& other){ return (this->ref_array()).swap(other); }
- void assign(const T& val){
- typedef has_copy_semantics<ref_> pred_;
- return this->assign(val,pred_());
- }
-
- template<typename T1>
- operator boost::array<T1,N>()const{
- boost::array<T1,N> ar;
- std::copy(
- boost::begin(this->ref_array()),
- boost::end(this->ref_array()),
- boost::begin(ar)
- );
- return ar;
- }
-
- template<typename C>
- operator C ()const
- {
- return C(
- boost::begin(this->ref_array()),
- boost::end(this->ref_array())
- );
- }
-
- private:
- typedef boost::mpl::bool_<false> false_;
- typedef boost::mpl::bool_<true> true_;
-
- void assign(const T& val,true_ /*copy semantics*/){
- // Force copy semantics. Suggested by M.P.G on Feb 28th, 2010.
- ref_array_& ra = this->ref_array();
- std::fill(ra.begin(), ra.end(), val);
- }
-
- void assign(const T& val,false_ /*copy semantics*/){
- return this->ref_array().assign(val);
- }
-
- ref_array_& ref_array(){
- return static_cast<D&>(*this).ref_array_impl();
- }
-
- const ref_array_& ref_array()const{
- return static_cast<const D&>(*this).ref_array_impl();
- }
-
- };
-
-}// auto_size
-}// detail
-}// assign
-}// boost
-
-#endif
Deleted: sandbox/statistics/detail/assign/boost/assign/auto_size/detail/array_wrapper.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/detail/array_wrapper.hpp 2010-02-28 19:29:51 EST (Sun, 28 Feb 2010)
+++ (empty file)
@@ -1,58 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// assign::detail::array_wrapper.hpp //
-// //
-// (C) Copyright 2010 Erwann Rogard //
-// Use, modification and distribution are subject to 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_ASSIGN_AUTO_SIZE_DETAIL_ARRAY_WRAPPER_ER_2010_HPP
-#define BOOST_ASSIGN_AUTO_SIZE_DETAIL_ARRAY_WRAPPER_ER_2010_HPP
-#include <boost/shared_ptr.hpp>
-#include <boost/assign/auto_size/detail/array_interface.hpp>
-#include <boost/assign/auto_size/detail/auto_size.hpp>
-
-namespace boost{
-namespace assign{
-namespace detail{
-namespace auto_size{
-
- // See csv.hpp
- template<typename T,int N,template<typename> class Ref>
- class array_wrapper
- : public array_interface<T,N,Ref,array_wrapper<T,N,Ref> >
- {
-
- typedef typename ref_array<T,N,Ref>::type ref_array_;
- typedef boost::shared_ptr<ref_array_> smart_ptr_;
-
- public:
-
- array_wrapper(){}
-
- ref_array_& ref_array_impl(){
- return this->ref_array;
- }
-
- const ref_array_& ref_array_impl()const{
- return this->ref_array;
- }
-
- template<typename E>
- void initialize(const E& coll)const{
- write_to_array(this->ref_array,coll);
- }
-
- private:
-
- mutable ref_array_ ref_array;
-
- };
-
-}// auto_size
-}// detail
-}// assign
-}// boost
-
-#endif
-
Deleted: sandbox/statistics/detail/assign/boost/assign/auto_size/detail/policy/array.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/detail/policy/array.hpp 2010-02-28 19:29:51 EST (Sun, 28 Feb 2010)
+++ (empty file)
@@ -1,80 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// assign::detail::policy::array.hpp //
-// //
-// (C) Copyright 2010 Erwann Rogard //
-// Use, modification and distribution are subject to 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_ASSIGN_AUTO_SIZE_DETAIL_POLICY_ARRAY_ER_2010_HPP
-#define BOOST_ASSIGN_AUTO_SIZE_DETAIL_POLICY_ARRAY_ER_2010_HPP
-#include <boost/shared_ptr.hpp>
-#include <boost/assign/auto_size/detail/array_interface.hpp>
-#include <boost/assign/auto_size/detail/array_wrapper.hpp>
-
-namespace boost{
-namespace assign{
-namespace detail{
-namespace auto_size{
-
- template<
- typename E,typename T,int N,template<typename> class Ref,typename P
- >
- class expr;
-
- template<typename T,int N,template<typename> class Ref>
- struct ref_array;
-
- template<typename A,typename E,typename T,int N,
- template<typename> class Ref,typename P>
- void write_to_array(A& a,const expr<E,T,N,Ref,P>& e);
-
-
-namespace policy{
-
- // Policy for auto_size::expr that exposes an array interface
- template<typename T,int N,template<typename> class Ref,typename D>
- class array
- : public array_interface<T,N,Ref,array<T,N,Ref,D> >
- {
-
- typedef typename ref_array<T,N,Ref>::type ref_array_;
-
- void alloc_if()const{
- if(!this->ptr){
- return this->alloc();
- }
- }
-
- void alloc()const{
- this->ptr = smart_ptr_(new ref_array_);
- write_to_array(*this->ptr,static_cast<const D&>(*this));
- }
-
- public:
-
- ref_array_& ref_array_impl(){
- this->alloc_if();
- return (*this->ptr);
- }
-
- const ref_array_& ref_array_impl()const{
- this->alloc_if();
- return (*this->ptr);
- }
-
- private:
- typedef boost::shared_ptr<ref_array_> smart_ptr_;
- // Only the last of N expressions needs to instantiate an array,
- // hence a pointer.
- mutable smart_ptr_ ptr;
-
- };
-
-}// policy
-}// auto_size
-}// detail
-}// assign
-}// boost
-
-#endif
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