[asio] STLPort and std::vector<const Pod_Type>

Hi, STLPort doesnt seem to allow const-types as parameters to std::vector. It chokes in the std::allocator which define const_reference as const reference, making the two the same type. This creates multiple declarations for function-members: pointer address(reference __x) const { return &__x; } const_pointer address(const_reference __x) const { return &__x; } Is the STLPort right in this context or should something be done? This is making this code fails: std::vector<char> v(128); boost::asio::buffer(v); The problem is that even with non-const pod type boost::asio::buffer is instatiating std::vector<const char>. Thanks, -- Felipe Magno de Almeida

Forgot to mention that I'm using VC7.1, boost CVS, asio 0.3.6 and STLPort 4.6.2 -- Felipe Magno de Almeida

On Thursday 23 March 2006 21:22, Felipe Magno de Almeida wrote:
Forgot to mention that I'm using VC7.1, boost CVS, asio 0.3.6 and STLPort 4.6.2
STLport 4.6.2 is pretty old, has not the best VC7.1 support and is considered a bad release (i.e. you should prefer 4.5.3 over 4.6, though that one doesn't have ). If you want to use STLport, please use the current 5.0 release. Uli

Felipe Magno de Almeida wrote:
Hi,
STLPort doesnt seem to allow const-types as parameters to std::vector. It chokes in the std::allocator which define const_reference as const reference, making the two the same type. This creates multiple declarations for function-members:
pointer address(reference __x) const { return &__x; } const_pointer address(const_reference __x) const { return &__x; }
Is the STLPort right in this context or should something be done?
I believe that STLPort is correct. std::allocator<int const> isn't valid, and neither is std::vector<int const, A> because a const type is not Assignable.

Hi Felipe, --- Felipe Magno de Almeida <felipe.m.almeida@gmail.com> wrote:
STLPort doesnt seem to allow const-types as parameters to std::vector. ... The problem is that even with non-const pod type boost::asio::buffer is instatiating std::vector<const char>.
Thanks for letting me know. I have just now removed the spurious overload from the CVS version. Cheers, Chris
participants (4)
-
Christopher Kohlhoff
-
Felipe Magno de Almeida
-
Peter Dimov
-
Ulrich Eckhardt