[PATCH] Guard Vector constructors
Jeffrey D. Oldham
oldham at codesourcery.com
Thu Dec 4 02:43:15 UTC 2003
Richard Guenther wrote:
> Hi!
>
> I just had a swep over my local changes and found this (and others, see
> following mails). It guards the Vector constructors by dimensionality
> checks. I suppose this bit me at a time.
>
> Checked by being in my tree for a long time (don't know if that counts,
> though ;)).
>
> Ok?
OK. We'll watch for regressions in the nightly POOMA tests.
Would you be willing to also send a ChangeLog entry with your patches?
It will facilitate reviewing the patches.
> Richard.
>
> Index: Vector.h
> ===================================================================
> RCS file: /home/pooma/Repository/r2/src/Tiny/Vector.h,v
> retrieving revision 1.31
> diff -u -u -r1.31 Vector.h
> --- Vector.h 21 Oct 2003 19:50:04 -0000 1.31
> +++ Vector.h 3 Dec 2003 20:39:37 -0000
> @@ -291,12 +291,14 @@
> template<class X1, class X2>
> inline VectorEngine(const X1& x, const X2& y)
> {
> + CTAssert(D == 2);
> x_m[0] = x;
> x_m[1] = y;
> }
> template<class X1, class X2, class X3>
> inline VectorEngine(const X1& x, const X2& y, const X3& z)
> {
> + CTAssert(D == 3);
> x_m[0] = x;
> x_m[1] = y;
> x_m[2] = z;
> @@ -305,6 +307,7 @@
> inline VectorEngine(const X1& x, const X2& y, const X3& z,
> const X4& a)
> {
> + CTAssert(D == 4);
> x_m[0] = x;
> x_m[1] = y;
> x_m[2] = z;
--
Jeffrey D. Oldham
oldham at codesourcery.com
More information about the pooma-dev
mailing list