This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: More test results...


Jason Merrill <jason@redhat.com> writes:

| >>>>> "Gabriel" == Gabriel Dos Reis <gdr@codesourcery.com> writes:
| 
| > Jason Merrill <jason@redhat.com> writes:
| > | >>>>> "Gabriel" == Gabriel Dos Reis <gdr@codesourcery.com> writes:
| > | 
| > | > While your example is well-formed, I don't think it scales to
| > | > numeric_limits<>.  Here is why:  The standard doesn't say whether
| > | > numeric_limits<> is exported or not.  In case an implementation
| > | > exported it, explicitly specializing individual members may violate
| > | > the ODR.  Therefore, any program playing that games is inherently
| > | > non-portable. 
| > | 
| > | What does export have to do with it?  The standard requires that a
| > | declaration of an explicit specialization be seen at any point of
| > | instantiation. 
| 
| > Even for explicit specialization of exported static data members?
| 
| Yes.  Why would that make a difference?
| 
|   14.7.3  Explicit specialization                       [temp.expl.spec]
| 
| 6 If  a template, a member template or the member of a class template is
|   explicitly specialized then  that  specialization  shall  be  declared
|   before  the  first  use  of  that  specialization  that would cause an
|   implicit instantiation to take place, in  every  translation  unit  in
|   which  such  a  use occurs; no diagnostic is required.

Thanks for the quote.

Why I thought that would make any difference?  Because, my mental
model of export is that it inhibits multiple definitions.  
Now I realize that explicit specialization is much more than "just
provide alternate definition" for a generic thingy.  

Now, you have provided more than convincing arguments about your worries.

Thanks.

-- Gaby


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]