Boost logo

Boost :

From: Joel de Guzman (joel_at_[hidden])
Date: 2007-04-17 19:09:09


Michael Marcin wrote:
> Michael Marcin wrote:
>> Jody Hagins wrote:
>>> Does that make any sense at all?
>> Maybe.
>>
>> IIUC what that forward declared partial specialization is doing is
>> akin to saying:
>> - I know the default implementation of tag_of can't be correct for
>> boost::array<T,N>
>> - There should be an implementation of tag_of that will make it work
>> for boost::array<T,N>
>> - I don't know what that implementation is, you or someone else better
>> provide it
>>
>> Is it then true that when proper definition of the partial
>> specialization is provided this partial specialization of the
>> declaration has no effect whatsoever?
>>
>> If that is true and this is a compiler bug then perpahs we can use a
>> configuration macro like BOOST_NO_DECLARTION_PARTIAL_SPECIALIZATION to
>> simply omit these these forward declarations on compilers that choke
>> on them (like CW 9.4 apparerently does).
>>
>
> Or maybe I still don't understand. Are these forward declaration partial
> specializations strictly necessary?

Yes. It's a means to prevent unwanted ODR violation. Fusion is modular.
The support for boost::array comes when you include a header. Imagine
a case where a TU does not include the header and another that does.
Without the forward declaration, the second TU will pick up the
default (non-specialized) implementation, which might or might not
compile, but will certainly be a violation of ODR.

Regards,

-- 
Joel de Guzman
http://www.boost-consulting.com
http://spirit.sf.net

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