Boost logo

Boost :

From: Daniel Frey (daniel.frey_at_[hidden])
Date: 2002-07-25 09:18:35


Peter Dimov wrote:
>
> The bind equivalent to less_element is
>
> bind(less<std::string>(), bind(&person::firstname, _1),
> bind(&person::firstname, _1))
>
> which is sufficiently complex to be impractical.
>
> You could make a helper
>
> template<template<class> class Comparator, class R, class T>
> {insert return type here} element(R T::* pm)
> {
> return bind(Comparator<R>(), bind(pm, _1), bind(pm, _1));
> }
>
> where the return type is something incomprehensible (where's typeof when we
> need it?).

Can't we assume it's a binary function and use 'Comparator< R
>::result_type'?

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