Update contrib.
1 // Copyright 2002 The Trustees of Indiana University.
3 // Use, modification and distribution is subject to the Boost Software
4 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
7 // Boost.MultiArray Library
8 // Authors: Ronald Garcia
11 // See http://www.boost.org/libs/multi_array for documentation.
14 // assign.cpp - Test out operator=() on the different types
17 #include "generative_tests.hpp"
18 #include "boost/array.hpp"
19 #include "boost/multi_array.hpp"
20 #include "boost/cstdlib.hpp"
24 bool equal(const int& a, const int& b)
29 template <typename ArrayA, typename ArrayB>
30 bool equal(const ArrayA& A, const ArrayB& B)
32 typename ArrayA::const_iterator ia;
33 typename ArrayB::const_iterator ib = B.begin();
34 for (ia = A.begin(); ia != A.end(); ++ia, ++ib)
41 template <typename Array>
42 void access(Array& A, const mutable_array_tag&) {
44 typedef boost::multi_array<int,3> array3;
55 const int insert_size = 2*3*4;
56 array3 filler(boost::extents[2][3][4]);
57 filler.assign(insert,insert+insert_size);
62 BOOST_CHECK(equal(A,filler));
66 template <typename Array>
67 void access(Array&, const const_array_tag&) {
71 int test_main(int,char*[]) {
74 if(boost::minimal_test::errors_counter() != 0)
76 testResultXml("assign");
80 return run_generative_tests();