Boost logo

Boost :

From: Steve Clamage (Stephen.Clamage_at_[hidden])
Date: 2005-07-06 16:22:21


I found the relevent citation, with a little help from my friends.

14.6.4.2 "Candidate functions" says that for an unqualified function call that
depends on a template parameter, only functions with external linkage are
considered.

---
Steve Clamage, stephen.clamage_at_[hidden]
Robert Ramey wrote:
> I have a sneaking feeling I might be a priniciple culprit here.
> 
> Steve Clamage wrote:
> 
>>You can't use a static template in a global template function because
>>it violates the One-Definition Rule, among possibly other rules.
> 
> 
> Could you expand upon this a little more?  I don't see the ODR violation or
> other rule violation.
> 
> 
>>I have found that other compilers accept this code, but reject it when
>>you put them in standard-conformning mode. (To see the rejection with
>>some compilers, you need to build the executable.)
> 
> 
>>How critical to BOOST is this style of coding? Could the static
>>templates be made global?
> 
> 
> Generally we aspire to make our code conform to the standard.  If its not,
> then we're interested in changing it so it is.  Having said that, It's often
> very difficult to figure out what the standard means.  Of course the fact
> that different compilers behave differently also makes it hard.
> 
> Of course if you want to make your compiler available to library writers at
> a reasonable cost (i.e. free) you might manage to shift some work on to us.
> 
> Robert Ramey
> 

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