Mercurial > hg > octave-lyh
diff liboctave/MArray.h @ 9812:f80c566bc751
improve unary mapper system
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Thu, 12 Nov 2009 15:47:58 +0100 |
parents | 66970dd627f6 |
children | 47c5af1868df |
line wrap: on
line diff
--- a/liboctave/MArray.h +++ b/liboctave/MArray.h @@ -93,11 +93,16 @@ double norm (double p) const; float norm (float p) const; - template <class U, class F> - MArray<U> map (F fcn) const - { - return Array<T>::template map<U> (fcn); - } + // FIXME: should go away. + template <class U> + MArray<U> + map (U (&fcn) (T)) const + { return Array<T>::template map<U> (fcn); } + + template <class U> + MArray<U> + map (U (&fcn) (const T&)) const + { return Array<T>::template map<U> (fcn); } // Performs indexed accumulative addition.