diff -uNr dmd-1.005/dmd/html/d/acknowledgements.html dmd-1.006/dmd/html/d/acknowledgements.html --- dmd-1.005/dmd/html/d/acknowledgements.html 2007-02-04 12:10:30.000000000 +0100 +++ dmd-1.006/dmd/html/d/acknowledgements.html 2007-02-13 17:58:44.000000000 +0100 @@ -32,7 +32,7 @@ -
Last update Sun Feb 4 12:10:28 2007 +
Last update Tue Feb 13 17:58:43 2007
@@ -216,6 +216,7 @@ Thomas Kuehne, Helmut Leitner, Lubomir Litchev, + Bartosz Milewski, Christopher E. Miller, Pavel Minayev, Antonio Monteiro, diff -uNr dmd-1.005/dmd/html/d/changelog.html dmd-1.006/dmd/html/d/changelog.html --- dmd-1.005/dmd/html/d/changelog.html 2007-02-05 18:37:32.000000000 +0100 +++ dmd-1.006/dmd/html/d/changelog.html 2007-02-15 02:04:20.000000000 +0100 @@ -32,7 +32,7 @@ -
Last update Mon Feb 5 18:37:30 2007 +
Last update Thu Feb 15 02:04:18 2007
@@ -196,6 +196,8 @@

Bugs Fixed

diff -uNr dmd-1.005/dmd/html/d/dcompiler.html dmd-1.006/dmd/html/d/dcompiler.html --- dmd-1.005/dmd/html/d/dcompiler.html 2007-02-04 12:10:30.000000000 +0100 +++ dmd-1.006/dmd/html/d/dcompiler.html 2007-02-09 09:15:48.000000000 +0100 @@ -32,7 +32,7 @@ -
Last update Sun Feb 4 12:10:28 2007 +
Last update Fri Feb 9 09:15:46 2007
@@ -377,8 +377,13 @@
compile in debug code <= level
-debug=ident
compile in debug code identified by ident -
-g
-
add symbolic debug info +
-g +
add CodeView 4 symbolic debug info
+ +
-gc +
add CodeView 4 symbolic debug info in C format + (for C debuggers)
+
-H
generate D interface file
@@ -397,6 +402,16 @@
where to look for imports. path is a ; separated list of paths. Multiple -I's can be used, and the paths are searched in the same order. +
+ +
-Jpath +
where to look for files for ImportExpressions. + This switch is required in order to use ImportExpressions. + path is a ; separated + list of paths. Multiple -J's can be used, and the paths + are searched in the same order. +
+
-Llinkerflag
pass linkerflag to the linker, for example, /ma/li @@ -682,9 +697,9 @@
generate position independent code
-g
add symbolic debug info -
-gc
-
add symbolic debug info in C format (for older gdb's) - +
-gc +
add symbolic debug info in C format (for older gdb's)
+
-H
generate D interface file
@@ -699,9 +714,19 @@
-inline
inline expand functions
-Ipath -
where to look for imports. path is a : separated +
where to look for imports. path is a ; separated list of paths. Multiple -I's can be used, and the paths are searched in the same order. +
+ +
-Jpath +
where to look for files for ImportExpressions. + This switch is required in order to use ImportExpressions. + path is a ; separated + list of paths. Multiple -J's can be used, and the paths + are searched in the same order. +
+
-Llinkerflag
pass linkerflag to the linker, for example, -M diff -uNr dmd-1.005/dmd/html/d/function.html dmd-1.006/dmd/html/d/function.html --- dmd-1.005/dmd/html/d/function.html 2007-02-04 12:10:28.000000000 +0100 +++ dmd-1.006/dmd/html/d/function.html 2007-02-14 21:47:06.000000000 +0100 @@ -32,7 +32,7 @@ -
Last update Sun Feb 4 12:10:27 2007 +
Last update Wed Feb 14 21:47:04 2007
@@ -1152,6 +1152,102 @@ int main(char[][] args) { ... } +

Compile Time Execution of Functions

+ +

A subset of functions can be executed at compile time. + This is useful when constant folding algorithms need to + include recursion and looping. + In order to be executed at compile time, a function must + meet the following criteria: +

+ +
    +
  1. function arguments must all be: +
    • integer literals
    • +
    • floating point literals
    • +
    • character literals
    • +
    • string literals
    • +
    • array literals where the members are all items + in this list
    • +
    • const variables initialized with a member of + this list
    • +
    +
  2. + +
  3. function parameters may not be variadic, + out, inout, or lazy
  4. + +
  5. the function may not be nested or synchronized
  6. + +
  7. the function may not be a non-static member, i.e. + it may not have a this pointer
  8. + +
  9. expressions in the function may not: +
    • throw exceptions
    • +
    • use pointers, delegates, non-const arrays, + structs, unions or classes
    • +
    • reference any global state or variables
    • +
    • reference any local static variables
    • +
    • new or delete
    • +
    • call any function that is not + executable at compile time
    • +
    +
  10. + +
  11. the following statement types are not allowed: +
    • syncrhonized statements
    • +
    • throw statements
    • +
    • with statements
    • +
    • scope statements
    • +
    • try-catch-finally statements
    • +
    • labelled break and continue statements
    • +
    +
  12. +
+ +

In order to be executed at compile time, the function + must appear in a context where it must be so executed, for + example:

+ + + +
template eval(A...) { alias A eval; }
+
+int square(int i) { return i * i; }
+
+void foo()
+{
+  static j = square(3);     // compile time
+  writefln(j);
+  writefln(square(4));      // run time
+  writefln(eval!(square(5))); // compile time
+}
+
+ +

Executing functions at compile time can take considerably + longer than executing it at run time. + If the function goes into an infinite loop, it will hang at + compile time (rather than hanging at run time). +

+ +

Functions executed at compile time can give different results + from run time in the following scenarios: +

+ + + +

These are the same kinds of scenarios where different + optimization settings affect the results.

+

diff -uNr dmd-1.005/dmd/html/d/future.html dmd-1.006/dmd/html/d/future.html --- dmd-1.005/dmd/html/d/future.html 2007-02-04 12:10:30.000000000 +0100 +++ dmd-1.006/dmd/html/d/future.html 2007-02-13 17:58:44.000000000 +0100 @@ -32,7 +32,7 @@ -
Last update Sun Feb 4 12:10:28 2007 +
Last update Tue Feb 13 17:58:43 2007
@@ -194,8 +194,6 @@

Future Directions

-

The release of D version 1.0 is scheduled for Jan 1, 2007.

-

The following new features for D are planned for post 1.0, but the details have not been worked out:

diff -uNr dmd-1.005/dmd/html/d/phobos/object.html dmd-1.006/dmd/html/d/phobos/object.html --- dmd-1.005/dmd/html/d/phobos/object.html 2007-02-05 18:37:16.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/object.html 2007-02-15 02:02:42.000000000 +0100 @@ -28,7 +28,7 @@
-
Last update Mon Feb 5 18:37:15 2007 +
Last update Thu Feb 15 02:02:41 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/phobos.html dmd-1.006/dmd/html/d/phobos/phobos.html --- dmd-1.005/dmd/html/d/phobos/phobos.html 2007-02-05 18:37:20.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/phobos.html 2007-02-15 02:02:46.000000000 +0100 @@ -29,7 +29,7 @@ -
Last update Mon Feb 5 18:37:18 2007 +
Last update Thu Feb 15 02:02:45 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_base64.html dmd-1.006/dmd/html/d/phobos/std_base64.html --- dmd-1.005/dmd/html/d/phobos/std_base64.html 2007-02-05 18:37:16.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_base64.html 2007-02-15 02:02:42.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:15 2007 +
Last update Thu Feb 15 02:02:41 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_bind.html dmd-1.006/dmd/html/d/phobos/std_bind.html --- dmd-1.005/dmd/html/d/phobos/std_bind.html 2007-02-05 18:37:18.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_bind.html 2007-02-15 02:02:44.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:16 2007 +
Last update Thu Feb 15 02:02:42 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_bitarray.html dmd-1.006/dmd/html/d/phobos/std_bitarray.html --- dmd-1.005/dmd/html/d/phobos/std_bitarray.html 2007-02-05 18:37:18.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_bitarray.html 2007-02-15 02:02:44.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:16 2007 +
Last update Thu Feb 15 02:02:42 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_boxer.html dmd-1.006/dmd/html/d/phobos/std_boxer.html --- dmd-1.005/dmd/html/d/phobos/std_boxer.html 2007-02-05 18:37:18.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_boxer.html 2007-02-15 02:02:44.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:16 2007 +
Last update Thu Feb 15 02:02:42 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_c_fenv.html dmd-1.006/dmd/html/d/phobos/std_c_fenv.html --- dmd-1.005/dmd/html/d/phobos/std_c_fenv.html 2007-02-05 18:37:20.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_c_fenv.html 2007-02-15 02:02:46.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:18 2007 +
Last update Thu Feb 15 02:02:44 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_c_math.html dmd-1.006/dmd/html/d/phobos/std_c_math.html --- dmd-1.005/dmd/html/d/phobos/std_c_math.html 2007-02-05 18:37:20.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_c_math.html 2007-02-15 02:02:46.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:18 2007 +
Last update Thu Feb 15 02:02:44 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_compiler.html dmd-1.006/dmd/html/d/phobos/std_compiler.html --- dmd-1.005/dmd/html/d/phobos/std_compiler.html 2007-02-05 18:37:16.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_compiler.html 2007-02-15 02:02:42.000000000 +0100 @@ -32,7 +32,7 @@ -
Last update Mon Feb 5 18:37:15 2007 +
Last update Thu Feb 15 02:02:41 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_conv.html dmd-1.006/dmd/html/d/phobos/std_conv.html --- dmd-1.005/dmd/html/d/phobos/std_conv.html 2007-02-05 18:37:18.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_conv.html 2007-02-15 02:02:44.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:16 2007 +
Last update Thu Feb 15 02:02:42 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_cover.html dmd-1.006/dmd/html/d/phobos/std_cover.html --- dmd-1.005/dmd/html/d/phobos/std_cover.html 2007-02-05 18:37:18.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_cover.html 2007-02-15 02:02:44.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:16 2007 +
Last update Thu Feb 15 02:02:43 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_c_process.html dmd-1.006/dmd/html/d/phobos/std_c_process.html --- dmd-1.005/dmd/html/d/phobos/std_c_process.html 2007-02-05 18:37:20.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_c_process.html 2007-02-15 02:02:46.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:18 2007 +
Last update Thu Feb 15 02:02:44 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_cpuid.html dmd-1.006/dmd/html/d/phobos/std_cpuid.html --- dmd-1.005/dmd/html/d/phobos/std_cpuid.html 2007-02-05 18:37:18.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_cpuid.html 2007-02-15 02:02:44.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:17 2007 +
Last update Thu Feb 15 02:02:43 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_c_stdarg.html dmd-1.006/dmd/html/d/phobos/std_c_stdarg.html --- dmd-1.005/dmd/html/d/phobos/std_c_stdarg.html 2007-02-05 18:37:20.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_c_stdarg.html 2007-02-15 02:02:46.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:18 2007 +
Last update Thu Feb 15 02:02:44 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_c_stddef.html dmd-1.006/dmd/html/d/phobos/std_c_stddef.html --- dmd-1.005/dmd/html/d/phobos/std_c_stddef.html 2007-02-05 18:37:20.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_c_stddef.html 2007-02-15 02:02:46.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:18 2007 +
Last update Thu Feb 15 02:02:44 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_c_stdio.html dmd-1.006/dmd/html/d/phobos/std_c_stdio.html --- dmd-1.005/dmd/html/d/phobos/std_c_stdio.html 2007-02-05 18:37:20.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_c_stdio.html 2007-02-15 02:02:46.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:18 2007 +
Last update Thu Feb 15 02:02:44 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_c_stdlib.html dmd-1.006/dmd/html/d/phobos/std_c_stdlib.html --- dmd-1.005/dmd/html/d/phobos/std_c_stdlib.html 2007-02-05 18:37:20.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_c_stdlib.html 2007-02-15 02:02:46.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:18 2007 +
Last update Thu Feb 15 02:02:45 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_cstream.html dmd-1.006/dmd/html/d/phobos/std_cstream.html --- dmd-1.005/dmd/html/d/phobos/std_cstream.html 2007-02-05 18:37:18.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_cstream.html 2007-02-15 02:02:44.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:17 2007 +
Last update Thu Feb 15 02:02:43 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_c_string.html dmd-1.006/dmd/html/d/phobos/std_c_string.html --- dmd-1.005/dmd/html/d/phobos/std_c_string.html 2007-02-05 18:37:20.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_c_string.html 2007-02-15 02:02:46.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:18 2007 +
Last update Thu Feb 15 02:02:45 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_c_time.html dmd-1.006/dmd/html/d/phobos/std_c_time.html --- dmd-1.005/dmd/html/d/phobos/std_c_time.html 2007-02-05 18:37:20.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_c_time.html 2007-02-15 02:02:46.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:18 2007 +
Last update Thu Feb 15 02:02:45 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_ctype.html dmd-1.006/dmd/html/d/phobos/std_ctype.html --- dmd-1.005/dmd/html/d/phobos/std_ctype.html 2007-02-05 18:37:18.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_ctype.html 2007-02-15 02:02:44.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:17 2007 +
Last update Thu Feb 15 02:02:43 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_c_wcharh.html dmd-1.006/dmd/html/d/phobos/std_c_wcharh.html --- dmd-1.005/dmd/html/d/phobos/std_c_wcharh.html 2007-02-05 18:37:20.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_c_wcharh.html 2007-02-15 02:02:46.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:18 2007 +
Last update Thu Feb 15 02:02:45 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_date.html dmd-1.006/dmd/html/d/phobos/std_date.html --- dmd-1.005/dmd/html/d/phobos/std_date.html 2007-02-05 18:37:18.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_date.html 2007-02-15 02:02:44.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:16 2007 +
Last update Thu Feb 15 02:02:42 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_demangle.html dmd-1.006/dmd/html/d/phobos/std_demangle.html --- dmd-1.005/dmd/html/d/phobos/std_demangle.html 2007-02-05 18:37:18.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_demangle.html 2007-02-15 02:02:44.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:17 2007 +
Last update Thu Feb 15 02:02:43 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_file.html dmd-1.006/dmd/html/d/phobos/std_file.html --- dmd-1.005/dmd/html/d/phobos/std_file.html 2007-02-05 18:37:18.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_file.html 2007-02-15 02:02:44.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:16 2007 +
Last update Thu Feb 15 02:02:42 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_format.html dmd-1.006/dmd/html/d/phobos/std_format.html --- dmd-1.005/dmd/html/d/phobos/std_format.html 2007-02-05 18:37:16.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_format.html 2007-02-15 02:02:42.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:15 2007 +
Last update Thu Feb 15 02:02:41 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_gc.html dmd-1.006/dmd/html/d/phobos/std_gc.html --- dmd-1.005/dmd/html/d/phobos/std_gc.html 2007-02-05 18:37:18.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_gc.html 2007-02-15 02:02:44.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:17 2007 +
Last update Thu Feb 15 02:02:43 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_intrinsic.html dmd-1.006/dmd/html/d/phobos/std_intrinsic.html --- dmd-1.005/dmd/html/d/phobos/std_intrinsic.html 2007-02-05 18:37:18.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_intrinsic.html 2007-02-15 02:02:44.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:17 2007 +
Last update Thu Feb 15 02:02:43 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_math.html dmd-1.006/dmd/html/d/phobos/std_math.html --- dmd-1.005/dmd/html/d/phobos/std_math.html 2007-02-05 18:37:16.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_math.html 2007-02-15 02:02:42.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:14 2007 +
Last update Thu Feb 15 02:02:40 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_md5.html dmd-1.006/dmd/html/d/phobos/std_md5.html --- dmd-1.005/dmd/html/d/phobos/std_md5.html 2007-02-05 18:37:18.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_md5.html 2007-02-15 02:02:44.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:16 2007 +
Last update Thu Feb 15 02:02:42 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_metastrings.html dmd-1.006/dmd/html/d/phobos/std_metastrings.html --- dmd-1.005/dmd/html/d/phobos/std_metastrings.html 2007-02-05 18:37:18.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_metastrings.html 2007-02-15 02:02:44.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:17 2007 +
Last update Thu Feb 15 02:02:43 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_mmfile.html dmd-1.006/dmd/html/d/phobos/std_mmfile.html --- dmd-1.005/dmd/html/d/phobos/std_mmfile.html 2007-02-05 18:37:18.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_mmfile.html 2007-02-15 02:02:44.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:17 2007 +
Last update Thu Feb 15 02:02:43 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_openrj.html dmd-1.006/dmd/html/d/phobos/std_openrj.html --- dmd-1.005/dmd/html/d/phobos/std_openrj.html 2007-02-05 18:37:18.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_openrj.html 2007-02-15 02:02:44.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:17 2007 +
Last update Thu Feb 15 02:02:43 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_outbuffer.html dmd-1.006/dmd/html/d/phobos/std_outbuffer.html --- dmd-1.005/dmd/html/d/phobos/std_outbuffer.html 2007-02-05 18:37:16.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_outbuffer.html 2007-02-15 02:02:42.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:15 2007 +
Last update Thu Feb 15 02:02:40 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_outofmemory.html dmd-1.006/dmd/html/d/phobos/std_outofmemory.html --- dmd-1.005/dmd/html/d/phobos/std_outofmemory.html 2007-02-05 18:37:18.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_outofmemory.html 2007-02-15 02:02:44.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:17 2007 +
Last update Thu Feb 15 02:02:43 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_path.html dmd-1.006/dmd/html/d/phobos/std_path.html --- dmd-1.005/dmd/html/d/phobos/std_path.html 2007-02-05 18:37:16.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_path.html 2007-02-15 02:02:42.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:14 2007 +
Last update Thu Feb 15 02:02:40 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_process.html dmd-1.006/dmd/html/d/phobos/std_process.html --- dmd-1.005/dmd/html/d/phobos/std_process.html 2007-02-05 18:37:18.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_process.html 2007-02-15 02:02:44.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:17 2007 +
Last update Thu Feb 15 02:02:43 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_random.html dmd-1.006/dmd/html/d/phobos/std_random.html --- dmd-1.005/dmd/html/d/phobos/std_random.html 2007-02-05 18:37:18.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_random.html 2007-02-15 02:02:42.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:16 2007 +
Last update Thu Feb 15 02:02:41 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_regexp.html dmd-1.006/dmd/html/d/phobos/std_regexp.html --- dmd-1.005/dmd/html/d/phobos/std_regexp.html 2007-02-05 18:37:18.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_regexp.html 2007-02-15 02:02:44.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:17 2007 +
Last update Thu Feb 15 02:02:43 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_signals.html dmd-1.006/dmd/html/d/phobos/std_signals.html --- dmd-1.005/dmd/html/d/phobos/std_signals.html 2007-02-05 18:37:18.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_signals.html 2007-02-15 02:02:44.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:17 2007 +
Last update Thu Feb 15 02:02:43 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_socket.html dmd-1.006/dmd/html/d/phobos/std_socket.html --- dmd-1.005/dmd/html/d/phobos/std_socket.html 2007-02-05 18:37:20.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_socket.html 2007-02-15 02:02:46.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:17 2007 +
Last update Thu Feb 15 02:02:44 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_socketstream.html dmd-1.006/dmd/html/d/phobos/std_socketstream.html --- dmd-1.005/dmd/html/d/phobos/std_socketstream.html 2007-02-05 18:37:20.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_socketstream.html 2007-02-15 02:02:46.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:18 2007 +
Last update Thu Feb 15 02:02:44 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_stdint.html dmd-1.006/dmd/html/d/phobos/std_stdint.html --- dmd-1.005/dmd/html/d/phobos/std_stdint.html 2007-02-05 18:37:20.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_stdint.html 2007-02-15 02:02:46.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:18 2007 +
Last update Thu Feb 15 02:02:44 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_stdio.html dmd-1.006/dmd/html/d/phobos/std_stdio.html --- dmd-1.005/dmd/html/d/phobos/std_stdio.html 2007-02-05 18:37:20.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_stdio.html 2007-02-15 02:02:46.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:18 2007 +
Last update Thu Feb 15 02:02:44 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_stream.html dmd-1.006/dmd/html/d/phobos/std_stream.html --- dmd-1.005/dmd/html/d/phobos/std_stream.html 2007-02-05 18:37:16.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_stream.html 2007-02-15 02:02:42.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:15 2007 +
Last update Thu Feb 15 02:02:41 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_string.html dmd-1.006/dmd/html/d/phobos/std_string.html --- dmd-1.005/dmd/html/d/phobos/std_string.html 2007-02-05 18:37:16.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_string.html 2007-02-15 02:02:42.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:15 2007 +
Last update Thu Feb 15 02:02:41 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_system.html dmd-1.006/dmd/html/d/phobos/std_system.html --- dmd-1.005/dmd/html/d/phobos/std_system.html 2007-02-05 18:37:20.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_system.html 2007-02-15 02:02:46.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:18 2007 +
Last update Thu Feb 15 02:02:44 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_thread.html dmd-1.006/dmd/html/d/phobos/std_thread.html --- dmd-1.005/dmd/html/d/phobos/std_thread.html 2007-02-05 18:37:20.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_thread.html 2007-02-15 02:02:46.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:18 2007 +
Last update Thu Feb 15 02:02:44 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_traits.html dmd-1.006/dmd/html/d/phobos/std_traits.html --- dmd-1.005/dmd/html/d/phobos/std_traits.html 2007-02-05 18:37:20.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_traits.html 2007-02-15 02:02:46.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:18 2007 +
Last update Thu Feb 15 02:02:44 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_typetuple.html dmd-1.006/dmd/html/d/phobos/std_typetuple.html --- dmd-1.005/dmd/html/d/phobos/std_typetuple.html 2007-02-05 18:37:20.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_typetuple.html 2007-02-15 02:02:46.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:18 2007 +
Last update Thu Feb 15 02:02:44 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_uni.html dmd-1.006/dmd/html/d/phobos/std_uni.html --- dmd-1.005/dmd/html/d/phobos/std_uni.html 2007-02-05 18:37:20.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_uni.html 2007-02-15 02:02:46.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:18 2007 +
Last update Thu Feb 15 02:02:44 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_uri.html dmd-1.006/dmd/html/d/phobos/std_uri.html --- dmd-1.005/dmd/html/d/phobos/std_uri.html 2007-02-05 18:37:20.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_uri.html 2007-02-15 02:02:46.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:18 2007 +
Last update Thu Feb 15 02:02:44 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_utf.html dmd-1.006/dmd/html/d/phobos/std_utf.html --- dmd-1.005/dmd/html/d/phobos/std_utf.html 2007-02-05 18:37:20.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_utf.html 2007-02-15 02:02:46.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:18 2007 +
Last update Thu Feb 15 02:02:44 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_windows_charset.html dmd-1.006/dmd/html/d/phobos/std_windows_charset.html --- dmd-1.005/dmd/html/d/phobos/std_windows_charset.html 2007-02-05 18:37:20.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_windows_charset.html 2007-02-15 02:02:46.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:18 2007 +
Last update Thu Feb 15 02:02:44 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_zip.html dmd-1.006/dmd/html/d/phobos/std_zip.html --- dmd-1.005/dmd/html/d/phobos/std_zip.html 2007-02-05 18:37:18.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_zip.html 2007-02-15 02:02:44.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:16 2007 +
Last update Thu Feb 15 02:02:42 2007
diff -uNr dmd-1.005/dmd/html/d/phobos/std_zlib.html dmd-1.006/dmd/html/d/phobos/std_zlib.html --- dmd-1.005/dmd/html/d/phobos/std_zlib.html 2007-02-05 18:37:18.000000000 +0100 +++ dmd-1.006/dmd/html/d/phobos/std_zlib.html 2007-02-15 02:02:44.000000000 +0100 @@ -28,7 +28,7 @@ -
Last update Mon Feb 5 18:37:16 2007 +
Last update Thu Feb 15 02:02:42 2007
diff -uNr dmd-1.005/dmd/html/d/template-comparison.html dmd-1.006/dmd/html/d/template-comparison.html --- dmd-1.005/dmd/html/d/template-comparison.html 2007-02-04 12:10:30.000000000 +0100 +++ dmd-1.006/dmd/html/d/template-comparison.html 2007-02-15 00:37:48.000000000 +0100 @@ -31,7 +31,7 @@ -
Last update Sun Feb 4 12:10:29 2007 +
Last update Thu Feb 15 00:37:47 2007
@@ -316,6 +316,22 @@ No change + Compile time execution of functions + Yes: +
int factorial(int i)
+{ if (i == 0)
+    return 1;
+  else
+    return i * factorial(i - 1);
+}
+static f = factorial(6);
+
+ + No + Named constant expressions with parameters: + Generalized Constant Expressions N1972 + + Parameters D C++98 diff -uNr dmd-1.005/dmd/html/d/templates-revisited.html dmd-1.006/dmd/html/d/templates-revisited.html --- dmd-1.005/dmd/html/d/templates-revisited.html 2007-02-04 12:10:30.000000000 +0100 +++ dmd-1.006/dmd/html/d/templates-revisited.html 2007-02-15 00:50:24.000000000 +0100 @@ -33,7 +33,7 @@ -
Last update Sun Feb 4 12:10:28 2007 +
Last update Thu Feb 15 00:50:23 2007
@@ -305,13 +305,13 @@
template Foo(T, U)
 {
-class Bar { ... }
+  class Bar { ... }
 
-T foo(T t, U u) { ... }
+  T foo(T t, U u) { ... }
 
-T abc;
+  T abc;
 
-typedef T* Footype;	// any declarations can be templated
+  typedef T* Footype;	// any declarations can be templated
 }
 
@@ -582,7 +582,8 @@ } -

Through using the static if construct it can be done in just one template: +

Through using the static if construct it can be done in just one +template:

template factorial(int n)
@@ -603,6 +604,20 @@
 such constructions.
 

+

D can make this even simpler. Value generating templates such +as the factorial one are possible, but it's easier to just write +a function that can be computed at compile time:

+ +
int factorial(int n)
+{
+  if (n == 1)
+    return 1;
+  else
+    return n * factorial(n - 1);
+}
+
+static int x = factorial(5);  // x is statically initialized to 120
+

SFINAE - Substitution Failure Is Not An Error

@@ -719,6 +734,23 @@ has written a template to compute π at compile time. [2]

+

Again, we can just do this with a function that can be executed +at compile time:

+ +
real sqrt(real x)
+{
+    real root = x / 2;
+    for (int ntries = 0; ntries < 5; ntries++)
+    {
+	if (root * root - x == 0)
+	    break;
+	root = (root + x / root) / 2;
+    }
+    return root;
+}
+static y = sqrt(10);   // y is statically initialized to 3.16228
+
+

Template Metaprogramming With Strings

Even more interesting things can be done with strings. This example