Nonstandard allocator::pointer in containers

Paolo Carlini pcarlini@suse.de
Mon May 23 16:25:00 GMT 2005


Hi Phil,

> I may have a look at trying this, but I have a practical question
> first.  I'd like to use this in the next version of anyterm, which
> will ship well before the next version of libstdc++ (like next week). 
> So I'll need to be able to ship the modified container code with the
> Anyterm source.  So, if I change the small number of headers and put
> then in a subdirectory and pass a suitable -I flag, will it "just
> work"?  (Am I right in thinking that all of the code is in the
> headers, or is there stuff in the compiled library as well?)  I'm
> mostly interested in <map>; <string> would be nice but vector<char>
> would be good enough. 

Well, with std::vector you are very lucky, because there are no
instantiations or support code in the compiled library. Likely for this
special use you will find yourself removing anything related to
debug-mode (your vector implementation will always live inside namespace
std::) and concept-checks (not much in std::vector).

I suggest starting from the file std/std_vector.h of the libstdc++-v3
sources and see what's really drag in when you include <vector>.

Paolo.



More information about the Libstdc++ mailing list