This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Bug?


> Date: Wed, 8 Mar 2000 23:13:47 +0100
> From: Carlo Wood <carlo@alinoe.com>

> Is this a bug?

Nope.

> >g++ -c 20000308.cc
>   int a[4];

> A::A(int const (&b)[4])
>     /* : a(b) */	// (<-- gives same error)
> {
>   a = b;
> }

> so why doesn't  a = b;  ?

It is a leftover from C.  Arrays are not first class types in C.  In
particular, a=b isn't defined on them.  a=a+b isn't defined either.
That's just how it is, and you just have to memorize the exception,
sorry.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]