Boost logo

Boost :

From: Joe Gottman (joegottman_at_[hidden])
Date: 2000-05-26 23:11:04


----- Original Message -----
From: Darin Adler <darin_at_[hidden]>
To: Boost <boost_at_[hidden]>
Sent: Friday, May 26, 2000 10:21 PM
Subject: Re: [boost] A class for exchanging parameters

> > Here is a class that does just that. It simply takes a binary predicate
and
> > exchanges the order of the parameters. Please tell me what you think.
>
> I think this is useful and nicely done.
>
> Is it possible, using traits, to make an implementation that would work
with
> a function and not just a function object? If so, that's a useful
> improvement.
>
> Other minor comments:
> I'm not sure what value the default constructor has.
> No need for a semicolon after {} in the constructor definitions.
>
> -- Darin

    I'm not sure about traits. The reason I included a default parameter is
to make it easier to use with associative containers. For instance

struct CaseInsensitiveLess {
          bool operator()(const string &lhs, const string &rhs);
}

std::set<string, exchange_parameters_t<CaseInsensitiveLess> > ciSet;

In order for this code to compile, exchange_parameters_t needs to have a
default constructor.


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