Boost logo

Boost :

From: Alex Chovanec (chovanec_at_[hidden])
Date: 2004-09-10 11:15:03

"David Abrahams" <dave_at_[hidden]> wrote in message
> Don't you think it's time we generalized the hack into a nice macro
> that generates the right code?

Agreed. That way we could have utilities like these to check for all unary
operators. In fact, I don't see any reason why the same idea couldn't be
applied to binary operators. I would think that the usage would look
something like this:

    DEFINE_UNARY_OPERATOR_TEST(is_dereferenceable, *);

Then you could do



    is_addable<T1, T2>

where the latter expression is true if 't1 + t2' is well-formed, where 't1'
is an instance of 'T1 &' and 't2' is an instance of 'T2 &'.

Is this what you had in mind, or close to it?

Alex Chovanec
NIF and Engineering Division
Computing Applications and Research Department
Lawrence Livermore National Laboratory

Boost list run by bdawes at, gregod at, cpdaniel at, john at