Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 09:48:15

0001 // Copyright 2002 The Trustees of Indiana University.
0002 
0003 // Use, modification and distribution is subject to the Boost Software 
0004 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0005 // http://www.boost.org/LICENSE_1_0.txt)
0006 
0007 //  Boost.MultiArray Library
0008 //  Authors: Ronald Garcia
0009 //           Jeremy Siek
0010 //           Andrew Lumsdaine
0011 //  See http://www.boost.org/libs/multi_array for documentation.
0012 
0013 #ifndef BOOST_MULTI_ARRAY_EXTENT_RANGE_HPP
0014 #define BOOST_MULTI_ARRAY_EXTENT_RANGE_HPP
0015 
0016 #include <utility>
0017 
0018 namespace boost {
0019 namespace detail {
0020 namespace multi_array {
0021 
0022 template <typename Extent, typename SizeType>
0023 class extent_range : private std::pair<Extent,Extent> {
0024   typedef std::pair<Extent,Extent> super_type;
0025 public:
0026   typedef Extent index;
0027   typedef SizeType size_type;
0028 
0029   extent_range(index start, index finish) :
0030     super_type(start,finish) { }
0031 
0032   extent_range(index finish) :
0033     super_type(0,finish) { }
0034 
0035   extent_range() : super_type(0,0) { }
0036 
0037   index start() const { return super_type::first; }
0038 
0039   index finish() const { return super_type::second; }
0040 
0041   size_type size() const { return super_type::second - super_type::first; }
0042 };
0043 
0044 } // namespace multi_array
0045 } // namespace detail 
0046 } // namespace boost
0047 
0048 
0049 #endif