diff lphobos/std/outofmemory.d @ 89:ccca1c13e13a trunk

[svn r93] a few fixes, some phobos additions. some very rough groundwork for moduleinfo and classinfo support
author lindquist
date Wed, 07 Nov 2007 02:45:47 +0100
parents
children 88e23f8c2354
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lphobos/std/outofmemory.d	Wed Nov 07 02:45:47 2007 +0100
@@ -0,0 +1,44 @@
+/**
+ * Macros:
+ *	WIKI=Phobos/StdOutOfMemory
+ * Copyright:
+ *	Placed into public domain.
+ *	www.digitalmars.com
+ */
+
+
+module std.outofmemory;
+
+/******
+ * This exception is thrown when out of memory errors happen.
+ */
+
+class OutOfMemoryException : Exception
+{
+    static char[] s = "Out of memory";
+
+    /**
+     * Default constructor
+     */
+    this()
+    {
+	super(s);
+    }
+
+    char[] toString()
+    {
+	return s;
+    }
+}
+
+extern (C) void _d_OutOfMemory()
+{
+    assert(0);
+    /*throw cast(OutOfMemoryException)
+	  cast(void *)
+	  OutOfMemoryException.classinfo.init;*/
+}
+
+static this()
+{
+}