Topic: explicit tpl instantiation, and list
Author: Marc Girod <girod@stybba.ntc.nokia.com>
Date: 1998/11/05 Raw View
Hello!
I have a disagreement with my compiler vendor. Could you confirm that
I am right (well, I'd be glad also if you tell me that --and why-- I
am wrong :-)
I compile the following, disabling automatic template instantiation,
and look at some symbols I expect to be produced:
-foo.C--------------------------
#include <list>
struct AA {};
list<AA*> alist;
void rem() { alist.erase(alist.begin()); }
template list<AA*,allocator>::iterator list<AA*,allocator>::erase(
list<AA*,allocator>::iterator,list<AA*,allocator>::iterator);
template void list<AA*,allocator>::deallocate_buffers();
--------------------------------
eti> aCC -c +inst_none foo.C
eti> nm++ -u foo.o | grep AA
list<AA *,allocator>::erase(list<AA *,allocator>::iterator,list<AA *,allocator>::iterator)
list<AA *,allocator>::deallocate_buffers()
eti>
--------------------------------
As it shows, the compiler doesn't produce the symbols explicitly
instantiated!
My vendor further tells me:
EP> The lab unfortunately doesn't agree that the unresolved symbols
EP> in your example used with +inst_none are unexpected. The complete
EP> list class must be instantiated in order for this to work.
I cannot find any reason which would justify this assertion.
Given the explicit instantiations, the behaviour I expect is
guaranteed by the standard, isn't it?
My compiler is HP aCC 1.15, using Rogue Wave implementation of the
standard library.
Best Regards!
Marc
--
Marc Girod Hiomo 5/1 Voice: +358-9-511 23746
Nokia Telecommunications P.O. Box 315 Mobile: +358-40-569 7954
NWS/NMS/NMS for Data 00045 NOKIA Group Fax: +358-9-511 63310
Finland marc.girod@ntc.nokia.com
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]