• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2002 The Trustees of Indiana University.
2 
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)
6 
7 //  Boost.MultiArray Library
8 //  Authors: Ronald Garcia
9 //           Jeremy Siek
10 //           Andrew Lumsdaine
11 //  See http://www.boost.org/libs/multi_array for documentation.
12 
13 //
14 // test out my new storage_order stuff
15 //
16 
17 #include <boost/core/lightweight_test.hpp>
18 
19 #include <boost/multi_array/storage_order.hpp>
20 
21 int
main()22 main() {
23 
24   using namespace boost;
25 
26   array<std::size_t,5> c_ordering = {{4,3,2,1,0}};;
27   array<std::size_t,5> fortran_ordering = {{0,1,2,3,4}};
28   array<bool,5> ascending = {{true,true,true,true,true}};
29   general_storage_order<5> c_storage(c_ordering.begin(),
30                                      ascending.begin());
31   general_storage_order<5> fortran_storage(fortran_ordering.begin(),
32                                            ascending.begin());
33 
34   BOOST_TEST(c_storage == (general_storage_order<5>) c_storage_order());
35   BOOST_TEST(fortran_storage ==
36              (general_storage_order<5>) fortran_storage_order());
37 
38   return boost::report_errors();
39 }
40