|
Boost : |
From: Jim Argeropoulos (jaa_at_[hidden])
Date: 2000-01-16 15:49:46
> This is the fault of the definition of
> logical_and/logical_not. Actually, most of std functors have this
> problem, I agree it is annoying. Perhaps the thing to do is create
> versions of the std functors that allow the operands to be different
> types.
OK, I played with this and short of putting a "new" version in the boost
namespace, the compiler won't take it.
But here is my real reason for writing.
With the file I proposed I can make the following typedef for a set of
Person sorted by three attributes.
typedef set < Person* , GreaterMemberFunc < Person , long , string , string
> > PersonSet ;
If I proceede and make my to use a new definition of boost::logical_or it is
going to look something like
typedef set < Person* , compose_f_gx_hy_t < boost::logical_or <
compose_f_gx_hy_t < less < long > , const_mem_func_t <
Well I'll quit there. It is going to be a mess that I don't ever want to
type out. I tried thinking out some typedef magic that could help, but I
gave up.
While I like the cool reusableness of the concept. It seems like it fails in
the above example.
Any suggestions on typedef magic that could help?
Jim
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk