From: Aleksey Gurtovoy (alexy_at_[hidden])
Date: 2000-04-30 03:49:21
Dave Abrahams <abrahams_at_[hidden]> wrote:
> I think one upshot of this technique, though, is that the use of partial
> specialization for 2-type versions of some operator templates, such as
> equality_comparable, must finally die (or at least lose backward
> compatibility) in favor of the versions with "2" at the end of the name. I
> don't see any way around this. If you do, please speak up!
Dave, I've tried to play a little with the problem and that play turned out
into a new version of 'boost/operators.hpp', which implements the suggested
technique and still has backward compatibility with old code. It's not
perfect and there are some parts of the code which probably need to be
reworked, but in whole it may serve the needs. MW CW 5.3 and KAI C++ 3.3 for
NT seem to be quite happy with the new version (at least they compile and
run 'operators_test.cpp' without any error).
And now on my platform sizeof(MyInt) == 4 :).
(MyInt is a int wrapper class from 'operators_test.cpp'.)
A short note about one of the issues for discussion - I've added
'<operation_name>able1' counterparts to already existed
'<operation_name>able2' class templates' names. It was just a refactoring in
order to improve the code, and I am almost sure that these auxiliary classes
must be hidden, probably in 'detail' namespace. What do you think?
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk