
Jeffrey Lee Hellrung, Jr. <jeffrey.hellrung <at> gmail.com> writes:
While transforming and filtering sequences, it's pretty common to call the elements' member functions, so I think it's worth adding some syntactic sugar for range adaptors in order to achieve cleaner syntax.
foo_list | transformed(&Foo::description) | filtered(&std::string::size)
It doesn't seem all that onerous to insert a boost::mem_fn [1] in there (i.e., "transformed(boost::mem_fn(&Foo:::description))")...or does this not work?
Hi Jeff, Of course this works, as well as STL iterator-based loops versus BOOST_FOREACH. As I said, this is just a syntactic sugar that makes the code cleaner, and it does this for quite a frequent case when you call element's member function. Thanks, Maxim