|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r60667 - in sandbox/statistics/detail/assign/boost/assign/auto_size: array chain comparison_op detail
From: erwann.rogard_at_[hidden]
Date: 2010-03-16 20:28:05
Author: e_r
Date: 2010-03-16 20:28:04 EDT (Tue, 16 Mar 2010)
New Revision: 60667
URL: http://svn.boost.org/trac/boost/changeset/60667
Log:
m
Text files modified:
sandbox/statistics/detail/assign/boost/assign/auto_size/array/interface.hpp | 4 ----
sandbox/statistics/detail/assign/boost/assign/auto_size/array/lazy.hpp | 9 ++++++---
sandbox/statistics/detail/assign/boost/assign/auto_size/chain/chain_convert.hpp | 6 ++++++
sandbox/statistics/detail/assign/boost/assign/auto_size/chain/conversion_traits.hpp | 10 ++++++++++
sandbox/statistics/detail/assign/boost/assign/auto_size/chain/convert_iterator.hpp | 2 ++
sandbox/statistics/detail/assign/boost/assign/auto_size/chain/inner_value_traits.hpp | 10 +++++++++-
sandbox/statistics/detail/assign/boost/assign/auto_size/chain/pair_traits.hpp | 5 +++--
sandbox/statistics/detail/assign/boost/assign/auto_size/chain/reference_traits.hpp | 4 ++--
sandbox/statistics/detail/assign/boost/assign/auto_size/comparison_op/completed_policy.hpp | 1 +
sandbox/statistics/detail/assign/boost/assign/auto_size/comparison_op/range.hpp | 2 +-
sandbox/statistics/detail/assign/boost/assign/auto_size/detail/expr.hpp | 3 ++-
11 files changed, 42 insertions(+), 14 deletions(-)
Modified: sandbox/statistics/detail/assign/boost/assign/auto_size/array/interface.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/array/interface.hpp (original)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/array/interface.hpp 2010-03-16 20:28:04 EDT (Tue, 16 Mar 2010)
@@ -54,10 +54,6 @@
array_interface<T,N,R,D>,
typename array_interface_traits<T,N,R>::const_iterator
>
-// assign_detail::converter<
-// array_interface<T,N,R,D>,
-// typename array_interface_traits<T,N,R>::const_iterator
-// >
{
typedef array_interface_traits<T,N,R> traits;
typedef typename traits::ref_ ref_;
Modified: sandbox/statistics/detail/assign/boost/assign/auto_size/array/lazy.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/array/lazy.hpp (original)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/array/lazy.hpp 2010-03-16 20:28:04 EDT (Tue, 16 Mar 2010)
@@ -44,9 +44,12 @@
template<typename> class R,typename P,bool F>
void write_to_array(A& a,const expr<E,T,N,R,P,F>& e);
- // lazy_array is a suitable policy for auto_size::expr<>, that has the
- // functionality of array_interface<>, and postones allocation until it is
- // necessary.
+ // Postones allocation until it is necessary.
+ // D must interoperate with write_to_array.
+ //
+ // D is typically the result of nested compile time expressions each contain-
+ // ing a reference. Only the last of these expression needs to expose an
+ // friendly interface, hence 'lazy_array'.
template<typename T,int N,template<typename> class R,typename D>
class lazy_array
: public array_interface<T,N,R,lazy_array<T,N,R,D> >
Modified: sandbox/statistics/detail/assign/boost/assign/auto_size/chain/chain_convert.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/chain/chain_convert.hpp (original)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/chain/chain_convert.hpp 2010-03-16 20:28:04 EDT (Tue, 16 Mar 2010)
@@ -24,6 +24,12 @@
// http://gist.github.com/287791
// developed by MPG.
+// Usage:
+// Let r1, r2, r3 denote lvalue ranges:
+// chain_convert_l(r1)(r2)(r3)
+// If either of the 3 is an rvalue,
+// chain_convert_r(r1)(r2)(r3)
+
namespace adaptor{
namespace impl{
Modified: sandbox/statistics/detail/assign/boost/assign/auto_size/chain/conversion_traits.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/chain/conversion_traits.hpp (original)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/chain/conversion_traits.hpp 2010-03-16 20:28:04 EDT (Tue, 16 Mar 2010)
@@ -16,6 +16,16 @@
namespace assign{
namespace detail{
+// A type T is mapped to a convertible type U in two steps:
+// 1) Tag = tag_of<T>
+// 2) U = meta::convert_to<Tag>::apply<T>
+// This approach is useful to group types that share the same conversion rule.
+// This file defines two groups:
+// Tag U
+// - 'itself' (the default) T
+// - 'reference_to_inner_value' inner_value<T>&
+// but the use can also define his/her own as needed.
+
namespace conversion_traits{
namespace tag{
Modified: sandbox/statistics/detail/assign/boost/assign/auto_size/chain/convert_iterator.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/chain/convert_iterator.hpp (original)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/chain/convert_iterator.hpp 2010-03-16 20:28:04 EDT (Tue, 16 Mar 2010)
@@ -17,6 +17,8 @@
namespace assign{
namespace detail{
+// Maps an iterator I ot J such that *J = T(*I).
+
template<typename I,typename T>
struct iterator_converter : boost::iterator_adaptor<
detail::iterator_converter<I,T> // Derived
Modified: sandbox/statistics/detail/assign/boost/assign/auto_size/chain/inner_value_traits.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/chain/inner_value_traits.hpp (original)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/chain/inner_value_traits.hpp 2010-03-16 20:28:04 EDT (Tue, 16 Mar 2010)
@@ -12,9 +12,17 @@
namespace boost{
namespace assign{
namespace detail{
-
namespace inner_value_traits{
+// A type T is mapped to a an 'inner_value', U, in two steps:
+// 1) Tag = tag_of<T>
+// 2) U = meta::inner_value<Tag>::apply<T>::type
+// This approach is useful to define a group (Tag) of types that shares the same
+// property. This file defines one group
+// Tag T U
+// nested_parameter W<V> V
+// but the use can also define his/her own as needed.
+
namespace tag{
struct nested_parameter{ typedef nested_parameter type; };
}// tag
Modified: sandbox/statistics/detail/assign/boost/assign/auto_size/chain/pair_traits.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/chain/pair_traits.hpp (original)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/chain/pair_traits.hpp 2010-03-16 20:28:04 EDT (Tue, 16 Mar 2010)
@@ -20,8 +20,9 @@
#include <boost/assign/auto_size/chain/conversion_traits.hpp>
#include <boost/assign/auto_size/chain/reference_traits.hpp>
-// Maps (T,U) to a type that both are convertible to. In particular, T and U
-// may be reference wrappers.
+// Maps (T,U) to (convert_to<T>::type, convert_to<U>::type) and the latter
+// to type that is convertible to by both.
+
namespace boost{
namespace assign{
Modified: sandbox/statistics/detail/assign/boost/assign/auto_size/chain/reference_traits.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/chain/reference_traits.hpp (original)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/chain/reference_traits.hpp 2010-03-16 20:28:04 EDT (Tue, 16 Mar 2010)
@@ -20,8 +20,8 @@
#include <boost/assign/auto_size/chain/conversion_traits.hpp>
-// Let T = U or U&, and U = V or const V. Maps T to a convertible type using the
-// information provided by the conversion traits
+// Maps U = T& (or possibly U=T) to a type that is convertible to based on the
+// conversion traits.
namespace boost{
namespace assign{
Modified: sandbox/statistics/detail/assign/boost/assign/auto_size/comparison_op/completed_policy.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/comparison_op/completed_policy.hpp (original)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/comparison_op/completed_policy.hpp 2010-03-16 20:28:04 EDT (Tue, 16 Mar 2010)
@@ -22,6 +22,7 @@
// Q::greater(l,r)
// Q::less_equal(l,r)
// Q::greater_equal(l,r)
+ // using their logical relationships.
template<typename P>
struct completed_policy : P{
template<typename L,typename R>
Modified: sandbox/statistics/detail/assign/boost/assign/auto_size/comparison_op/range.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/comparison_op/range.hpp (original)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/comparison_op/range.hpp 2010-03-16 20:28:04 EDT (Tue, 16 Mar 2010)
@@ -23,7 +23,7 @@
// Expression Returns
// l == r ::boost::iterator_range_detail::equal( l, r )
// l < r ::boost::iterator_range_detail::less_than( l, r );
- // The remaining operators, !=, >,<=,>= are defined using their
+ // The remaining operators, !=, >,<=,>= are defined using their
// relationships to the two fundamental ones.
struct fundamental_policy{
Modified: sandbox/statistics/detail/assign/boost/assign/auto_size/detail/expr.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/detail/expr.hpp (original)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/detail/expr.hpp 2010-03-16 20:28:04 EDT (Tue, 16 Mar 2010)
@@ -44,7 +44,8 @@
// with M.P.G
//
// range<int>() is provided to achieve conformity with the rest of Boost.Assign
-// but it is in fact ill suited here.
+// but it is in fact ill suited here. See chain_convert_l() and
+// chain_convert_r() as an alternative.
namespace boost{
namespace assign{
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