freepooma-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Freepooma-devel] Tiny/ all TrivialElementProperties!?


From: Richard Guenther
Subject: [Freepooma-devel] Tiny/ all TrivialElementProperties!?
Date: Mon, 22 Nov 2004 15:19:36 +0100 (CET)

Hi!

All Tiny classes define theirselves as having TrivialElementProperties
which is correct only, if T is Trivial or Basic, but no checks are
done for this.  Is this an intended requirement for accepted T or
a bug?

If it is a requirement, I'd like to add checks like

Index: Tiny/Vector.h
===================================================================
RCS file: /cvsroot/freepooma/freepooma/src/Tiny/Vector.h,v
retrieving revision 1.33
diff -u -u -r1.33 Vector.h
--- Tiny/Vector.h       1 Nov 2004 18:17:11 -0000       1.33
+++ Tiny/Vector.h       22 Nov 2004 14:21:50 -0000
@@ -260,6 +250,9 @@
   // Null ctor takes no action.
   VectorEngine()
   {
+    CTAssert(ElementProperties<T>::hasTrivialDefaultConstructor
+            && ElementProperties<T>::hasTrivialDestructor
+            && ElementProperties<T>::concrete);
     for (int i = 0; i < D; ++i)
       {
        ElementProperties<T>::construct(&x_m[i]);


would that be ok?  It forces you to specialize ElementProperties for
your custom types used with the tiny classes.

Thanks,
Richard.

--
Richard Guenther <richard dot guenther at uni-tuebingen dot de>
WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]