diff liboctave/Array2.cc @ 2109:356f70c8fcbd

[project @ 1996-04-30 12:31:30 by jwe]
author jwe
date Tue, 30 Apr 1996 12:31:30 +0000
parents 95e952f72d66
children 3d905d3820a4
line wrap: on
line diff
--- a/liboctave/Array2.cc
+++ b/liboctave/Array2.cc
@@ -42,6 +42,25 @@
 
 #include "lo-error.h"
 
+template <class T>
+T
+Array2<T>::range_error (const char *fcn, int i, int j) const
+{
+  (*current_liboctave_error_handler)
+    ("%s (%d, %d): range error", fcn, i, j);
+  return T ();
+}
+
+template <class T>
+T&
+Array2<T>::range_error (const char *fcn, int i, int j)
+{
+  (*current_liboctave_error_handler)
+    ("%s (%d, %d): range error", fcn, i, j);
+  static T foo;
+  return foo;
+}
+
 // Two dimensional array class.
 
 template <class T>
@@ -50,7 +69,8 @@
 {
   if (r < 0 || c < 0)
     {
-      (*current_liboctave_error_handler) ("can't resize to negative dimension");
+      (*current_liboctave_error_handler)
+	("can't resize to negative dimension");
       return;
     }
 
@@ -89,7 +109,8 @@
 {
   if (r < 0 || c < 0)
     {
-      (*current_liboctave_error_handler) ("can't resize to negative dimension");
+      (*current_liboctave_error_handler)
+	("can't resize to negative dimension");
       return;
     }