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]
Other format: [Raw text]

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


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