1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/stdapis/boost/multi_array/extent_range.hpp Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -0,0 +1,49 @@
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 BOOST_EXTENT_RANGE_RG071801_HPP
1.17 +#define BOOST_EXTENT_RANGE_RG071801_HPP
1.18 +
1.19 +#include <utility>
1.20 +
1.21 +namespace boost {
1.22 +namespace detail {
1.23 +namespace multi_array {
1.24 +
1.25 +template <typename Extent, typename SizeType>
1.26 +class extent_range : private std::pair<Extent,Extent> {
1.27 + typedef std::pair<Extent,Extent> super_type;
1.28 +public:
1.29 + typedef Extent index;
1.30 + typedef SizeType size_type;
1.31 +
1.32 + extent_range(index start, index finish) :
1.33 + super_type(start,finish) { }
1.34 +
1.35 + extent_range(index finish) :
1.36 + super_type(0,finish) { }
1.37 +
1.38 + extent_range() : super_type(0,0) { }
1.39 +
1.40 + index start() const { return super_type::first; }
1.41 +
1.42 + index finish() const { return super_type::second; }
1.43 +
1.44 + size_type size() const { return super_type::second - super_type::first; }
1.45 +};
1.46 +
1.47 +} // namespace multi_array
1.48 +} // namespace detail
1.49 +} // namespace boost
1.50 +
1.51 +
1.52 +#endif // BOOST_EXTENT_RANGE_RG071801_HPP