|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r59878 - in sandbox/statistics/detail/assign/boost/assign/auto_size: . detail
From: erwann.rogard_at_[hidden]
Date: 2010-02-24 13:07:23
Author: e_r
Date: 2010-02-24 13:07:22 EST (Wed, 24 Feb 2010)
New Revision: 59878
URL: http://svn.boost.org/trac/boost/changeset/59878
Log:
m
Text files modified:
sandbox/statistics/detail/assign/boost/assign/auto_size/detail/auto_size.hpp | 7 ++++++-
sandbox/statistics/detail/assign/boost/assign/auto_size/ref_copy_list_of.hpp | 9 +++++----
sandbox/statistics/detail/assign/boost/assign/auto_size/ref_list_of.hpp | 13 ++++++-------
3 files changed, 17 insertions(+), 12 deletions(-)
Modified: sandbox/statistics/detail/assign/boost/assign/auto_size/detail/auto_size.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/detail/auto_size.hpp (original)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/detail/auto_size.hpp 2010-02-24 13:07:22 EST (Wed, 24 Feb 2010)
@@ -24,7 +24,7 @@
// This approach improves upon ref_list_of<int>() by deducing the number of
// arguments at compile time and factors the reference wrapper into a template
// parameter. In general, a reference wrapper that has copy rather than rebind
-// semantics for operator= is preferable for most situations.
+// semantics for operator= is preferable in most situations.
//
// Acknowledgement: The idea of this class was developed in collaboration
// with M.P.G
@@ -166,6 +166,11 @@
this->alloc_if();
return (*this->ptr);
}
+
+ const ref_array_& ref_array()const{
+ this->alloc_if();
+ return (*this->ptr);
+ }
typedef boost::shared_ptr<ref_array_> smart_ptr_;
// Only the last of N expressions needs to instantiate an array,
Modified: sandbox/statistics/detail/assign/boost/assign/auto_size/ref_copy_list_of.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/ref_copy_list_of.hpp (original)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/ref_copy_list_of.hpp 2010-02-24 13:07:22 EST (Wed, 24 Feb 2010)
@@ -11,14 +11,15 @@
#include <boost/assign/auto_size/detail/auto_size.hpp>
// Usage 1:
-// std::vector<T> vec = cref_copy_list_of(a)(b)(c);
+// std::vector<T> elems = cref_copy_list_of(a)(b)(c);
// Usage 2:
-// boost::array<T,3> vec = cref_copy_list_of(a)(b)(c);
+// boost::array<T,3> elems = cref_copy_list_of(a)(b)(c);
// Usage 3:
// boost::fill( ref_list_of(a)(b)(c), 0);
//
-// The name copy is to emphasize that copy semantics are used, in constrast to
-// ref_list_of() which uses rebind semantics.
+// The infix 'copy' emphasizes that copy semantics are used, which is the
+// preferable choice in most situations, in constrast to ref_list_of() which
+// has rebind semantics.
namespace boost{
namespace assign{
Modified: sandbox/statistics/detail/assign/boost/assign/auto_size/ref_list_of.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/ref_list_of.hpp (original)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/ref_list_of.hpp 2010-02-24 13:07:22 EST (Wed, 24 Feb 2010)
@@ -11,18 +11,17 @@
#include <boost/assign/auto_size/detail/auto_size.hpp>
// Usage 1:
-// std::vector<T> vec = cref_list_of(a)(b)(c);
+// std::vector<T> elems = cref_list_of(a)(b)(c);
// Usage 2:
-// boost::array<T,3> vec = cref_list_of(a)(b)(c);
+// boost::array<T,3> elems = cref_list_of(a)(b)(c);
// Usage 3:
// BOOST_AUTO(tmp,ref_list_of(a)(b)(c)); boost::fill(tmp,d);
//
-// Note that this function supersedes and has the same side effect as
-// ref_list_of<int>(), which still exists, however, for backward-compatibility.
+// This function has the same side effect as ref_list_of<int>(), but supersedes
+// it as the number of elements deduced from the arguments.
//
-// Unlike ref_copy_list_of, has rebind semantics so that Usage 3 binds d to
-// a, b, c. Unless this very specific need arises, ref_copy_list_of is safer and
-// more straightforward as it takes rvalues.
+// Usage 3 binds d to a, b, c. Unless this specific feature is needed, function
+// ref_copy_list_of() is more straightforward.
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