Boost logo

Boost :

Subject: Re: [boost] [endian] superfluous boost::operators<> ?
From: Beman Dawes (bdawes_at_[hidden])
Date: 2009-03-26 18:04:16


Roland Schwarz wrote:
> I discovered, that the following will not compile:
>
> unsigned u;
> ulittle32_t u1;
> ulittle32_t u2;
>
> u = 1;
> u1 = 1;
> u2 = u1 + u;
>
> The compiler complains about not being able to resolve
> similar conversions.
>
> My guess is, that using boost::operators<> _and_
> providing type conversion operators at the same time
> is causing this.
>
> I think it should be enough to define the essential
> operators in cover_operators template, and omit
> boost::operators<> at all.
>
> At least I am not able to find any problems with this,
> since the compiler adjusts the arguments (using the
> provided type conversion operators?) and calls the built in
> operators, thereby resolving ambiguity.
>
> Any thoughts?

This has been fixed, and a new test program added that probes for this
specific test cases as well as interactions between types.

Thanks,

--Beman

PS: I'm working back through old discussions to make sure concerns were
addressed one way or the other.


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