Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:30:01

0001 //---------------------------------------------------------------------------//
0002 // Copyright (c) 2013 Kyle Lutz <kyle.r.lutz@gmail.com>
0003 //
0004 // Distributed under the Boost Software License, Version 1.0
0005 // See accompanying file LICENSE_1_0.txt or copy at
0006 // http://www.boost.org/LICENSE_1_0.txt
0007 //
0008 // See http://boostorg.github.com/compute for more information.
0009 //---------------------------------------------------------------------------//
0010 
0011 #ifndef BOOST_COMPUTE_ITERATOR_DETAIL_GET_BASE_ITERATOR_BUFFER_HPP
0012 #define BOOST_COMPUTE_ITERATOR_DETAIL_GET_BASE_ITERATOR_BUFFER_HPP
0013 
0014 namespace boost {
0015 namespace compute {
0016 namespace detail {
0017 
0018 // returns the buffer for an iterator adaptor's base iterator if
0019 // it exists, otherwise returns a null buffer object.
0020 template<class Iterator>
0021 inline const buffer&
0022 get_base_iterator_buffer(const Iterator &iter,
0023                          typename boost::enable_if<
0024                              is_buffer_iterator<
0025                                  typename Iterator::base_type
0026                              >
0027                          >::type* = 0)
0028 {
0029     return iter.base().get_buffer();
0030 }
0031 
0032 template<class Iterator>
0033 inline const buffer&
0034 get_base_iterator_buffer(const Iterator &iter,
0035                          typename boost::disable_if<
0036                              is_buffer_iterator<
0037                                  typename Iterator::base_type
0038                              >
0039                          >::type* = 0)
0040 {
0041     (void) iter;
0042 
0043     static buffer null_buffer;
0044 
0045     return null_buffer;
0046 }
0047 
0048 } // end detail namespace
0049 } // end compute namespace
0050 } // end boost namespace
0051 
0052 #endif // BOOST_COMPUTE_ITERATOR_DETAIL_GET_BASE_ITERATOR_BUFFER_HPP