do allocators have to be stateless?
- From: "Jack Hanebach" <jhanebach@xxxxxxxxxxxxxxxxxx>
- Date: Mon, 31 Jul 2006 08:10:49 -0700
--
Is there a requirement for allocator to be stateless?
I need a std::set that will throw an exception when it's size reaches
some (run-time determined) size. Thought it would be just a simple
matter of providing allocator tracking how many items are already
allocated and throwing when the max is reached .
Unfortunately, the exception is being thrown from the default std::set
constructor, and allocator seems to be uninitialized... :(
The allocator in question is a copy of Josuttis's example with
current_size and max_size members added. Of course, they are
initialized in a constructor, which apparently is not being called.
Any thoughts?
.
- Follow-Ups:
- Re: do allocators have to be stateless?
- From: william schilp
- Re: do allocators have to be stateless?
- From: Tom Widmer [VC++ MVP]
- Re: do allocators have to be stateless?
- From: Doug Harrison [MVP]
- Re: do allocators have to be stateless?
- Prev by Date: Re: GOF - Decorator and STL::Vector
- Next by Date: Re: do allocators have to be stateless?
- Previous by thread: Bug in std::lower_bound (VS2005/Debug)?
- Next by thread: Re: do allocators have to be stateless?
- Index(es):
Relevant Pages
|
Loading