From: Martin Sebor от имени Martin Sebor Sent: Tue, 22.01.2008 18:20 To: [email protected] Subject: Re: [PATCH] remove explicit casting to void* when calling allocator<>::allocate(size, pointer)
>> The second parameter type is const_pointer, not >> malloc_allocator<void>::const_pointer. >> As a result these tests are failed with the error: > Are you sure that the allocator is correct? No. And I'll make the corresponding ticket in boost trac, but it's easier to fix problem at our side (if it's possible) than wait until somebody from boost team fixes the problem in boost. Another reason is succeeding of the such tests compiled with other STL's. [...] > IIRC, the cast to void* is there to make user-defined pointers work > but I don't think it's correct either. I can't think of any way to > solve this than to make allocate a template for allocators with > user-defined pointers: But why in the list and tree classes explicit cast is used? Implicit cast to const void* should work. Hint version of allocate() is also used in deque and vector, but without explicit cast to void*. > There's a test (20_allocator, I think) that we haven't migrated to > svn yet that exercises containers with allocators with user-defined > pointers. You might want to make sure it compiles with the changes > you're proposing. Of course. Farid.
