Boost logo

Boost :

Subject: Re: [boost] Is there a thin array wrapper/proxy lying around somewhere?
From: Mostafa (mostafa_working_away_at_[hidden])
Date: 2013-11-25 16:28:14

On Mon, 25 Nov 2013 07:44:22 -0800, Steven Watanabe <watanabesj_at_[hidden]>

> On 11/25/2013 01:22 AM, Mostafa wrote:
>> Because it does not meet the stated requirements. For one, it doesn't
>> have operator+, two, it doesn't have the necessary implicit
>> conversion-to-pointer operator, 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.
> If you want something that behaves exactly like an
> array, why can't you use an array?

typedef int Arr3[3];
typedef tuple<int, Arr3, long> MemType;

struct Foo
   Foo(int p1, Arr3 & p2, long p3) : mem(p1, p2, p3) {}

   MemType mem;

Boost list run by bdawes at, gregod at, cpdaniel at, john at