Chris@16: // Copyright 2002 The Trustees of Indiana University. Chris@16: Chris@16: // Use, modification and distribution is subject to the Boost Software Chris@16: // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: // Boost.MultiArray Library Chris@16: // Authors: Ronald Garcia Chris@16: // Jeremy Siek Chris@16: // Andrew Lumsdaine Chris@16: // See http://www.boost.org/libs/multi_array for documentation. Chris@16: Chris@16: #ifndef BOOST_EXTENT_RANGE_RG071801_HPP Chris@16: #define BOOST_EXTENT_RANGE_RG071801_HPP Chris@16: Chris@16: #include Chris@16: Chris@16: namespace boost { Chris@16: namespace detail { Chris@16: namespace multi_array { Chris@16: Chris@16: template Chris@16: class extent_range : private std::pair { Chris@16: typedef std::pair super_type; Chris@16: public: Chris@16: typedef Extent index; Chris@16: typedef SizeType size_type; Chris@16: Chris@16: extent_range(index start, index finish) : Chris@16: super_type(start,finish) { } Chris@16: Chris@16: extent_range(index finish) : Chris@16: super_type(0,finish) { } Chris@16: Chris@16: extent_range() : super_type(0,0) { } Chris@16: Chris@16: index start() const { return super_type::first; } Chris@16: Chris@16: index finish() const { return super_type::second; } Chris@16: Chris@16: size_type size() const { return super_type::second - super_type::first; } Chris@16: }; Chris@16: Chris@16: } // namespace multi_array Chris@16: } // namespace detail Chris@16: } // namespace boost Chris@16: Chris@16: Chris@16: #endif // BOOST_EXTENT_RANGE_RG071801_HPP