Boost logo

Boost :

From: William Ward (william.ward_at_[hidden])
Date: 2000-12-19 09:00:50


----- Original Message -----
From: "David Abrahams" <abrahams_at_[hidden]>
>
> ----- Original Message -----
> From: "William Ward" <william.ward_at_[hidden]>
>
> > i've tried the explicit instantiation workaround, but i cannot get it
> > working for template classes,
> > i think this workaround is only for non template clases
>
> That's correct, sorry.
>
> Do you know if the object size increases with /any/ use of the operator
> templates, or is it only a specific template that's causing the increase?

The object size inceases for any one of the operator templates, even if
i inherit from just one of the operator templates, i think any
inheritence in GCC will cause an increase in size.

>
> I find it curious that there's any increase at all in this case...
>
> Here's a shot-in-the-dark workaround. I have no idea if it's even really
> legal C++:
>
> tempate< int X>
> class Test
> {
> struct GenerateOps
> : boost::less_than_comparable1<Test<X>
> , boost::equality_comparable<Test<X>
> , boost::addable<Test<X>
> , boost::subtractable<Test<X>
> , boost::multipliable<Test<X>
> , boost::dividable<Test<X>
> > > > > > > {};
> static GenerateOps;
> .....
> };
>

I tried the workaround, it does prevent the size bloat
but it cannot recognise the operators in Test, e.g even though += is
defined, this workaround
will give the error that there is no + operator defined if + is called
in the application.


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