[Top][All Lists]
[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: |
Thu, 26 Mar 2009 21:22:13 +0000 |
CVSROOT: /cvsroot/toon
Module name: TooN
Changes by: Edward Rosten <edrosten> 09/03/26 21:22:13
Modified files:
internal : vector.hh
Log message:
Nullary operators for Vector.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/TooN/internal/vector.hh?cvsroot=toon&r1=1.24&r2=1.25
Patches:
Index: vector.hh
===================================================================
RCS file: /cvsroot/toon/TooN/internal/vector.hh,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- vector.hh 20 Mar 2009 16:49:25 -0000 1.24
+++ vector.hh 26 Mar 2009 21:22:13 -0000 1.25
@@ -14,6 +14,13 @@
using Base::template Layout<Size, Precision>::size;
// constructors to allow return value optimisations
+ // construction from 0-ary operator
+ template <class Op>
+ inline Vector(const Operator<Op>&){
+ Op::eval(*this);
+ }
+
+ // constructors to allow return value optimisations
// construction from 1-ary operator
template <class T, class Op>
inline Vector(const T& arg, int size, const Operator<Op>&) :
Base::template Layout<Size, Precision>(size) {
@@ -43,6 +50,12 @@
operator=(from);
}
+ // assignment from a 0-ary operator
+ template <class Op>
+ inline operator=(const Operator<Op>&){
+ Op::eval(*this);
+ }
+
// operator = from copy
inline Vector& operator= (const Vector& from){
SizeMismatch<Size,Size>::test(size(), from.size());