Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r69788 - in sandbox/assign_v2/libs/assign/v2/test/ref: . array
From: erwann.rogard_at_[hidden]
Date: 2011-03-09 16:09:55


Author: e_r
Date: 2011-03-09 16:09:54 EST (Wed, 09 Mar 2011)
New Revision: 69788
URL: http://svn.boost.org/trac/boost/changeset/69788

Log:
upd assign_v2
Added:
   sandbox/assign_v2/libs/assign/v2/test/ref/csv_array.cpp (contents, props changed)
   sandbox/assign_v2/libs/assign/v2/test/ref/csv_array.h (contents, props changed)
Removed:
   sandbox/assign_v2/libs/assign/v2/test/ref/array/

Added: sandbox/assign_v2/libs/assign/v2/test/ref/csv_array.cpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/ref/csv_array.cpp 2011-03-09 16:09:54 EST (Wed, 09 Mar 2011)
@@ -0,0 +1,79 @@
+//////////////////////////////////////////////////////////////////////////////
+// Boost.Assign v2 //
+// //
+// Copyright (C) 2003-2004 Thorsten Ottosen //
+// Copyright (C) 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) //
+//////////////////////////////////////////////////////////////////////////////
+#include <vector>
+#include <boost/range/begin.hpp>
+#include <boost/range/algorithm/copy.hpp>
+#include <boost/typeof/typeof.hpp>
+#include <boost/assign/v2/detail/config/check.hpp>
+#include <boost/assign/v2/ref/array/csv_array.hpp>
+#include <boost/assign/v2/ref/wrapper.hpp>
+#include <libs/assign/v2/test/ref/csv_array.h>
+
+namespace test_assign_v2{
+namespace xxx_ref{
+namespace xxx_csv_array{
+
+ void test()
+ {
+ namespace as2 = boost::assign::v2;
+ {
+ //[ref_csv_array
+ typedef int const T;
+ T x = 72, y = 31, z = 48;
+ typedef as2::ref::nth_result_of::csv_array<3, T>::type ar_;
+ ar_ ar = as2::ref::csv_array( x, y, z );
+ {
+ T& a = ar[0]; T& b = ar[2];
+
+ BOOST_ASSIGN_V2_CHECK( &a == &x );
+ BOOST_ASSIGN_V2_CHECK( &b == &z );
+ }
+ //]
+ {
+ T& a = ar.front(); T& b = ar.back();
+
+ BOOST_ASSIGN_V2_CHECK( &a == &x );
+ BOOST_ASSIGN_V2_CHECK( &b == &z );
+ }
+ {
+ T& a = (*boost::begin( ar ) );
+ T& b = *boost::next( boost::begin( ar ), 2 );
+
+ BOOST_ASSIGN_V2_CHECK( &a == &x );
+ BOOST_ASSIGN_V2_CHECK( &b == &z );
+ }
+ }
+ {
+ //[ref_csv_array_w
+ typedef int T; T x, y, z;
+ std::vector<T> r( 3 ); r[0] = 72; r[1] = 31; r[2] = 48;
+ boost::copy( r, boost::begin(
+ as2::ref::csv_array( x, y, z ) | as2::ref::_get
+ )
+ );
+
+ BOOST_ASSIGN_V2_CHECK( x == r[0] );
+ BOOST_ASSIGN_V2_CHECK( z == r[2] );
+ //]
+ }
+ {
+ //[ref_csv_array_assign
+ typedef int T; T x, y, z;
+ as2::ref::csv_array( x, y, z ).assign( -1 );
+
+ BOOST_ASSIGN_V2_CHECK( x == -1 );
+ BOOST_ASSIGN_V2_CHECK( z == -1 );
+ //]
+ }
+ }
+
+}// xxx_csv_array
+}// xxx_ref
+}// test_assign

Added: sandbox/assign_v2/libs/assign/v2/test/ref/csv_array.h
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/ref/csv_array.h 2011-03-09 16:09:54 EST (Wed, 09 Mar 2011)
@@ -0,0 +1,24 @@
+//////////////////////////////////////////////////////////////////////////////
+// Boost.Assign v2 //
+// //
+// Copyright (C) 2003-2004 Thorsten Ottosen //
+// Copyright (C) 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_V2_TEST_REF_CSV_ARRAY_ER_2010_H
+#define BOOST_ASSIGN_V2_TEST_REF_CSV_ARRAY_ER_2010_H
+
+namespace test_assign_v2{
+namespace xxx_ref{
+namespace xxx_csv_array{
+
+ void test();
+
+}// xxx_csv_array
+}// xxx_ref
+}// test_assign
+
+#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