On Tue, 29 Jun 2004 09:19:49 +0100, "John Harrison"
<> wrote:
>
>"Busin" <> wrote in message
>news:8T8Ec.158035$...
>> valarray<bool> va1(10);
>>
>> // Initialize va1 here?
>>
>> valarray<bool> va2 (80);
>>
>> va2 = va1;
>>
>> Is it ok to assign va1 to va2?
>
>Yes
No, it's undefined behaviour, since the lengths don't match.
>> Does va2 have to be specified with a size
>> before assigning va1 to it?
>
>No
Yes.
>> Must the size of va2 be larger than va1?
>
>No, va2 will change its size to be the same as va1
The sizes of va2 and va1 must be exactly the same. See 26.3.2.2.
Tom
--
C++ FAQ:
http://www.parashift.com/c++-faq-lite/
C FAQ:
http://www.eskimo.com/~scs/C-faq/top.html