mirror of
https://github.com/boostorg/iterator.git
synced 2025-05-11 13:33:56 +00:00
Switched function_input_iterator to TypeTraits instead of MPL.
This commit is contained in:
parent
eb0d01126a
commit
c901bd6d7a
@ -12,7 +12,7 @@
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/assert.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/result_type.hpp>
|
||||
#include <boost/iterator/iterator_facade.hpp>
|
||||
@ -38,7 +38,7 @@ namespace iterators {
|
||||
{
|
||||
typedef typename result_of<
|
||||
#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
|
||||
F&()
|
||||
#endif
|
||||
@ -46,12 +46,12 @@ namespace iterators {
|
||||
};
|
||||
|
||||
template <class Function, class Input>
|
||||
class function_input_iterator
|
||||
: public iterator_facade<
|
||||
function_input_iterator<Function, Input>,
|
||||
typename result_of_nullary_lvalue_call<Function>::type,
|
||||
single_pass_traversal_tag,
|
||||
typename result_of_nullary_lvalue_call<Function>::type const &
|
||||
class function_input_iterator :
|
||||
public iterator_facade<
|
||||
function_input_iterator<Function, Input>,
|
||||
typename result_of_nullary_lvalue_call<Function>::type,
|
||||
single_pass_traversal_tag,
|
||||
typename result_of_nullary_lvalue_call<Function>::type const &
|
||||
>
|
||||
{
|
||||
public:
|
||||
@ -83,12 +83,12 @@ namespace iterators {
|
||||
};
|
||||
|
||||
template <class Function, class Input>
|
||||
class function_pointer_input_iterator
|
||||
: public iterator_facade<
|
||||
function_pointer_input_iterator<Function, Input>,
|
||||
typename function_types::result_type<Function>::type,
|
||||
single_pass_traversal_tag,
|
||||
typename function_types::result_type<Function>::type const &
|
||||
class function_pointer_input_iterator :
|
||||
public iterator_facade<
|
||||
function_pointer_input_iterator<Function, Input>,
|
||||
typename function_types::result_type<Function>::type,
|
||||
single_pass_traversal_tag,
|
||||
typename function_types::result_type<Function>::type const &
|
||||
>
|
||||
{
|
||||
public:
|
||||
@ -122,15 +122,15 @@ namespace iterators {
|
||||
} // namespace impl
|
||||
|
||||
template <class Function, class Input>
|
||||
class function_input_iterator
|
||||
: public mpl::if_<
|
||||
function_types::is_function_pointer<Function>,
|
||||
class function_input_iterator :
|
||||
public boost::conditional<
|
||||
function_types::is_function_pointer<Function>::value,
|
||||
impl::function_pointer_input_iterator<Function,Input>,
|
||||
impl::function_input_iterator<Function,Input>
|
||||
>::type
|
||||
{
|
||||
typedef typename mpl::if_<
|
||||
function_types::is_function_pointer<Function>,
|
||||
typedef typename boost::conditional<
|
||||
function_types::is_function_pointer<Function>::value,
|
||||
impl::function_pointer_input_iterator<Function,Input>,
|
||||
impl::function_input_iterator<Function,Input>
|
||||
>::type base_type;
|
||||
@ -153,7 +153,8 @@ namespace iterators {
|
||||
return result_t(f, state);
|
||||
}
|
||||
|
||||
struct infinite {
|
||||
struct infinite
|
||||
{
|
||||
infinite & operator++() { return *this; }
|
||||
infinite & operator++(int) { return *this; }
|
||||
bool operator==(infinite &) const { return false; };
|
||||
|
Loading…
x
Reference in New Issue
Block a user