mirror of
https://github.com/boostorg/iterator.git
synced 2025-07-31 13:27:25 +02:00
Switched function_input_iterator to TypeTraits instead of MPL.
This commit is contained in:
@@ -12,7 +12,7 @@
|
|||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
#include <boost/assert.hpp>
|
#include <boost/assert.hpp>
|
||||||
#include <boost/core/addressof.hpp>
|
#include <boost/core/addressof.hpp>
|
||||||
#include <boost/mpl/if.hpp>
|
#include <boost/type_traits/conditional.hpp>
|
||||||
#include <boost/function_types/is_function_pointer.hpp>
|
#include <boost/function_types/is_function_pointer.hpp>
|
||||||
#include <boost/function_types/result_type.hpp>
|
#include <boost/function_types/result_type.hpp>
|
||||||
#include <boost/iterator/iterator_facade.hpp>
|
#include <boost/iterator/iterator_facade.hpp>
|
||||||
@@ -38,7 +38,7 @@ namespace iterators {
|
|||||||
{
|
{
|
||||||
typedef typename result_of<
|
typedef typename result_of<
|
||||||
#ifdef BOOST_RESULT_OF_USE_TR1
|
#ifdef BOOST_RESULT_OF_USE_TR1
|
||||||
typename mpl::if_<is_function<F>, F&, F>::type()
|
typename boost::conditional<is_function<F>::value, F&, F>::type()
|
||||||
#else
|
#else
|
||||||
F&()
|
F&()
|
||||||
#endif
|
#endif
|
||||||
@@ -46,12 +46,12 @@ namespace iterators {
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class Function, class Input>
|
template <class Function, class Input>
|
||||||
class function_input_iterator
|
class function_input_iterator :
|
||||||
: public iterator_facade<
|
public iterator_facade<
|
||||||
function_input_iterator<Function, Input>,
|
function_input_iterator<Function, Input>,
|
||||||
typename result_of_nullary_lvalue_call<Function>::type,
|
typename result_of_nullary_lvalue_call<Function>::type,
|
||||||
single_pass_traversal_tag,
|
single_pass_traversal_tag,
|
||||||
typename result_of_nullary_lvalue_call<Function>::type const &
|
typename result_of_nullary_lvalue_call<Function>::type const &
|
||||||
>
|
>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -83,12 +83,12 @@ namespace iterators {
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class Function, class Input>
|
template <class Function, class Input>
|
||||||
class function_pointer_input_iterator
|
class function_pointer_input_iterator :
|
||||||
: public iterator_facade<
|
public iterator_facade<
|
||||||
function_pointer_input_iterator<Function, Input>,
|
function_pointer_input_iterator<Function, Input>,
|
||||||
typename function_types::result_type<Function>::type,
|
typename function_types::result_type<Function>::type,
|
||||||
single_pass_traversal_tag,
|
single_pass_traversal_tag,
|
||||||
typename function_types::result_type<Function>::type const &
|
typename function_types::result_type<Function>::type const &
|
||||||
>
|
>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -122,15 +122,15 @@ namespace iterators {
|
|||||||
} // namespace impl
|
} // namespace impl
|
||||||
|
|
||||||
template <class Function, class Input>
|
template <class Function, class Input>
|
||||||
class function_input_iterator
|
class function_input_iterator :
|
||||||
: public mpl::if_<
|
public boost::conditional<
|
||||||
function_types::is_function_pointer<Function>,
|
function_types::is_function_pointer<Function>::value,
|
||||||
impl::function_pointer_input_iterator<Function,Input>,
|
impl::function_pointer_input_iterator<Function,Input>,
|
||||||
impl::function_input_iterator<Function,Input>
|
impl::function_input_iterator<Function,Input>
|
||||||
>::type
|
>::type
|
||||||
{
|
{
|
||||||
typedef typename mpl::if_<
|
typedef typename boost::conditional<
|
||||||
function_types::is_function_pointer<Function>,
|
function_types::is_function_pointer<Function>::value,
|
||||||
impl::function_pointer_input_iterator<Function,Input>,
|
impl::function_pointer_input_iterator<Function,Input>,
|
||||||
impl::function_input_iterator<Function,Input>
|
impl::function_input_iterator<Function,Input>
|
||||||
>::type base_type;
|
>::type base_type;
|
||||||
@@ -153,7 +153,8 @@ namespace iterators {
|
|||||||
return result_t(f, state);
|
return result_t(f, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct infinite {
|
struct infinite
|
||||||
|
{
|
||||||
infinite & operator++() { return *this; }
|
infinite & operator++() { return *this; }
|
||||||
infinite & operator++(int) { return *this; }
|
infinite & operator++(int) { return *this; }
|
||||||
bool operator==(infinite &) const { return false; };
|
bool operator==(infinite &) const { return false; };
|
||||||
|
Reference in New Issue
Block a user