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: Memory, Allocator<T> & __USE_MALLOC & alternatives


First, thanks to Phil and everyone else for their suggestions.

> typedef std::basic_string<char, char_traits<char>, allocator<char> > 
> MyString;
>
> in your code, use MyString everywhere, and then go back and tweak the
> third parameter as necessary.

OK, that seems workable, but is this basic_string ISO standard C++? 

There's a distinct lack of ISO standards documentation for the std C++ 
libraries floating around the net - anybody got a handy URL? - so I can find 
out what I functionality I can rely on?

> std::priority_queue takes a (default) parameter specifying the underlying
> container; it doesn't handle the memory itself.  The underlying container,
> say, vector, takes an allocator parameter.

Sorry my mistake, I'm getting my issues confused here, I tried this a while 
ago and found that std::priority_queue can be convinced to use a non-standard 
allocator, but because it lacked a constructor capable of taking a instance 
of that allocator, it could not be used with non-static (i.e. instanced) 
allocators. 

Not a problem for this issue, since I don't need a non-static allocator to 
fix my current troubles. Thanks for clarifing this.

Regards,
Tony.


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