Boost logo

Boost :

From: Robert Kawulak (kawulak_at_[hidden])
Date: 2007-08-22 10:53:15


> From: Robert Kawulak

> struct is_even {
> bool operator () (int i) const
> { return (i % 2) == 0; }
> } is_even_fn;

Actually, this could even be

        bool is_even_fn(int i)
        { return (i % 2) == 0; }

> constrained< int, boost::function1<bool, int> >
> c(is_even_fn);

Now I'm thinking about making boost::function1 the default parameter of
constrained, so you could just write

        constrained<int> c(is_even_fn);

Looks good, doesn't it: :D

Best regards,
Robert


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