This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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] |
/Stefan
-- Military intelligence is a contradiction in terms.
--- Begin Message ---Hi!
- From: Stefan Olsson <stefan at noname4us dot com>
- To: libstdc++ at gcc dot gnu dot org
- Date: Fri, 16 Nov 2001 17:26:02 +0100
- Subject: Calling an allocator destroy?
- Organization: Noname4us
We have created a class that has the following outline (all methods are omitted here):
typedef std::__allocator<char, std::pthread_alloc> std_char_pthread_alloc;
typedef std::basic_string< char, std::char_traits<char>, std_char_pthread_alloc > std_pthread_basic_string;
class pthread_string : public std_pthread_basic_string
{
public:
pthread_string() throw(): std_pthread_basic_string()
{
}
}Why? Because we need some containers to use the pthread_allocator and some the default (global one) in a multithreaded enviorment.
The question:
How do we write a destructor for this class? We are thinking in the terms of:~pthread_string()
{
this->get_allocator().destroy( XXX );
}But the question is how to call the destroy method correctly?
Thanks in advance!
/Stefan
-- Military intelligence is a contradiction in terms.--- End Message ---
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |