fix doc example typo
[boost.git] / boost / multi_array / range_list.hpp
blob406571c5b033c9b70eb7035356ab4470b2edeaf0
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
9 // Jeremy Siek
10 // Andrew Lumsdaine
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"
21 namespace boost {
22 namespace detail {
23 namespace multi_array {
25 /////////////////////////////////////////////////////////////////////////
26 // choose range list begins
29 struct choose_range_list_n {
30 template <typename T, std::size_t NumRanges>
31 struct bind {
32 typedef boost::array<T,NumRanges> type;
36 struct choose_range_list_zero {
37 template <typename T, std::size_t NumRanges>
38 struct bind {
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;
49 template <>
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 {
56 private:
57 typedef typename range_list_gen_helper<NumRanges>::choice Choice;
58 public:
59 typedef typename Choice::template bind<T,NumRanges>::type type;
63 // choose range list ends
64 /////////////////////////////////////////////////////////////////////////
66 } // namespace multi_array
67 } // namespace detail
68 } // namespace boost
70 #endif // RANGE_LIST_RG072501_HPP