Mercurial > hg > vamp-build-and-test
annotate DEPENDENCIES/generic/include/boost/multi_array/extent_range.hpp @ 16:2665513ce2d3
Add boost headers
author | Chris Cannam |
---|---|
date | Tue, 05 Aug 2014 11:11:38 +0100 |
parents | |
children |
rev | line source |
---|---|
Chris@16 | 1 // Copyright 2002 The Trustees of Indiana University. |
Chris@16 | 2 |
Chris@16 | 3 // Use, modification and distribution is subject to the Boost Software |
Chris@16 | 4 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at |
Chris@16 | 5 // http://www.boost.org/LICENSE_1_0.txt) |
Chris@16 | 6 |
Chris@16 | 7 // Boost.MultiArray Library |
Chris@16 | 8 // Authors: Ronald Garcia |
Chris@16 | 9 // Jeremy Siek |
Chris@16 | 10 // Andrew Lumsdaine |
Chris@16 | 11 // See http://www.boost.org/libs/multi_array for documentation. |
Chris@16 | 12 |
Chris@16 | 13 #ifndef BOOST_EXTENT_RANGE_RG071801_HPP |
Chris@16 | 14 #define BOOST_EXTENT_RANGE_RG071801_HPP |
Chris@16 | 15 |
Chris@16 | 16 #include <utility> |
Chris@16 | 17 |
Chris@16 | 18 namespace boost { |
Chris@16 | 19 namespace detail { |
Chris@16 | 20 namespace multi_array { |
Chris@16 | 21 |
Chris@16 | 22 template <typename Extent, typename SizeType> |
Chris@16 | 23 class extent_range : private std::pair<Extent,Extent> { |
Chris@16 | 24 typedef std::pair<Extent,Extent> super_type; |
Chris@16 | 25 public: |
Chris@16 | 26 typedef Extent index; |
Chris@16 | 27 typedef SizeType size_type; |
Chris@16 | 28 |
Chris@16 | 29 extent_range(index start, index finish) : |
Chris@16 | 30 super_type(start,finish) { } |
Chris@16 | 31 |
Chris@16 | 32 extent_range(index finish) : |
Chris@16 | 33 super_type(0,finish) { } |
Chris@16 | 34 |
Chris@16 | 35 extent_range() : super_type(0,0) { } |
Chris@16 | 36 |
Chris@16 | 37 index start() const { return super_type::first; } |
Chris@16 | 38 |
Chris@16 | 39 index finish() const { return super_type::second; } |
Chris@16 | 40 |
Chris@16 | 41 size_type size() const { return super_type::second - super_type::first; } |
Chris@16 | 42 }; |
Chris@16 | 43 |
Chris@16 | 44 } // namespace multi_array |
Chris@16 | 45 } // namespace detail |
Chris@16 | 46 } // namespace boost |
Chris@16 | 47 |
Chris@16 | 48 |
Chris@16 | 49 #endif // BOOST_EXTENT_RANGE_RG071801_HPP |