From 6b08a81d3ef87e5e357c625ba26dfcec39308acf Mon Sep 17 00:00:00 2001 From: bolero-MURAKAMI Date: Sun, 2 Dec 2012 18:16:10 +0900 Subject: [PATCH] fix transformed --- sprout/iterator/transform_iterator.hpp | 12 ++++++------ sprout/range/adaptor/transformed.hpp | 16 ++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/sprout/iterator/transform_iterator.hpp b/sprout/iterator/transform_iterator.hpp index b67d7a5b..3e8e532b 100644 --- a/sprout/iterator/transform_iterator.hpp +++ b/sprout/iterator/transform_iterator.hpp @@ -61,7 +61,7 @@ namespace sprout { protected: iterator_type current; iterator2_type current2; - functor_type func; + BinaryFunction func; public: transform_iterator() = default; transform_iterator(transform_iterator const&) = default; @@ -69,7 +69,7 @@ namespace sprout { : current(it) , current2(it2) {} - SPROUT_CONSTEXPR transform_iterator(iterator_type it, iterator2_type it2, functor_type func) + SPROUT_CONSTEXPR transform_iterator(iterator_type it, iterator2_type it2, BinaryFunction func) : current(it) , current2(it2) , func(func) @@ -92,7 +92,7 @@ namespace sprout { SPROUT_CONSTEXPR iterator_type base2() const { return current2; } - SPROUT_CONSTEXPR functor_type functor() const { + SPROUT_CONSTEXPR BinaryFunction functor() const { return func; } SPROUT_CONSTEXPR reference operator*() const { @@ -196,14 +196,14 @@ namespace sprout { typedef value_type* pointer; protected: iterator_type current; - functor_type func; + UnaryFunction func; public: transform_iterator() = default; transform_iterator(transform_iterator const&) = default; explicit SPROUT_CONSTEXPR transform_iterator(iterator_type it) : current(it) {} - SPROUT_CONSTEXPR transform_iterator(iterator_type it, functor_type func) + SPROUT_CONSTEXPR transform_iterator(iterator_type it, UnaryFunction func) : current(it) , func(func) {} @@ -221,7 +221,7 @@ namespace sprout { SPROUT_CONSTEXPR iterator_type base() const { return current; } - SPROUT_CONSTEXPR functor_type functor() const { + SPROUT_CONSTEXPR UnaryFunction functor() const { return func; } SPROUT_CONSTEXPR reference operator*() const { diff --git a/sprout/range/adaptor/transformed.hpp b/sprout/range/adaptor/transformed.hpp index fc475419..dfdcb5a6 100644 --- a/sprout/range/adaptor/transformed.hpp +++ b/sprout/range/adaptor/transformed.hpp @@ -46,7 +46,7 @@ namespace sprout { public: transformed_range() = default; transformed_range(transformed_range const&) = default; - SPROUT_CONSTEXPR transformed_range(functor_type func, range1_type& range1, range2_type& range2) + SPROUT_CONSTEXPR transformed_range(BinaryFunction func, range1_type& range1, range2_type& range2) : base_type( iterator(sprout::begin(range1), sprout::begin(range2), func), iterator(sprout::end(range1), sprout::end(range2), func) @@ -78,7 +78,7 @@ namespace sprout { public: transformed_range() = default; transformed_range(transformed_range const&) = default; - SPROUT_CONSTEXPR transformed_range(functor_type func, range1_type& range) + SPROUT_CONSTEXPR transformed_range(UnaryFunction func, range1_type& range) : base_type( iterator(sprout::begin(range), func), iterator(sprout::end(range), func) @@ -95,16 +95,16 @@ namespace sprout { typedef BinaryFunction functor_type; typedef RRange range2_type; private: - functor_type func_; + BinaryFunction func_; sprout::value_holder range_; public: transform_holder() = default; transform_holder(transform_holder const&) = default; - SPROUT_CONSTEXPR transform_holder(functor_type func, range2_type& range) + SPROUT_CONSTEXPR transform_holder(BinaryFunction func, range2_type& range) : func_(func) , range_(range) {} - SPROUT_CONSTEXPR functor_type functor() const { + SPROUT_CONSTEXPR BinaryFunction functor() const { return func_; } SPROUT_CONSTEXPR range2_type& range() const { @@ -116,14 +116,14 @@ namespace sprout { public: typedef UnaryFunction functor_type; private: - functor_type func_; + UnaryFunction func_; public: transform_holder() = default; transform_holder(transform_holder const&) = default; - explicit SPROUT_CONSTEXPR transform_holder(functor_type func) + explicit SPROUT_CONSTEXPR transform_holder(UnaryFunction func) : func_(func) {} - SPROUT_CONSTEXPR functor_type functor() const { + SPROUT_CONSTEXPR UnaryFunction functor() const { return func_; } };