forked from boostorg/iterator
Merge branch 'develop'
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#ifndef BOOST_FUNCTION_INPUT_ITERATOR
|
||||
#define BOOST_FUNCTION_INPUT_ITERATOR
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/function_types/is_function_pointer.hpp>
|
||||
@@ -17,6 +18,7 @@
|
||||
#include <boost/iterator/iterator_facade.hpp>
|
||||
#include <boost/none.hpp>
|
||||
#include <boost/optional/optional.hpp>
|
||||
#include <boost/utility/result_of.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
@@ -28,9 +30,9 @@ namespace iterators {
|
||||
class function_input_iterator
|
||||
: public iterator_facade<
|
||||
function_input_iterator<Function, Input>,
|
||||
typename Function::result_type,
|
||||
BOOST_DEDUCED_TYPENAME result_of<Function ()>::type,
|
||||
single_pass_traversal_tag,
|
||||
typename Function::result_type const &
|
||||
BOOST_DEDUCED_TYPENAME result_of<Function ()>::type const &
|
||||
>
|
||||
{
|
||||
public:
|
||||
@@ -46,7 +48,7 @@ namespace iterators {
|
||||
++state;
|
||||
}
|
||||
|
||||
typename Function::result_type const &
|
||||
BOOST_DEDUCED_TYPENAME result_of<Function ()>::type const &
|
||||
dereference() const {
|
||||
return (value ? value : value = (*f)()).get();
|
||||
}
|
||||
@@ -58,7 +60,7 @@ namespace iterators {
|
||||
private:
|
||||
Function * f;
|
||||
Input state;
|
||||
mutable optional<typename Function::result_type> value;
|
||||
mutable optional<BOOST_DEDUCED_TYPENAME result_of<Function ()>::type> value;
|
||||
};
|
||||
|
||||
template <class Function, class Input>
|
||||
|
Reference in New Issue
Block a user