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.
13
#ifndef RANGE_LIST_RG072501_HPP
14
#define RANGE_LIST_RG072501_HPP
16
// range_list.hpp - helper to build boost::arrays for *_set types
19
#include "boost/array.hpp"
23
namespace multi_array {
25
/////////////////////////////////////////////////////////////////////////
26
// choose range list begins
29
struct choose_range_list_n {
30
template <typename T, std::size_t NumRanges>
32
typedef boost::array<T,NumRanges> type;
36
struct choose_range_list_zero {
37
template <typename T, std::size_t NumRanges>
39
typedef boost::array<T,1> type;
44
template <std::size_t NumRanges>
45
struct range_list_gen_helper {
46
typedef choose_range_list_n choice;
50
struct range_list_gen_helper<0> {
51
typedef choose_range_list_zero choice;
54
template <typename T, std::size_t NumRanges>
55
struct range_list_generator {
57
typedef typename range_list_gen_helper<NumRanges>::choice Choice;
59
typedef typename Choice::template bind<T,NumRanges>::type type;
63
// choose range list ends
64
/////////////////////////////////////////////////////////////////////////
66
} // namespace multi_array
70
#endif // RANGE_LIST_RG072501_HPP