|
Boost : |
Subject: Re: [boost] Proposal: Monotonic Containers
From: Christian Schladetsch (christian.schladetsch_at_[hidden])
Date: 2009-06-10 00:27:55
Hi Artyom,
[snip] ...because it shadows template parameter P.
Fixed.
> b) Fix in ./boost/monotonic/storage_base.h
> Add #include <boost/cstdint.hpp>
Fixed.
>
> 3rd... Your allocator is not correct you do not align the pointers
> as required by most of architectures. You need to provide
> 8-16 bytes alignment... According to system
I will think more about this. My initial impression was that "I am not doing
any allocation, so I do not need to do any alignment". However, I am
returning pointers to objects (even if those pointers are all in a static
buffer) and yes they should be aligned.
>
> 4th... Why don't you use boost::pool? It is debugged and tested
> instead of writing new implementation?
boost::pool does not provide a means to use STL with stack-based memory.
>
> 5th... Implement ALL constructors of each container. For example
> I can call.
> std::string str="Foo";
> std::vector<int> v(str.begin(),str.end());
> this is not supported
Yes, I have not fully implemented all the various ctor overloads for the
various containers.
Each of them simply needs to take the extra argument of the storage (or the
allocator). I will add them.
>
> 6th... This is bad idea to derive from std containers. They to do not
> provide virtual destructors. This may be very error prone.
I agree that it is generally a bad idea to derive from std containers.
However, it seems that one would have to purposefully write pathological
code in order for this to be a problem in this case.
Using inheritance means that existing code that pattern-matches against the
std::containers, will also pattern-match against monotonic::containers.
> This is just short glance.
>
> Artyom
Thanks a lot for your help and suggestions. I'll consider more about
alignment issues.
Regards,
Christian.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk