|
Boost : |
From: Tobias Schwinger (tschwinger_at_[hidden])
Date: 2007-07-21 18:28:03
Johan Torp wrote:
> I ran across a similar problem when I implemented my observable_value
> suggestion (http://lists.boost.org/Archives/boost/2007/06/123263.php) and
> wanted to write a generic operator<T>= for all operators (+=, /=, %= and so
> on).
>
> The problem with operators of built-in types seems a bit related to those of
> constructors; you can't treat them as ordinary function pointers.
>
> It'd be great if this proposed library could solve this "operator problem"
> too. IMHO, a solution to the operator problem is not near as important but
> if there is a general and not much more complicated solution to both, it
> would be great.
That would be something like
DEFINE_FUNCTION_OBJECT_FOR_EXPRESSION(assign_op, 2, _1 += 2);
and it's indeed implementable with C++0x.
Regards,
Tobias
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk