1 //---------------------------------------------------------------------------//
2 // Copyright (c) 2013 Kyle Lutz <kyle.r.lutz@gmail.com>
4 // Distributed under the Boost Software License, Version 1.0
5 // See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt
8 // See http://boostorg.github.com/compute for more information.
9 //---------------------------------------------------------------------------//
11 #ifndef BOOST_COMPUTE_ITERATOR_DETAIL_GET_BASE_ITERATOR_BUFFER_HPP
12 #define BOOST_COMPUTE_ITERATOR_DETAIL_GET_BASE_ITERATOR_BUFFER_HPP
18 // returns the buffer for an iterator adaptor's base iterator if
19 // it exists, otherwise returns a null buffer object.
20 template<class Iterator>
22 get_base_iterator_buffer(const Iterator &iter,
23 typename boost::enable_if<
25 typename Iterator::base_type
29 return iter.base().get_buffer();
32 template<class Iterator>
34 get_base_iterator_buffer(const Iterator &iter,
35 typename boost::disable_if<
37 typename Iterator::base_type
43 static buffer null_buffer;
48 } // end detail namespace
49 } // end compute namespace
50 } // end boost namespace
52 #endif // BOOST_COMPUTE_ITERATOR_DETAIL_GET_BASE_ITERATOR_BUFFER_HPP