This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: std::ext STL (was: Re: design doc on alternative pointer support)
"Paolo Carlini" <paolo.carlini@oracle.com> wrote in message
48A8D273.3010802@oracle.com">news:48A8D273.3010802@oracle.com...
> 1- The new Standard is nearing completion. By now C++0x(1x) is considered
> feature complete and the committee is sorting out the last issues and
> defects. In particular, there are already quite a few changes in the
> allocator chapter: you may want to double check that everything suits your
> needs and / or decide to live with the features actually available...
I just shared my experience and we'll see the options in a day or two. It's
an interesting situation and I am happy to share this before everything gets
standardized (on the C++0x side) because the special allocator I am using is
necessary to have a decent memory management. (1)
> 2- As regards libstdc++v3, that is the current library, implementing, as
> experimental, a selection of C++0x features, the allocators are still the
> C++98 ones, and, anyway, I think it would be nice to deliver support for
> "extended" pointers also to the users of the C++98 library. In any case I
> would recommend decoupling as much as possible changes to the allocators
> and changes to the containers to support "extended" pointers, even if that
> means (temporarily) suboptimal performance.
My allocator is basically made only for my own smart pointer support and
wouldn't make sense using for different purposes. The non-const reference
change is perfectly transparent and is not going to break anything.
Regards,
-Phil
(1) Not using the shifted_allocator<...> on a vector< shifted_ptr<...> >
means:
If I share the pool used by the containers thru the allocator and the one
used by the smart pointer then my algorithm will share the same "set"
counter used internally. If not then I will have an extra "set" counter
allocated for each smart pointer residing on a node. I don't want to go
deeper in details but this is roughly what happens.