]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/compute/include/boost/compute/iterator/detail/get_base_iterator_buffer.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / compute / include / boost / compute / iterator / detail / get_base_iterator_buffer.hpp
CommitLineData
7c673cae
FG
1//---------------------------------------------------------------------------//
2// Copyright (c) 2013 Kyle Lutz <kyle.r.lutz@gmail.com>
3//
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
7//
8// See http://boostorg.github.com/compute for more information.
9//---------------------------------------------------------------------------//
10
11#ifndef BOOST_COMPUTE_ITERATOR_DETAIL_GET_BASE_ITERATOR_BUFFER_HPP
12#define BOOST_COMPUTE_ITERATOR_DETAIL_GET_BASE_ITERATOR_BUFFER_HPP
13
14namespace boost {
15namespace compute {
16namespace detail {
17
18// returns the buffer for an iterator adaptor's base iterator if
19// it exists, otherwise returns a null buffer object.
20template<class Iterator>
21inline const buffer&
22get_base_iterator_buffer(const Iterator &iter,
23 typename boost::enable_if<
24 is_buffer_iterator<
25 typename Iterator::base_type
26 >
27 >::type* = 0)
28{
29 return iter.base().get_buffer();
30}
31
32template<class Iterator>
33inline const buffer&
34get_base_iterator_buffer(const Iterator &iter,
35 typename boost::disable_if<
36 is_buffer_iterator<
37 typename Iterator::base_type
38 >
39 >::type* = 0)
40{
41 (void) iter;
42
43 static buffer null_buffer;
44
45 return null_buffer;
46}
47
48} // end detail namespace
49} // end compute namespace
50} // end boost namespace
51
52#endif // BOOST_COMPUTE_ITERATOR_DETAIL_GET_BASE_ITERATOR_BUFFER_HPP