In article <A194A82A1A084C4C8A29AD16E363B5F8FCDE36@WIN2003s325.its.local>, "Patrick Loney" <Patrick.Loney@InteractiveTS.com> wrote:
struct f : public std::unary_function<int, int&> { int operator()(int& x) { return x; } };
No, nor does struct f : public std::unary_function<int, int> { int operator()(int x) { return x; } }; or struct f { typedef int& result_type; result_type operator()(int& x) { return x; } }; The compiler complains upon dereferencing. But my goal is to be able to modify the iterator's value (i.e., to write *it = value), so the return type of the function object must be a reference. Maybe, I can use iterator_adaptor instead of transform_iterator? I have forgotten to mention that I am using Boost 1.34.1. Nicola