| 1 |
Ddoc |
|---|
| 2 |
|
|---|
| 3 |
$(D_S D 2.0 Enhancements from D 1.0, |
|---|
| 4 |
|
|---|
| 5 |
$(P D 2.0 has many substantial language and library enhancements |
|---|
| 6 |
compared with D 1.0. |
|---|
| 7 |
This list does not include $(LINK2 changelog.html, bug fixes) |
|---|
| 8 |
or $(LINK2 ../1.0/changelog.html, changes that were also made to D 1.0). |
|---|
| 9 |
See the $(LINK2 D1toD2.html, D1 to D2 Migration Guide) for help |
|---|
| 10 |
in converting source code. |
|---|
| 11 |
) |
|---|
| 12 |
|
|---|
| 13 |
$(SECTION2 Core Language Changes, |
|---|
| 14 |
|
|---|
| 15 |
$(UL |
|---|
| 16 |
$(LI $(CODE opAssign) can no longer be overloaded for class objects.) |
|---|
| 17 |
$(LI Added $(CODE pure) keyword.) |
|---|
| 18 |
$(LI Extended $(LINK2 enum.html, enums) to allow declaration |
|---|
| 19 |
of manifest constants.) |
|---|
| 20 |
$(LI Added $(LINK2 struct.html#ConstStruct, const/immutable structs), |
|---|
| 21 |
$(LINK2 class.html#ConstClass, classes) and |
|---|
| 22 |
$(LINK2 interface.html#ConstInterface, interfaces).) |
|---|
| 23 |
$(LI Added $(CODE const) and $(CODE immutable) to $(LINK2 expression.html#IsExpression, $(I IsExpression))s.) |
|---|
| 24 |
$(LI Added $(CODE typeof(return)) type specifier.) |
|---|
| 25 |
$(LI Added overloadable unary * operation as $(CODE opStar()).) |
|---|
| 26 |
$(LI Full closure support added.) |
|---|
| 27 |
$(LI Transformed all of $(CODE string), $(CODE wstring), |
|---|
| 28 |
and $(CODE dstring) into immutable definitions). |
|---|
| 29 |
$(LI Added $(LINK2 function.html#overload-sets, Overload Sets) for functions and templates.) |
|---|
| 30 |
$(LI $(TT std.math.sin), $(TT cos), $(TT tan) are now evaluated at |
|---|
| 31 |
compile time if the argument is a constant.) |
|---|
| 32 |
$(LI Added $(LINK2 cpp_interface.html, C++ interface) for $(SINGLEQUOTE plugins).) |
|---|
| 33 |
$(LI Changed result type of |
|---|
| 34 |
$(LINK2 expression.html#IsExpression, $(I IsExpression)) |
|---|
| 35 |
from $(CODE int) to $(CODE bool).) |
|---|
| 36 |
$(LI Added optional $(I TemplateParameterList) to $(LINK2 expression.html#IsExpression, $(I IsExpression)).) |
|---|
| 37 |
$(LI Added warning when $(CODE override) is omitted.) |
|---|
| 38 |
$(LI Added new syntax for string literals (delimited, heredoc, D tokens)) |
|---|
| 39 |
$(LI Added $(CODE __EOF__) token) |
|---|
| 40 |
$(LI Added $(LINK2 version.html#PredefinedVersions, $(B D_Version2)) |
|---|
| 41 |
predefined identifier to indicate this is a D version 2.0 compiler) |
|---|
| 42 |
$(LI Added $(CODE .idup) property for arrays to create immutable |
|---|
| 43 |
copies.) |
|---|
| 44 |
$(LI Added transitive const and immutable.) |
|---|
| 45 |
$(LI $(CODE in) parameter storage class now means scope const.) |
|---|
| 46 |
$(LI class and struct invariant declarations now must have a ().) |
|---|
| 47 |
$(LI Added $(CODE isSame) and $(CODE compiles) to $(D_KEYWORD __traits).) |
|---|
| 48 |
$(LI Added $(LINK2 statement.html#ForeachRangeStatement, ForeachRangeStatement)). |
|---|
| 49 |
) |
|---|
| 50 |
|
|---|
| 51 |
) |
|---|
| 52 |
|
|---|
| 53 |
$(SECTION2 Phobos Library Changes, |
|---|
| 54 |
|
|---|
| 55 |
$(UL |
|---|
| 56 |
$(LI $(LINK2 phobos/std_algorithm.html, std.algorithm): new module) |
|---|
| 57 |
$(LI $(LINK2 phobos/std_bitarray.html, std.bitarray): scheduled for deprecation) |
|---|
| 58 |
$(LI $(LINK2 phobos/std_bitmanip.html, std.bitmanip): new module with the content of std.bitarray plus the bitfields, FloatRep, and DoubleRep templates) |
|---|
| 59 |
$(LI $(LINK2 phobos/std_contracts.html, std.contracts): new module) |
|---|
| 60 |
$(LI $(LINK2 phobos/std_conv.html, std.conv): |
|---|
| 61 |
Added $(CODE parse) and $(CODE assumeUnique). |
|---|
| 62 |
Made $(CODE conv_error) a template parameterized on the types being |
|---|
| 63 |
converted. |
|---|
| 64 |
Massive additions.) |
|---|
| 65 |
$(LI $(LINK2 phobos/std_file.html, std.file): added $(CODE dirEntries).) |
|---|
| 66 |
$(LI $(LINK2 phobos/std_format.html, std.format): |
|---|
| 67 |
Added raw ('r') format specifier for writef*.) |
|---|
| 68 |
$(LI $(LINK2 phobos/std_functional.html, std.functional): new module) |
|---|
| 69 |
$(LI $(LINK2 phobos/std_getopt.html,std.getopt): new module.) |
|---|
| 70 |
$(LI $(LINK2 phobos/std_hiddenfunc.html, std.hiddenfunc): new module) |
|---|
| 71 |
$(LI $(LINK2 phobos/std_math.html, std.math): Made nextafter visible for all floating types. Added approxEqual template.) |
|---|
| 72 |
$(LI $(LINK2 phobos/std_numeric.html, std.numeric): new module) |
|---|
| 73 |
$(LI $(LINK2 phobos/std_path.html, std.path): |
|---|
| 74 |
Added $(CODE rel2abs) (Linux version only). |
|---|
| 75 |
Added the basename and dirname functions (which alias the |
|---|
| 76 |
less gainful names getBaseName and getDirectoryName)) |
|---|
| 77 |
$(LI $(LINK2 phobos/std_process.html, std.process): |
|---|
| 78 |
Made getpid visible in Linux builds) |
|---|
| 79 |
$(LI $(LINK2 phobos/std_stdio, std.stdio): |
|---|
| 80 |
Added $(CODE writeln()) and $(CODE write()), |
|---|
| 81 |
$(CODE writef()) can now only accept a format as its first argument. |
|---|
| 82 |
Added optional terminator to $(CODE readln). |
|---|
| 83 |
Added functions $(CODE fopen), $(CODE popen), |
|---|
| 84 |
$(CODE lines) and $(CODE chunks).) |
|---|
| 85 |
$(LI $(LINK2 phobos/std_string.html, std.string): |
|---|
| 86 |
Added munch function and added function chompPrefix.) |
|---|
| 87 |
$(LI $(LINK2 phobos/std_random, std.random): |
|---|
| 88 |
Major addition of engines and distributions.) |
|---|
| 89 |
$(LI $(LINK2 phobos/std_traits.html, std.traits): new module) |
|---|
| 90 |
$(LI $(LINK2 phobos/std_typecons, std.typecons): new module) |
|---|
| 91 |
$(LI $(LINK2 phobos/std_variant.html, std.variant): new module.) |
|---|
| 92 |
|
|---|
| 93 |
$(LI Incorporated many of the Tango GC structural differences (much more to go still).) |
|---|
| 94 |
$(LI Overhaul phobos $(TT linux.mak) and add documentation build logic) |
|---|
| 95 |
$(LI Moved $(B next) member from $(B Object.Error) to $(B Object.Exception)) |
|---|
| 96 |
$(LI Renamed linux library from $(B libphobos.a) to $(B libphobos2.a)) |
|---|
| 97 |
|
|---|
| 98 |
) |
|---|
| 99 |
|
|---|
| 100 |
) |
|---|
| 101 |
|
|---|
| 102 |
|
|---|
| 103 |
) |
|---|
| 104 |
|
|---|
| 105 |
Macros: |
|---|
| 106 |
TITLE=D 2.0 Specific Features |
|---|
| 107 |
WIKI=D2Features |
|---|