This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
assigning arrays & const
- From: "Rafael Vuijk \(aka Dark Fader\)" <darkfader at tezrian dot xs4all dot nl>
- To: <gcc-bugs at gcc dot gnu dot org>
- Date: Sat, 24 Nov 2001 17:50:06 +0100
- Subject: assigning arrays & const
[Get raw message]
Hi,
If I have these typedefs...
Typedef int Vector[3];
Typedef Vector Matrix[4]; // 3x4
This works...
inline void MSetTranslation(Matrix &m, Vector &v)
{
m[3] = v;
}
But this doesn't... (due to the const-keyword)
inline void MSetTranslation(Matrix &m, const Vector &v)
{
m[3] = v;
}
IMHO it should work because copying from const to non-const variable is
allowed.
I tested this with GCC 3.0.2
Rafael Vuijk