toon-members
[Top][All Lists]
Advanced

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

[Toon-members] TooN/internal vector.hh


From: Edward Rosten
Subject: [Toon-members] TooN/internal vector.hh
Date: Wed, 14 Oct 2009 15:19:57 +0000

CVSROOT:        /cvsroot/toon
Module name:    TooN
Changes by:     Edward Rosten <edrosten>        09/10/14 15:19:57

Modified files:
        internal       : vector.hh 

Log message:
        Make single argument constructors for Vector explicit. This prevents the
        following code from compiling:
        
        Vector<4> v = Ones * 99;
        v = 1;
        
        Without explicit, v=1 constructs a Vector<4>(1) then assigns is to v.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/TooN/internal/vector.hh?cvsroot=toon&r1=1.51&r2=1.52

Patches:
Index: vector.hh
===================================================================
RCS file: /cvsroot/toon/TooN/internal/vector.hh,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -b -r1.51 -r1.52
--- vector.hh   28 Sep 2009 08:31:58 -0000      1.51
+++ vector.hh   14 Oct 2009 15:19:57 -0000      1.52
@@ -145,7 +145,7 @@
        /// Constructor for dynamically-size vectors.  This can also be
        /// used for statically sized vectors in which case the argument
        /// is ignored.  The values of the vector are uninitialised
-       inline Vector(int size_in) : Base::template VLayout<Size, 
Precision>(size_in) {}
+       explicit inline Vector(int size_in) : Base::template VLayout<Size, 
Precision>(size_in) {}
 
        /// Constructor used when constructing a vector which references
        /// other data, e.g.
@@ -153,7 +153,7 @@
        /// double[] d = {1,2,3};
        /// Vector<3,double,Reference> v(d);
        /// @endcode
-       inline Vector(Precision* data) : Base::template VLayout<Size, 
Precision> (data) {}
+       explicit inline Vector(Precision* data) : Base::template VLayout<Size, 
Precision> (data) {}
 
 
        /// Constructor used when constructing a dynamic vector which references




reply via email to

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