mirror of
https://github.com/boostorg/iterator.git
synced 2025-07-25 18:37:19 +02:00
@ -42,13 +42,11 @@ namespace boost
|
|||||||
struct transform_iterator_base
|
struct transform_iterator_base
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
typedef typename std::iterator_traits<Iterator>::reference Arg1;
|
|
||||||
|
|
||||||
// By default, dereferencing the iterator yields the same as
|
// By default, dereferencing the iterator yields the same as
|
||||||
// the function.
|
// the function.
|
||||||
typedef typename ia_dflt_help<
|
typedef typename ia_dflt_help<
|
||||||
Reference
|
Reference
|
||||||
, result_of<UnaryFunc(typename std::iterator_traits<Iterator>::value_type)>
|
, result_of<UnaryFunc(typename std::iterator_traits<Iterator>::reference)>
|
||||||
>::type reference;
|
>::type reference;
|
||||||
|
|
||||||
// To get the default for Value: remove any reference on the
|
// To get the default for Value: remove any reference on the
|
||||||
|
@ -106,11 +106,12 @@ struct polymorphic_mult_functor
|
|||||||
{
|
{
|
||||||
//Implement result_of protocol
|
//Implement result_of protocol
|
||||||
template <class FArgs> struct result;
|
template <class FArgs> struct result;
|
||||||
template <class F, class T> struct result<F(T)> {typedef T type;};
|
template <class F, class T> struct result<F(T )> {typedef T type;};
|
||||||
|
template <class F, class T> struct result<F(T& )> {typedef T type;};
|
||||||
|
template <class F, class T> struct result<F(const T&)> {typedef T type;};
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
typename result<polymorphic_mult_functor(T)>::type
|
T operator()(const T& _arg) const {return _arg*2;}
|
||||||
operator()(const T& _arg) const {return _arg*2;}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
int
|
int
|
||||||
|
Reference in New Issue
Block a user