Boost logo

Boost Users :

From: Johan Råde (rade_at_[hidden])
Date: 2006-08-06 12:50:40


AlisdairM wrote:
> Johan Råde wrote:
>
>> If I modify the array class by adding a non-templatized
>> assignment operator, as follows,
>> then the code does compile.
>>
>> ---------------------------------------------------------
>>
>> namespace boost {
>> template<class T, std::size_t N>
>> class array {
>> ...
>> array<T,N>& operator=(const array<T,N>& rhs) {
>> std::copy(rhs.begin(), rhs.end(), begin());
>> return *this;
>> }
>> ...
>> };
>> }
>>
>> ----------------------------------------------------------
>>
>> So I propose that this assignment operator is added,
>> as a VC++ 7.1 bug workaround, to the array class.
>
> The problem with that workaround is that the array template would no
> longer produce aggregate types, and we would lose the ability to use
> brace initialization:
>
>
>> I have contacted Nicolai Josuttis concerning this,
>> and he told me he is not maintaining the array library
>> anymore.
>
> Yes, I have taken on the maintenance now.
> Thanks for the report, although I don't have an instant solution :¬(
>

Alisdair,

Let's finish up this issue.
Are you going to add the workaround that I proposed?

I believe the discussion in this thread led to the conclusion that my
workaround is OK.
Aggregates can not have user defined constructors,
but they can have user defined assignment operators.

--Johan Råde


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net