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 BOOST_EXTENT_RANGE_RG071801_HPP
14 #define BOOST_EXTENT_RANGE_RG071801_HPP
20 namespace multi_array {
22 template <typename Extent, typename SizeType>
23 class extent_range : private std::pair<Extent,Extent> {
24 typedef std::pair<Extent,Extent> super_type;
27 typedef SizeType size_type;
29 extent_range(index start, index finish) :
30 super_type(start,finish) { }
32 extent_range(index finish) :
33 super_type(0,finish) { }
35 extent_range() : super_type(0,0) { }
37 index start() const { return super_type::first; }
39 index finish() const { return super_type::second; }
41 size_type size() const { return super_type::second - super_type::first; }
44 } // namespace multi_array
49 #endif // BOOST_EXTENT_RANGE_RG071801_HPP