Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:42:06

0001 // Copyright 2002 The Trustees of Indiana University.
0002 
0003 // Use, modification and distribution is subject to the Boost Software 
0004 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0005 // http://www.boost.org/LICENSE_1_0.txt)
0006 
0007 //  Boost.MultiArray Library
0008 //  Authors: Ronald Garcia
0009 //           Jeremy Siek
0010 //           Andrew Lumsdaine
0011 //  See http://www.boost.org/libs/multi_array for documentation.
0012 
0013 #ifndef BOOST_MULTI_ARRAY_RANGE_LIST_HPP
0014 #define BOOST_MULTI_ARRAY_RANGE_LIST_HPP
0015 //
0016 // range_list.hpp - helper to build boost::arrays for *_set types
0017 //
0018 
0019 #include "boost/array.hpp"
0020 
0021 namespace boost {
0022 namespace detail {
0023 namespace multi_array {
0024 
0025 /////////////////////////////////////////////////////////////////////////
0026 // choose range list begins
0027 //
0028 
0029 struct choose_range_list_n {
0030   template <typename T, std::size_t NumRanges>
0031   struct bind {
0032     typedef boost::array<T,NumRanges> type;
0033   };
0034 };
0035 
0036 struct choose_range_list_zero {
0037   template <typename T, std::size_t NumRanges>
0038   struct bind {
0039     typedef boost::array<T,1> type;
0040   };
0041 };
0042 
0043 
0044 template <std::size_t NumRanges>
0045 struct range_list_gen_helper {
0046   typedef choose_range_list_n choice;
0047 };
0048 
0049 template <>
0050 struct range_list_gen_helper<0> {
0051   typedef choose_range_list_zero choice;
0052 };
0053 
0054 template <typename T, std::size_t NumRanges>
0055 struct range_list_generator {
0056 private:
0057   typedef typename range_list_gen_helper<NumRanges>::choice Choice;
0058 public:
0059   typedef typename Choice::template bind<T,NumRanges>::type type;
0060 };
0061 
0062 //
0063 // choose range list ends
0064 /////////////////////////////////////////////////////////////////////////
0065 
0066 } // namespace multi_array
0067 } // namespace detail
0068 } // namespace boost
0069 
0070 #endif