Boost logo

Boost :

From: Daniel Frey (daniel.frey_at_[hidden])
Date: 2002-07-25 10:50:53


Peter Dimov wrote:
>
> From: "Daniel Frey" <daniel.frey_at_[hidden]>
> > Peter Dimov wrote:
> > >
> > Can't we assume it's a binary function and use 'Comparator< R
> > >::result_type'?
>
> Oh yes, but I was talking about element's return type. Which is
>
> boost::_bi::bind_t<boost::_bi::unspecified, Comparator<R>,
> boost::_bi::list2<boost::_bi::bind_t<R, boost::_mfi::dm<R, T>,
> boost::_bi::list1<boost::arg<1> > >, boost::_bi::bind_t<R,
> boost::_mfi::dm<R, T>, boost::_bi::list1<boost::arg<1> > > > >
>
> :-)

Yep, I noticed it (see my other post some minutes before yours :)

> That aside, most compilers frown at
>
> element<std::less>(&person::firstname)
>
> anyway. Bleeding edge business.
>
> element(std::less<std::string>(), &person::firstname)
>
> is the syntax that has a chance to work.

Which is also better as the comparator might contain a state, now that
it is passed as an object instead of a type. From time to time I need
this, e.g. I wrote a divide-functor that has a default value for
division-by-zero.

Regards, Daniel

--
Daniel Frey
aixigo AG - financial training, research and technology
Schloß-Rahe-Straße 15, 52072 Aachen, Germany
fon: +49 (0)241 936737-42, fax: +49 (0)241 936737-99
eMail: daniel.frey_at_[hidden], web: http://www.aixigo.de

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