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: [v3]libstdc++/13631


On 12/13/2010 11:11 PM, Paolo Carlini wrote:

The issue is that the entire *.so is built with no implicit templates, thus the error, because during the build the implicit instantiation of a template (required elsewhere in the *.so) is suppressed. In general, we have explicit instantiation *.cc files in /src for that reason. Anyway, I'm indeed quite dubious that the way to go is using<map> as an implementation detail, it would be the first time we do something similar. But if we can find a way to have such uses in a *.cc file, and then export from the *.so only functions using it behind the scenes, it would still make sense...

Paolo.
Thanks for the tip, indeed with the explicit instantiation it works. Here is attached what I came to.

I agree that explicitly instantiating the map and associated _Rb_tree might be too much but I hope that optimization will only keep what is really used. Just tell me if you prefer I introduce some kind of hand written map equivalent.

The only problem left is in the usage of __gnu_cxx::__mutex:

messages_members.cc:73:7: error: ‘__mutex’ in namespace ‘__gnu_cxx’ does not name a type
messages_members.cc: In member function ‘{anonymous}::Catalogs::catalog {anonymous}::Catalogs::_M_add(const string&)’:
messages_members.cc:52:2: error: ‘__scoped_lock’ is not a member of ‘__gnu_cxx’
messages_members.cc:52:27: error: expected ‘;’ before ‘lock’


I though __mutex was a compiler intrinsic but it is not or I need to add some compilation option to make it available. I already try to add -std=gnu++0x with no success. What is needed to use __mutex ?

François

Attachment: messages_members.patch
Description: Text document


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