changeset 9196:c229bfb14d8d

avoid apparent MSVC bug with typedef
author John W. Eaton <jwe@octave.org>
date Mon, 11 May 2009 15:34:55 -0400
parents d18be838d5c4
children 3c27a0340a64
files src/ChangeLog src/sparse-xdiv.cc
diffstat 2 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Mon May 11 15:19:56 2009 -0400
+++ b/src/ChangeLog	Mon May 11 15:34:55 2009 -0400
@@ -1,5 +1,8 @@
 2009-05-11  John W. Eaton  <jwe@octave.org>
 
+	* sparse-xdiv.cc (do_rightdiv_sm_dm, do_leftdiv_dm_sm):
+	Avoid apparent MSVC bug with typedef.
+
 	* Makefile.in (install-lib): Remove
 	$(DESTDIR)$(octlibdir)/$(SHLLIBPRE)octinterp.$(SHLLIB_VER), not
 	$(DESTDIR)$(octlibdir)/$(SHLPRE)octinterp.$(SHLEXT_VER).
--- a/src/sparse-xdiv.cc	Mon May 11 15:19:56 2009 -0400
+++ b/src/sparse-xdiv.cc	Mon May 11 15:34:55 2009 -0400
@@ -307,13 +307,14 @@
   const octave_idx_type nz = a.nnz ();
   RT r (a_nr, nc, nz);
 
-  const typename DM::element_type zero = typename DM::element_type ();
+  typedef typename DM::element_type DM_elt_type;
+  const DM_elt_type zero = DM_elt_type ();
 
   octave_idx_type k_result = 0;
   for (octave_idx_type j = 0; j < nc; ++j)
     {
       OCTAVE_QUIT;
-      const typename DM::element_type s = d.dgelem (j);
+      const DM_elt_type s = d.dgelem (j);
       const octave_idx_type colend = a.cidx (j+1);
       r.xcidx (j) = k_result;
       if (s != zero)
@@ -573,7 +574,8 @@
   const octave_idx_type nz = a.nnz ();
   RT r (nr, a_nc, nz);
 
-  const typename DM::element_type zero = typename DM::element_type ();
+  typedef typename DM::element_type DM_elt_type;
+  const DM_elt_type zero = DM_elt_type ();
 
   octave_idx_type k_result = 0;
   for (octave_idx_type j = 0; j < a_nc; ++j)
@@ -586,7 +588,7 @@
 	  const octave_idx_type i = a.ridx (k);
 	  if (i < nr)
 	    {
-	      const typename DM::element_type s = d.dgelem (i);
+	      const DM_elt_type s = d.dgelem (i);
 	      if (s != zero)
 		{
 		  r.xdata (k_result) = a.data (k) / s;