Boost logo

Boost-Commit :

From: nesotto_at_[hidden]
Date: 2008-06-24 11:45:39


Author: nesotto
Date: 2008-06-24 11:45:38 EDT (Tue, 24 Jun 2008)
New Revision: 46653
URL: http://svn.boost.org/trac/boost/changeset/46653

Log:
minor changes from trunk
Text files modified:
   branches/release/libs/assign/doc/index.html | 20 ++++++++++----------
   branches/release/libs/assign/test/list_of.cpp | 40 ++++++++++++++++++++++++++++++++++++++--
   2 files changed, 48 insertions(+), 12 deletions(-)

Modified: branches/release/libs/assign/doc/index.html
==============================================================================
--- branches/release/libs/assign/doc/index.html (original)
+++ branches/release/libs/assign/doc/index.html 2008-06-24 11:45:38 EDT (Tue, 24 Jun 2008)
@@ -23,7 +23,7 @@
   </p>
   <p>
   Use, modification and distribution is subject to the Boost Software License, Version 1.0
- (see <a href=http://www.boost.org/LICENSE_1_0.txt>
+ (see <a href="http://www.boost.org/LICENSE_1_0.txt">
    http://www.boost.org/LICENSE_1_0.txt>).
   </p>
   <h3>Table of Contents</h3>
@@ -706,7 +706,7 @@
   All forwarding is done by passing objects by <code>const</code> reference.
 Originally arguments were passed by value (and still is in
 <code>tuple_list_of()</code>). One thing to remember is that references
- can be passed by using <code>boost::<a href=
http://www.boost.org/doc/html/ref.html>ref</a></code>.
+ can be passed by using <code>boost::ref</code>.
   </p>
   
   <p>
@@ -871,7 +871,7 @@
     <p>
   These two functions are used to construct anonymous
   list which can be converted to any standard container
- and <code>boost::<a href=../../array/index.html>array</a>&lt;T,sz>.</code>
+ and <code>boost::array&lt;T,sz>.</code>
 The object returned by the two
   functions is guaranteed to have the interface described below.
   </p>
@@ -1292,9 +1292,9 @@
   Here is a list libraries has been tested with Boost.Assign:
   
   <ol>
- <li> <code>boost::<a href=../../array/index.html>array</a></code>
- <li> <code>boost::<a href=../../multi_index/index.html>multi_index_container</a></code>
- <li> <code>Boost.<a href=../../ptr_container/index.html>Pointer Container</code> </ol> <p>
+ <li> <code>boost::array</code>
+ <li> <code>boost::multi_index_container</code>
+ <li> <code>Boost.<a href="../../ptr_container/index.html">Pointer Container</code> </ol> <p>
 
   </p>
   
@@ -1357,9 +1357,9 @@
   library is non-intrusive and puts only a minimum of requirements
   on its supported classes.
  Overloading operator comma is sometimes viewed as a bad practice <a
-href=#meyers>[1]</A>. However, it has been done
+href="#meyers">[1]</A>. However, it has been done
   with success in eg. the Generative Matrix Computation Library and Blitz to initialize matrices
- (see <a href=#gmcl>[2]</A>) and <a href=#blitz>[3]</A>). The
+ (see [2]) and [3]). The
 Initialization Library overloads
       the comma operator in a safe manner by letting free standing functions
  return an object that is responsible for the initialization. Therefore it takes
@@ -1388,10 +1388,10 @@
   <ol>
       <li> <a name="meyers"> Scott. Meyers, "More Effective C++", Item 7, Addison Wesley, 1996
       <li> <a name="gmcl"> K. Czarnecki and U.W. Eisenecker, "Generative programming", Addison-Wesley, 2000
- <li> <a name="blitz"> <a href=http://www.oonumerics.org/blitz/> http://www.oonumerics.org/blitz/ </A>
+ <li> <a name="blitz"> http://www.oonumerics.org/blitz/
       <li> <a name="initializer">
           Gabriel Dos Reis and Bjarne Stroustrup,
- <a href=http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/2003/n1509.pdf> "Generalized Initializer
+ <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/2003/n1509.pdf"> "Generalized Initializer
             Lists"</a>, 2003 </a>
  </OL>
  </p>

Modified: branches/release/libs/assign/test/list_of.cpp
==============================================================================
--- branches/release/libs/assign/test/list_of.cpp (original)
+++ branches/release/libs/assign/test/list_of.cpp 2008-06-24 11:45:38 EDT (Tue, 24 Jun 2008)
@@ -224,7 +224,44 @@
 */
 }
 
+//
+// @remark: ADL is required here, but it is a bit wierd to
+// open up namespace std. Perhaps Boost.Test needs a
+// better configuration option.
+//
+namespace std
+{
+ template< class T, class Elem, class Traits >
+ inline std::basic_ostream<Elem,Traits>&
+ operator<<( std::basic_ostream<Elem, Traits>& Os,
+ const std::vector<T>& r )
+ {
+ return Os << ::boost::make_iterator_range( r.begin(), r.end() );
+ }
+}
 
+template <class Seq>
+inline std::vector<int> as_seq( const Seq& s )
+{
+ std::vector<int> c;
+ return s.to_container( c );
+}
+
+void test_comparison_operations()
+{
+ BOOST_CHECK_EQUAL( ba::list_of(0)(1)(2), as_seq(ba::list_of(0)(1)(2)) );
+ BOOST_CHECK_NE( ba::list_of(0)(1)(2), as_seq(ba::list_of(-1)(1)(2)) );
+ BOOST_CHECK_LT( ba::list_of(0)(1)(2), as_seq(ba::list_of(0)(1)(3)) );
+ BOOST_CHECK_LE( ba::list_of(0)(1)(2), as_seq(ba::list_of(0)(1)(2)) );
+ BOOST_CHECK_GT( ba::list_of(0)(1)(3), as_seq(ba::list_of(0)(1)(2)) );
+ BOOST_CHECK_GE( ba::list_of(0)(1)(2), as_seq(ba::list_of(0)(1)(2)) );
+ BOOST_CHECK_EQUAL( as_seq(ba::list_of(0)(1)(2)), ba::list_of(0)(1)(2) );
+ BOOST_CHECK_NE( as_seq(ba::list_of(0)(1)(2)), ba::list_of(-1)(1)(2) );
+ BOOST_CHECK_LT( as_seq(ba::list_of(0)(1)(2)), ba::list_of(0)(1)(3) );
+ BOOST_CHECK_LE( as_seq(ba::list_of(0)(1)(2)), ba::list_of(0)(1)(2) );
+ BOOST_CHECK_GT( as_seq(ba::list_of(0)(1)(3)), ba::list_of(0)(1)(2) );
+ BOOST_CHECK_GE( as_seq(ba::list_of(0)(1)(2)), ba::list_of(0)(1)(2) );
+}
 
 void check_list_of()
 {
@@ -242,9 +279,8 @@
     
     std::stack<std::string> s = ba::list_of( "Foo" )( "Bar" )( "FooBar" ).to_adapter( s );
     test_list_of();
-
     test_vector_matrix();
-
+ test_comparison_operations();
 }
 
 


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