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: Experience with g++ 4.8 and -frepo?


On 27/08/14 14:18 +0200, David Kastrup wrote:
At any rate, I need to tell all compilation units that a specialization
exists, and of course I can only define it in one compilation unit.

So declare it wherever needed (e.g. by putting it in a header):

template <> const char * Smob_base<Grob>::type_p_name;

And define it exactly once:

template <> const char * Smob_base<Grob>::type_p_name = "ly:grob?";


And
I was surprised that the respective incantations appear to exist only
starting with C++11, with GCC providing them in C++98 mode already.
I mean, template specializations are in C++ how long now?  20 years or
so?  How did people manage before C++11?

I assume you're talking about the "extern template" syntax? Every
major compiler implemented that more than a decade ago, it just didn't
make it into a standard until 2011.

But that syntax is for declaring explicit instantiations, not
specializations. What you need is valid in C++98.

At any rate, g++ -frepo appears to get me rid of that inconsistent
specialization problem at the cost of tripping up libstdc++ usage (which
never was problematic without -frepo).  Sometimes I wonder whether I am
the only one using some software...  But maybe -frepo was pretty new in
g++-4.8.

No, -frepo is ancient and bit-rotted and noone uses it now.


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