|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r71072 - sandbox/assign_v2/libs/assign/v2/test/option
From: erwann.rogard_at_[hidden]
Date: 2011-04-06 23:11:22
Author: e_r
Date: 2011-04-06 23:11:20 EDT (Wed, 06 Apr 2011)
New Revision: 71072
URL: http://svn.boost.org/trac/boost/changeset/71072
Log:
upd assign_v2
Added:
sandbox/assign_v2/libs/assign/v2/test/option/row_major.cpp (contents, props changed)
sandbox/assign_v2/libs/assign/v2/test/option/row_major.h (contents, props changed)
Added: sandbox/assign_v2/libs/assign/v2/test/option/row_major.cpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/option/row_major.cpp 2011-04-06 23:11:20 EDT (Wed, 06 Apr 2011)
@@ -0,0 +1,64 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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 <boost/assign/v2/detail/config/enable_cpp0x.hpp>
+
+#include <boost/assign/v2/detail/config/check.hpp>
+#include <boost/assign/v2/include/csv_put.hpp>
+#include <boost/assign/v2/option/data.hpp>
+#include <boost/assign/v2/option/modifier/row_major.hpp>
+#include <boost/lambda/lambda.hpp>
+#include <boost/multi_array.hpp>
+#include <boost/range/iterator_range.hpp>
+#include <boost/typeof/typeof.hpp>
+#include <libs/assign/v2/test/option/row_major.h>
+
+#include <iostream>
+
+namespace test_assign_v2{
+namespace xxx_option{
+namespace xxx_row_major{
+
+ void test()
+ {
+
+ using namespace boost;
+ namespace as2 = boost::assign::v2;
+
+ //[test_option_row_major
+ typedef boost::multi_array<int, 2> array2_;
+ typedef array2_::size_type size_;
+ typedef size_ const dim_;
+ dim_ dim1 = 3, dim2 = 3;
+ array2_ array2( extents[dim1][dim2] );
+
+ int k = -2;
+ BOOST_AUTO( option, as2::_row_major = ( lambda::var( k ) += 2 ) );
+ as2::csv_put( array2, option, -1, -1, -1, -1, -1 );
+ k = -1; as2::csv_put( array2, option, +1, +1, +1, +1 );
+
+ const int benchmark [] = {
+ -1, +1, -1,
+ +1, -1, +1,
+ -1, +1, -1
+ };
+ size_ const n = array2.num_elements();
+ BOOST_ASSIGN_V2_CHECK(
+ range::equal(
+ make_iterator_range( array2.data(), n + array2.data() ),
+ make_iterator_range( benchmark, n + benchmark )
+ )
+ );
+ //]
+ }
+
+}// xxx_row_major
+}// xxx_option
+}// xxx_test_assign
+
Added: sandbox/assign_v2/libs/assign/v2/test/option/row_major.h
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/option/row_major.h 2011-04-06 23:11:20 EDT (Wed, 06 Apr 2011)
@@ -0,0 +1,23 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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 LIBS_ASSIGN_V2_TEST_OPTION_ROW_MAJOR_ER_2010_H
+#define LIBS_ASSIGN_V2_TEST_OPTION_ROW_MAJOR_ER_2010_H
+
+namespace test_assign_v2{
+namespace xxx_option{
+namespace xxx_row_major{
+
+ void test();
+
+}// xxx_row_major
+}// xxx_option
+}// xxx_test_assign
+
+#endif // LIBS_ASSIGN_V2_TEST_OPTION_ROW_MAJOR_ER_2010_H
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