Boost logo

Boost :

From: Brian McNamara (lorgon_at_[hidden])
Date: 2004-02-20 14:01:14


On Fri, Feb 20, 2004 at 04:35:55AM -0500, Gennadiy Rozental wrote:
> I do not think we understand each other. Let me rephrase. My position is
> that polymorphic function object support does not belong to the library
> dedicated to "functional programming", even though I propose to update
> boost/functional.hpp header

Oh, I see. Yes, I agree. This is a generally useful feature; one not
limited just to functional programming.

I dunno if/what the plans are for a Boost "result_of" implementation
(Doug?), but that will be the keystone library component to this end, I
think.

> > It may also be attractive to OO people, who have gotten into the
> > now-fashionable habit of avoiding member functions. Switching from
> > the member notation
> >
> > Shape s; Point p;
> > if( s.contains(p) ) ...
> >
> > to the non-member notation
> >
> > if( contains(s,p) ) ...
> >
> > loses the subject-verb-object order; using function objects that support
> > infix, however, lets you say
> >
> > if( s ^contains^ p ) ...
> >
> > which some people may find attractive.
>
> And some really confusing. Moreover in a user code, above most probably
> would look like if( s ^ boost::fcpp::contains ^ p ).

No; contains() in this example is a function the author of Shape would
be writing. That is, it's a function you write in your own namespace.

> Also it only look pretty for binary functoids. In any case I believe
> that if you do find it widely useful and could "prove" that, this should
> be the feature also implemented by boost::function.

Agreed on both points.

-- 
-Brian McNamara (lorgon_at_[hidden])

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk