Mercurial > jwe > octave
diff liboctave/array/Array.h @ 21139:538b57866b90
consistently use "typename" intead of "class" in template declarations
* Object.h, QtHandlesUtils.cc, QtHandlesUtils.h, ToolBarButton.cc,
ToolBarButton.h, Cell.h, __lin_interpn__.cc, bitfcns.cc, bsxfun.cc,
cellfun.cc, data.cc, filter.cc, gcd.cc, graphics.cc, help.cc, kron.cc,
lookup.cc, ls-mat5.cc, ls-oct-text.h, lu.cc, max.cc, mgorth.cc,
oct-map.cc, oct-map.h, oct-stream.cc, oct-stream.h, octave-link.h,
pr-output.cc, profiler.h, schur.cc, sparse-xdiv.cc, sparse-xpow.cc,
sqrtm.cc, symtab.h, tril.cc, typecast.cc, variables.cc, xdiv.cc,
zfstream.h, __init_fltk__.cc, __magick_read__.cc, chol.cc, qr.cc,
ov-base-diag.cc, ov-base-diag.h, ov-base-int.cc, ov-base-int.h,
ov-base-mat.cc, ov-base-mat.h, ov-base-scalar.cc, ov-base-scalar.h,
ov-base-sparse.cc, ov-base-sparse.h, ov-base.h, ov-classdef.cc,
ov-int-traits.h, ov-java.h, ov-usr-fcn.h, ov.cc, ov.h,
op-dms-template.cc, oct-parse.in.yy, parse.h, pt-mat.cc, Array-b.cc,
Array.cc, Array.h, CDiagMatrix.h, CMatrix.h, CNDArray.h,
DiagArray2.cc, DiagArray2.h, MArray.cc, MArray.h, MDiagArray2.cc,
MDiagArray2.h, MSparse.cc, MSparse.h, MatrixType.cc, Sparse.cc,
Sparse.h, dDiagMatrix.h, dMatrix.h, dNDArray.h, fCDiagMatrix.h,
fCMatrix.h, fCNDArray.h, fDiagMatrix.h, fMatrix.h, fNDArray.h,
idx-vector.cc, idx-vector.h, intNDArray.cc, intNDArray.h, DET.h,
base-aepbal.h, base-lu.cc, base-lu.h, base-qr.cc, base-qr.h,
bsxfun-defs.cc, eigs-base.cc, lo-mappers.h, lo-specfun.cc,
lo-specfun.h, oct-convn.cc, oct-fftw.cc, oct-norm.cc,
sparse-base-chol.cc, sparse-base-chol.h, sparse-base-lu.cc,
sparse-base-lu.h, sparse-dmsolve.cc, mx-inlines.cc,
action-container.h, base-list.h, lo-traits.h, lo-utils.h,
oct-base64.h, oct-binmap.h, oct-cmplx.h, oct-inttypes.cc,
oct-inttypes.h, oct-locbuf.h, oct-refcount.h, oct-sort.cc, oct-sort.h:
Use "typename" instead of "class" in template declarations.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sun, 24 Jan 2016 13:50:04 -0500 |
parents | 2e5c1f766ac9 |
children | a83e7a384ee0 |
line wrap: on
line diff
--- a/liboctave/array/Array.h Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/array/Array.h Sun Jan 24 13:50:04 2016 -0500 @@ -41,7 +41,7 @@ #include "oct-refcount.h" //! Handles the reference counting for all the derived classes. -template <class T> +template <typename T> class Array { @@ -62,7 +62,7 @@ std::copy (d, d+l, data); } - template <class U> + template <typename U> ArrayRep (U *d, octave_idx_type l) : data (new T [l]), len (l), count (1) { @@ -200,7 +200,7 @@ Array (const Array<T>& a, const dim_vector& dv); //! Type conversion case. - template <class U> + template <typename U> Array (const Array<U>& a) : dimensions (a.dims ()), rep (new typename Array<T>::ArrayRep (a.data (), a.numel ())), @@ -660,7 +660,7 @@ //! Apply function fcn to each element of the Array<T>. This function //! is optimised with a manually unrolled loop. - template <class U, class F> + template <typename U, typename F> Array<U> map (F fcn) const { @@ -692,19 +692,19 @@ //@{ //! Overloads for function references. - template <class U> + template <typename U> Array<U> map (U (&fcn) (T)) const { return map<U, U (&) (T)> (fcn); } - template <class U> + template <typename U> Array<U> map (U (&fcn) (const T&)) const { return map<U, U (&) (const T&)> (fcn); } //@} //! Generic any/all test functionality with arbitrary predicate. - template <class F, bool zero> + template <typename F, bool zero> bool test (F fcn) const { return any_all_test<F, T, zero> (fcn, data (), numel ()); @@ -712,11 +712,11 @@ //@{ //! Simpler calls. - template <class F> + template <typename F> bool test_any (F fcn) const { return test<F, false> (fcn); } - template <class F> + template <typename F> bool test_all (F fcn) const { return test<F, true> (fcn); } //@} @@ -736,7 +736,7 @@ { return test<bool (&) (const T&), true> (fcn); } //@} - template <class U> friend class Array; + template <typename U> friend class Array; //! Returns true if this->dims () == dv, and if so, replaces this->dimensions //! by a shallow copy of dv. This is useful for maintaining several arrays with @@ -764,7 +764,7 @@ //! non-const operator() to not check for the array's uniqueness. It //! is, however, the user's responsibility to ensure the array is //! actually unaliased whenever elements are accessed. -template<class ArrayClass> +template <typename ArrayClass> class NoAlias : public ArrayClass { typedef typename ArrayClass::element_type T; @@ -772,13 +772,13 @@ NoAlias () : ArrayClass () { } // FIXME: this would be simpler once C++0x is available - template <class X> + template <typename X> explicit NoAlias (X x) : ArrayClass (x) { } - template <class X, class Y> + template <typename X, typename Y> explicit NoAlias (X x, Y y) : ArrayClass (x, y) { } - template <class X, class Y, class Z> + template <typename X, typename Y, typename Z> explicit NoAlias (X x, Y y, Z z) : ArrayClass (x, y, z) { } T& operator () (octave_idx_type n) @@ -791,7 +791,7 @@ { return ArrayClass::xelem (ra_idx); } }; -template <class T> +template <typename T> std::ostream& operator << (std::ostream& os, const Array<T>& a);