Boost logo

Boost :

Subject: Re: [boost] Is there a thin array wrapper/proxy lying around somewhere?
From: Rob Stewart (robertstewart_at_[hidden])
Date: 2013-11-25 07:37:01


On Nov 25, 2013, at 4:22 AM, Mostafa <mostafa_working_away_at_[hidden]> wrote:

> On Mon, 25 Nov 2013 00:02:17 -0800, Andrey Semashev <andrey.semashev_at_[hidden]> wrote:
>
>> On Sunday 24 November 2013 23:42:15 Mostafa wrote:
>>> (Yes, I'm aware of boost.array, boost.multiarray, and std::vector.) Is there any thin but complete array wrapper/proxy lying around somewhere in boost? A class that if substituted for an array will behave just like the
>>> substituted array?
>>
>> Umm, could you explain why Boost.Array doesn't qualify?
>>
> Because it does not meet the stated requirements.

Your requirements statement left something to be desired.

> For one, it doesn't have operator+, two, it doesn't have the necessary implicit conversion-to-pointer operator,

With the latter, there's no need for the former.

However, the constructor overloads needed to achieve your desired initialization goals will likely cause problems with the conversion operator, though explicit may be sufficient.

> three regular arrays can't be assigned to, etc ...
>
> To be more clear, what is desired is a type that mimics all (well, I can live with almost all [1]) the functionality of a regular array, no more, no less.
>
> [1] Initialization with array initializor list might be impossible to do in C++03.

I'm not aware of anything meeting your requirements.

___
Rob

(Sent from my portable computation engine)


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk