|
Boost-Commit : |
From: nesotto_at_[hidden]
Date: 2007-10-25 16:50:51
Author: nesotto
Date: 2007-10-25 16:50:51 EDT (Thu, 25 Oct 2007)
New Revision: 40466
URL: http://svn.boost.org/trac/boost/changeset/40466
Log:
update of test for ptr_list_of which can now actually works because of copyability of the ptr_contaners
Text files modified:
trunk/libs/assign/test/ptr_list_of.cpp | 19 +++++++++++--------
1 files changed, 11 insertions(+), 8 deletions(-)
Modified: trunk/libs/assign/test/ptr_list_of.cpp
==============================================================================
--- trunk/libs/assign/test/ptr_list_of.cpp (original)
+++ trunk/libs/assign/test/ptr_list_of.cpp 2007-10-25 16:50:51 EDT (Thu, 25 Oct 2007)
@@ -18,7 +18,7 @@
#include <boost/assign/ptr_list_of.hpp>
#include <boost/test/test_tools.hpp>
-#include <boost/ptr_container/ptr_deque.hpp>
+#include <boost/ptr_container/ptr_container.hpp>
struct Foo
{
@@ -39,22 +39,25 @@
return l.i < r.i;
}
-void check_ptr_list_of()
+template< class PtrCont >
+void check_ptr_list_of_impl()
{
using namespace std;
using namespace boost;
using namespace boost::assign;
- ptr_deque<Foo> deq;
- //
- // Many compilers (gcc, cw, ...) need the trailing
- // '.to_container( a_container )' to work
- //
- deq = ptr_list_of<Foo>( 42 )()()( 3, 3 )( "foo", 2, 1 ).to_container( deq );
+ PtrCont deq;
+ deq = ptr_list_of<Foo>( 42 )()()( 3, 3 )( "foo", 2, 1 );
BOOST_CHECK( deq.size() == 5 );
}
+void check_ptr_list_of()
+{
+ check_ptr_list_of_impl< boost::ptr_deque<Foo> >();
+ check_ptr_list_of_impl< boost::ptr_list<Foo> >();
+ check_ptr_list_of_impl< boost::ptr_vector<Foo> >();
+}
#include <boost/test/unit_test.hpp>
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