|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2004-08-05 11:52:24
Jonathan Wakely <cow_at_[hidden]> writes:
> On Thu, Aug 05, 2004 at 09:48:32AM -0600, David Abrahams wrote:
>
>> > What I'll do anyway is to disable this workaround test for all
>> > compilers that support partial specialization.
>>
>> I'm still highly suspicious that something is wrong whether or not
>> the test is enabled. What could cause that code to be compiled by
>> CW?
>
> I think it's line 19 in libs/range/test/partial_workaround.cpp, which
> says:
>
> #define BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION 1
>
> for all compilers, unconditionally.
>
> This causes a few failures for GCC 3.4, because it takes code paths
> that aren't meant for it.
Well, that's just wrong.
The right way to handle this is to write:
#if BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
// the test code you have now
#else
// something simple that always passes.
#endif
As an optimization you can mark the test not to be run on most
compilers.
-- Dave Abrahams Boost Consulting http://www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk