epoc32/include/stdapis/boost/multi_array/range_list.hpp
branchSymbian2
changeset 2 2fe1408b6811
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/stdapis/boost/multi_array/range_list.hpp	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -0,0 +1,70 @@
     1.4 +// Copyright 2002 The Trustees of Indiana University.
     1.5 +
     1.6 +// Use, modification and distribution is subject to the Boost Software 
     1.7 +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
     1.8 +// http://www.boost.org/LICENSE_1_0.txt)
     1.9 +
    1.10 +//  Boost.MultiArray Library
    1.11 +//  Authors: Ronald Garcia
    1.12 +//           Jeremy Siek
    1.13 +//           Andrew Lumsdaine
    1.14 +//  See http://www.boost.org/libs/multi_array for documentation.
    1.15 +
    1.16 +#ifndef RANGE_LIST_RG072501_HPP
    1.17 +#define RANGE_LIST_RG072501_HPP
    1.18 +//
    1.19 +// range_list.hpp - helper to build boost::arrays for *_set types
    1.20 +//
    1.21 +
    1.22 +#include "boost/array.hpp"
    1.23 +
    1.24 +namespace boost {
    1.25 +namespace detail {
    1.26 +namespace multi_array {
    1.27 +
    1.28 +/////////////////////////////////////////////////////////////////////////
    1.29 +// choose range list begins
    1.30 +//
    1.31 +
    1.32 +struct choose_range_list_n {
    1.33 +  template <typename T, std::size_t NumRanges>
    1.34 +  struct bind {
    1.35 +    typedef boost::array<T,NumRanges> type;
    1.36 +  };
    1.37 +};
    1.38 +
    1.39 +struct choose_range_list_zero {
    1.40 +  template <typename T, std::size_t NumRanges>
    1.41 +  struct bind {
    1.42 +    typedef boost::array<T,1> type;
    1.43 +  };
    1.44 +};
    1.45 +
    1.46 +
    1.47 +template <std::size_t NumRanges>
    1.48 +struct range_list_gen_helper {
    1.49 +  typedef choose_range_list_n choice;
    1.50 +};
    1.51 +
    1.52 +template <>
    1.53 +struct range_list_gen_helper<0> {
    1.54 +  typedef choose_range_list_zero choice;
    1.55 +};
    1.56 +
    1.57 +template <typename T, std::size_t NumRanges>
    1.58 +struct range_list_generator {
    1.59 +private:
    1.60 +  typedef typename range_list_gen_helper<NumRanges>::choice Choice;
    1.61 +public:
    1.62 +  typedef typename Choice::template bind<T,NumRanges>::type type;
    1.63 +};
    1.64 +
    1.65 +//
    1.66 +// choose range list ends
    1.67 +/////////////////////////////////////////////////////////////////////////
    1.68 +
    1.69 +} // namespace multi_array
    1.70 +} // namespace detail
    1.71 +} // namespace boost
    1.72 +
    1.73 +#endif // RANGE_LIST_RG072501_HPP