Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

460 lines (417 sloc) 19.089 kb
DDOC=
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US">
<!--
Copyright (c) 1999-$(YEAR) by Digital Mars
All Rights Reserved Written by Walter Bright
http://digitalmars.com
-->
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="keywords" content="$(META_KEYWORDS)" />
<meta name="description" content="$(META_DESCRIPTION)" />
<title>$(TITLE) - D Programming Language</title>
<link rel="stylesheet" href="/css/codemirror.css" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<link rel="stylesheet" type="text/css" href="css/print.css" media="print" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
<script src="/js/codemirror.js"></script>
<script src="/js/run-main-website.js" type="text/javascript"></script>
<script src="/js/d.js"></script>
<script src="/js/run.js" type="text/javascript"></script>
<link rel="shortcut icon" href="favicon.ico" />
<script src="/js/hyphenate.js" type="text/javascript"></script>
<script type="text/javascript">
function bodyLoad()
{
var links = document.getElementById("navigation").getElementsByTagName("a");
for (var i = 0; i < links.length; i++)
{
var url = "/" + links[i].getAttribute("href");
if (window.location.href.match(url + "\x24") == url)
{
var cls = links[i].getAttribute("class");
links[i].setAttribute("class", cls ? cls + " active" : "active");
break;
}
}
}
</script>
</head>
<body onLoad='bodyLoad()'>
<div id="top">
<div id="search-box">
<form method="get" action="http://google.com/search">
<img src="/images/search-left.gif" width="11" height="22" /><input id="q" name="q" /><input type="image" id="search-submit" name="submit" src="/images/search-button.gif" />
<input type="hidden" id="domains" name="domains" value="dlang.org" />
<input type="hidden" id="sourceid" name="sourceid" value="google-search" />
<div id="search-dropdown">
<select id="sitesearch" name="sitesearch" size="1">
<option value="dlang.org">Entire D Site</option>
<option value="dlang.org/phobos">Library Reference</option>
<option value="digitalmars.com/d/archives">Newsgroup Archives</option>
</select>
</div>
</form>
</div>
<div id="header">
<a id="d-language" href="/">
<img id="logo" width="125" height="95" border="0" alt="D Logo" src="images/dlogo.png">
D Programming Language</a>
</div>
</div>
$(BODY)
$(FOOTER)
</body>
</html>
PAGE_TOOLS=
<div id="tools">
<!--span id="lastupdate">Last update $(DATETIME)</span-->
<a href="https://github.com/D-Programming-Language/d-programming-language.org/edit/master/$(SRCFILENAME)" class="tip button">
Improve this page
<span>
Quickly fork, edit online, and submit a pull request for this page.
Requires a signed-in GitHub account. This works well for small changes.
If you'd like to make larger changes you may want to consider using
local clone.
</span>
</a>
<a href="http://www.prowiki.org/wiki4d/wiki.cgi?DocComments/$(WIKI)" class="tip button">
Page wiki
<span>
View or edit the community-maintained wiki page associated with this page.
</span>
</a>
</div>
GOOGLE_TRANSLATE=
<div id="translate" class="tool">Translate this page:
<div id="google_translate_element"></div><script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({
pageLanguage: 'en',
autoDisplay: false,
layout: google.translate.TranslateElement.InlineLayout.SIMPLE
}, 'google_translate_element');
}
</script>
<script type="text/javascript" src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
</div>
GOOGLE_FOOTER=
<div id="google_ad">
<!-- Google ad -->
<script type="text/javascript"><!--
/**/google_ad_client = "pub-5628673096434613";
/**/google_ad_width = 728;
/**/google_ad_height = 90;
/**/google_ad_format = "728x90_as";
/**/google_ad_channel ="3651639259";
/**/google_page_url = document.location;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
GOOGLE_REFERRAL=
<br><br>
<br><br>
<script type="text/javascript"><!--
/**/google_ad_client = "pub-5628673096434613";
/* 180x150, created 2/18/08 */
/**/google_ad_slot = "4228873179";
/**/google_ad_width = 180;
/**/google_ad_height = 150;
/**/google_cpa_choice = ""; // on file
//-->
</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
GOOGLE_REFERRAL=
COPYRIGHT=
Copyright &copy; 1999-$(YEAR) by Digital Mars &reg;, All Rights Reserved
FOOTER=
<div id="footernav">
<a href="http://forum.dlang.org/" title="User Forums">Forums</a> |
<a href="http://www.prowiki.org/wiki4d/wiki.cgi?DocComments/$(WIKI)" title="Read/write comments and feedback">Comments</a> |
<a href="http://digitalmars.com/advancedsearch.html" title="Search Digital Mars web site">Search</a> |
<a href="download.html" title="Download D">Downloads</a> |
<a href="/">Home</a>
</div>
<div id="copyright">
$(COPYRIGHT) |
Page generated by $(LINK2 ddoc.html, Ddoc) on $(DATETIME)
</div>
NAVIGATION_COMMUNITY=
<div class="navblock">
$(UL
$(TOCENTRY comparison.html, D Feature List)
$(TOCENTRY builtin.html, Rationale for Builtins)
$(TOCENTRY ctod.html, Converting C to D)
$(TOCENTRY cpptod.html, Converting C++ to D)
$(TOCENTRY pretod.html, The C Preprocessor vs D)
$(REDO $(TOCENTRY template-comparison.html, D templates compared))
$(REDO $(TOCENTRY cppstrings.html, D strings vs C++ std::string))
$(TOCENTRY cppdbc.html, D Contract Programming vs C++)
$(REDO $(TOCENTRY cpp0x.html, D and C++0x))
)
</div>
$(BOOKS)
$(TRANSLATIONS)
$(GOOGLE_REFERRAL)
NAVIGATION=
$(NAVBLOCK_HEADER $(TOCHEADERL index.html, D Programming Language, D Home),
$(TOCENTRYTH overview.html, D language overview, Overview, $(CATEGORY_OVERVIEW $(SUBNAV_OVERVIEW)))
$(TOCENTRYTH comparison.html, D feature list, Features, $(CATEGORY_FEATURES $(SUBNAV_FEATURES)))
$(TOCENTRYTH download.html, Download a D compiler, Downloads &amp; Tools, $(CATEGORY_DOWNLOAD $(SUBNAV_DOWNLOAD)))
$(TOCENTRYT changelog.html, History of changes to D, Change Log)
$(TOCENTRYT bugstats.php, D issue and bug tracking system, Bug Tracker)
$(TOCENTRYTH faq.html, Frequently Asked Questions, FAQ, $(CATEGORY_FAQ $(SUBNAV_FAQ)))
$(TOCENTRYH appendices.html, Appendices, $(CATEGORY_APPENDICES $(SUBNAV_APPENDICES)))
$(TOCENTRYT acknowledgements.html, Thank-you to these people who have helped with D, Acknowledgments)
$(TOCENTRYT sitemap.html, Documents on this site$(COMMA) indexed alphabetically, Sitemap)
$(TOCENTRYT http://digitalmars.com/d/1.0/index.html, D Programming Language 1.0, D1 Home)
)
$(NAVBLOCK_HEADER $(TOCHEADER Documentation),
$(LI $(AMAZONLINK 0321635361, Book))
$(TOCENTRY http://www.informit.com/articles/article.aspx?p=1381876, &nbsp;<font size=-1><span style="visibility: hidden">3</span>1.&nbsp;Tutorial</font>)
$(TOCENTRY http://www.informit.com/articles/article.aspx?p=1609144, &nbsp;<font size=-1>13.&nbsp;Concurrency</font>)
$(TOCENTRYH language-reference.html, Language Reference, $(CATEGORY_SPEC $(SUBNAV_SPEC)))
$(TOCENTRY phobos/index.html, Library Reference)
$(TOCENTRYTH howtos.html, Helps for using D, How-tos, $(CATEGORY_HOWTOS $(SUBNAV_HOWTOS)))
$(TOCENTRYH articles.html, Articles, $(CATEGORY_ARTICLES $(SUBNAV_ARTICLES)))
)
$(NAVBLOCK_HEADER $(TOCHEADER Community),
$(TOCENTRYT http://forum.dlang.org/, User forums, Forums)
$(TOCENTRYT http://github.com/D-Programming-Language, D on github, GitHub)
$(TOCENTRYT http://prowiki.org/wiki4d/wiki.cgi?FrontPage, Wiki for the D Programming Language, Wiki)
$(TOCENTRYT http://prowiki.org/wiki4d/wiki.cgi?ReviewQueue, Queue of current and upcoming standard library additions, Review Queue)
$(TOCENTRYT http://twitter.com/#search?q=%23d_lang, #d_lang on twitter.com, Twitter)
$(TOCENTRYT http://digitalmars.com/d/dlinks.html, External D related links, Links)
$(TOCENTRYX http://d.puremagic.com/conference2008/, D Programming Language Conference, Conference)
)
SUBNAV_OVERVIEW=
$(NAVBLOCK
$(TOCENTRYT wc.html, wc - the wordcount program, Example: wc)
$(TOCENTRYT warnings.html, Explanation of D compiler generated warning messages, Warnings)
$(TOCENTRY builtin.html, Rationale for Builtins)
$(TOCENTRY ctod.html, Converting C to D)
$(TOCENTRY cpptod.html, Converting C++ to D)
$(TOCENTRY pretod.html, The C Preprocessor vs D)
$(REDO $(TOCENTRY template-comparison.html, D templates compared))
$(REDO $(TOCENTRY cppstrings.html, D strings vs C++ std::string))
$(REDO $(TOCENTRY cppdbc.html, D Contract Programming vs C++))
$(REDO $(TOCENTRY cpp0x.html, D and C++0x))
)
SUBNAV_FEATURES=
$(NAVBLOCK
$(TOCENTRYT features2.html, Language changes for D, Features)
)
SUBNAV_DOWNLOAD=
$(NAVBLOCK
$(TOCENTRYT dmd-linux.html, dmd - the Digital Mars D compiler, Linux notes)
$(TOCENTRYT dmd-windows.html, dmd - the Digital Mars D compiler, Windows notes)
$(TOCENTRYT dmd-osx.html, dmd - the Digital Mars D compiler, Mac OSX notes)
$(TOCENTRYT dmd-freebsd.html, dmd - the Digital Mars D compiler, FreeBSD notes)
$(TOCENTRYT http://bitbucket.org/goshawk/gdc/wiki/Home, gdc - the Gnu D compiler, GDC D Compiler)
$(TOCENTRYT http://digitalmars.com/ctg/optlink.html, Optlink - the Digital Mars Linker, Linker)
$(TOCENTRYT http://digitalmars.com/ctg/trace.html, DMD's builtin code profiling tool, Profiler)
$(TOCENTRYT code_coverage.html, DMD's builtin code coverage analysis tool, Code Coverage)
$(TOCENTRYT rdmd.html, rdmd - run D programs as if they were scripts, DMD Script Shell)
$(TOCENTRYT windbg.html, windbg - debugging Windows programs, Windows Debugger)
$(TOCENTRYT htod.html, htod - mechanically convert C .h header files to D, C .h to D .d)
$(TOCENTRYT http://www.prowiki.org/wiki4d/wiki.cgi?EditorSupport, Editors with support for D, Editors)
$(TOCENTRYT http://www.prowiki.org/wiki4d/wiki.cgi?ReferenceForTools, Even more tools for D, More Tools)
)
SUBNAV_FAQ=
$(NAVBLOCK
$(TOCENTRYT const-faq.html, Frequently Asked Questions about const, const(FAQ))
$(TOCENTRYT rationale.html, Answers to questions about D design decisions, Rationale)
)
SUBNAV_APPENDICES=
$(NAVBLOCK
$(TOCENTRYT dstyle.html, Recommended programming style conventions, Style Guide)
$(TOCENTRYT glossary.html, D acronyms and jargon explained, Glossary)
$(TOCENTRYT ascii-table.html, Handy ascii chart, Ascii Table)
)
SUBNAV_SPEC=
$(NAVBLOCK
$(TOCENTRY lex.html, Lexical)
$(TOCENTRY module.html, Modules)
$(TOCENTRY declaration.html, Declarations)
$(TOCENTRY type.html, Types)
$(TOCENTRY property.html, Properties)
$(TOCENTRY attribute.html, Attributes)
$(TOCENTRY pragma.html, Pragmas)
$(TOCENTRY expression.html, Expressions)
$(TOCENTRY statement.html, Statements)
$(TOCENTRY arrays.html, Arrays)
$(TOCENTRY hash-map.html, Associative Arrays)
$(TOCENTRY struct.html, Structs &amp; Unions)
$(TOCENTRY class.html, Classes)
$(TOCENTRY interface.html, Interfaces)
$(TOCENTRY enum.html, Enums)
$(TOCENTRY const3.html, Const and Immutable)
$(TOCENTRY function.html, Functions)
$(TOCENTRY operatoroverloading.html, Operator Overloading)
$(TOCENTRY template.html, Templates)
$(TOCENTRY template-mixin.html, Template Mixins)
$(TOCENTRY dbc.html, Contracts)
$(TOCENTRY version.html, Conditional Compilation)
$(TOCENTRY simd.html, Vector Extensions)
$(TOCENTRY traits.html, Traits)
$(TOCENTRY errors.html, Handling errors)
$(TOCENTRY unittest.html, Unit Tests)
$(TOCENTRY garbage.html, Garbage Collection)
$(TOCENTRY float.html, Floating Point)
$(TOCENTRY iasm.html, Inline Assembler)
$(TOCENTRY ddoc.html, Documentation Comments)
$(TOCENTRY interfaceToC.html, Interfacing To C)
$(TOCENTRY cpp_interface.html, Interfacing To C++)
$(TOCENTRY portability.html, Portability Guide)
$(TOCENTRY entity.html, Named Character Entities)
$(TOCENTRY memory-safe-d.html, Memory Safe D Spec)
$(TOCENTRY abi.html, Application Binary Interface)
)
SUBNAV_HOWTOS=
$(NAVBLOCK
$(TOCENTRYT windows.html, D implementation for 32 bit Windows systems, D for Win32)
$(TOCENTRYT dll.html, Writing 32 bit Windows DLLs in D, Win32 DLLs in D)
$(TOCENTRYT COM.html, Windows COM Programming, COM Programming)
$(TOCENTRYT 32-64-portability.html, Porting 32 Bit Code to 64 Bits, Porting to 64 Bits)
$(TOCENTRYT htomodule.html, converting C .h header files to D modules, C .h to D Modules)
$(TOCENTRYT http://digitalmars.com/techtips/index.html, Programming tips, Tech Tips)
)
SUBNAV_ARTICLES=
$(NAVBLOCK
$(TOCENTRYT const3.html, Const and Immutable, Const)
$(TOCENTRYT d-floating-point.html, D Floating Point, Floating Point)
$(TOCENTRYT exception-safe.html, Exception safe programming techniques, Exception Safety)
$(TOCENTRYT hijack.html, Function Hijacking Mitigation, Hijacking)
$(TOCENTRYT intro-to-datetime.html, Introduction to std.datetime, Introduction to std.datetime)
$(TOCENTRYT lazy-evaluation.html, Lazy evaluation of function arguments, Lazy Evaluation)
$(TOCENTRYT memory.html, Memory management techniques in D, Memory Management)
$(TOCENTRYT migrate-to-shared.html, Migrating to Shared, Migrating to Shared)
$(TOCENTRYT mixin.html, String mixins compile string literals into D programs, Mixins)
$(TOCENTRYT regular-expression.html, Programming with regular expressions, Regular Expressions)
$(TOCENTRYT safed.html, SafeD - The Safe Subset of D, SafeD)
$(TOCENTRYT templates-revisited.html, D takes a fresh look at template design, Templates Revisited)
$(TOCENTRYT tuple.html, What tuples are and how to use them, Tuples)
$(TOCENTRYT variadic-function-templates.html, Variadic arguments to templates, Variadic Templates)
$(TOCENTRYT d-array-article.html, D Slices, D Slices)
)
D_S = $(LAYOUT $(NAVIGATION),$1,$(ARGS $+))
SPEC_S = $(LAYOUT $(NAVIGATION),$1,$(ARGS $+))
COMMUNITY= $(LAYOUT $(NAVIGATION),$1,$(ARGS $+))
PDF_COVER= $0
LAYOUT=
<div id="navigation">
$1
$(GOOGLE_TRANSLATE)
</div><!--/navigation-->
<div id="content" class='hyphenate'>
$(PAGE_TOOLS)
<h1>$(TITLE)</h1>
$3
$(GOOGLE_FOOTER)
</div><!--/content-->
NAVBLOCK=
<div class="navblock">
$(UL $0)
</div>
NAVBLOCK_HEADER=
<div class="navblock">
$1
$(UL $(ARGS $+))
</div>
TOCHEADER = <h2>$0</h2>
TOCHEADERL = <h2><a href="$1" title="$2">$3</a></h2>
TOCENTRY = $(LI $(LINK2 $1, $2))
TOCENTRYT = $(LI <a href="$1" title="$2">$3</a>)
TOCENTRYH = $(LI $(LINK2 $1, $2)$3)
TOCENTRYTH = $(LI <a href="$1" title="$2">$3</a>$4)
ARGS=$0
RPAREN = )
LPAREN = (
TABLE1 = <table border=1 cellpadding=4 cellspacing=0>$0</table>
TABLE2 = <center><table border=1 cellpadding=4 cellspacing=0><caption>$1</caption>$+</table></center>
TH=<th scope="col">$0</th>
BLOCKQUOTE = <blockquote><p>$+</p><cite>$1</cite></blockquote>
BLOCKQUOTE_PLAIN = <blockquote><p>$0</p></blockquote>
TT=<tt>$0</tt>
SUB=<sub>$0</sub>
LNAME2=<a name="$1">$+</a>
SECTION1=<h1>$1</h1>$+
SECTION2=<h2>$1</h2>$+
SECTION3=<h3>$1</h3>$+
SECTION4=<h4>$1</h4>$+
SINGLEQUOTE= &lsquo;$0&rsquo;
DOUBLEQUOTE= &ldquo;$0&rdquo;
NOTRANSLATE=<code>$0</code>
NOTRANSLATE=<span class="notranslate">$0</span>
D_CODE = <pre class="d_code">$(NOTRANSLATE $0)</pre>
D_COMMENT = <span class="d_comment">$0</span>
D_STRING = <span class="d_string">$0</span>
D_KEYWORD = <span class="d_keyword">$0</span>
D_PSYMBOL = <span class="d_psymbol">$0</span>
D_PARAM = <span class="d_param">$0</span>
D = $(NOTRANSLATE <span class="d_inlinecode">$0</span>)
CODE=$(D $0)
CCODE=<pre class="ccode">$(NOTRANSLATE $0)</pre>
CPPCODE=<pre class="cppcode">$(NOTRANSLATE $0)</pre>
GRAMMAR=<pre class="bnf">$(NOTRANSLATE $0)</pre>
DDOCCODE=<pre class="ddoccode">$(NOTRANSLATE $0)</pre>
SCINI=<pre class="scini">$(NOTRANSLATE $0)</pre>
CONSOLE=<pre class="console">$(NOTRANSLATE $0)</pre>
MODDEFFILE=<pre class="moddeffile">$(NOTRANSLATE $0)</pre>
MDASH=<nobr>&#x200A;&mdash;&#x200A;</nobr>
NEWS=http://digitalmars.com/drn-bin/wwwnews?$1/$+
NEWS=http://digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=$1&artnum=$+
NEWS=http://digitalmars.com/webnews/newsgroups.php?search_txt=&group=$1&article_id=$+
NEWSGROUP=http://digitalmars.com/webnews/newsgroups.php?search_txt=&group=$0
NG_cpp = <a href="$(NEWS c%2B%2B,$0)">c++/$0</a>
NG_cpp_beta = <a href="$(NEWS c%2B%2B.beta,$0)">c++.beta/$0</a>
NG_cpp_command_line = <a href="$(NEWS c%2B%2B.command-line,$0)">c++.command-line/$0</a>
NG_D = <a href="$(NEWS D.gnu,$0)">D/$0</a>
NG_D_gnu = <a href="$(NEWS D.gnu,$0)">D.gnu/$0</a>
NG_digitalmars_D = <a href="$(NEWS digitalmars.D,$0)">D/$0</a>
NG_digitalmars_D_bugs = <a href="$(NEWS digitalmars.D.bugs,$0)">D.bugs/$0</a>
NG_digitalmars_D_learn = <a href="$(NEWS digitalmars.D.learn,$0)">D.learn/$0</a>
NG_digitalmars_D_announce = <a href="$(NEWS digitalmars.D.announce,$0)">D.announce/$0</a>
NG_DMDScript = <a href="$(NEWS DMDScript,$0)">DMDScript/$0</a>
OPT=<sub>opt</sub>
GLINK=$(LINK2 #$0, $(I $0))
GLINK2=$(LINK2 $1.html#$2, $(I $2))
GNAME=$(LNAME2 $0, $(I $0))
DDLINK=$(LINK2 $1.html, $3)
DDSUBLINK=$(LINK2 $1.html#$2, $3)
DPLLINK=$(LINK2 $1, $2)
NOT_EBOOK=$0
ASSIGNEXPRESSION=$(GLINK2 expression, AssignExpression)
ISEXPRESSION=$(GLINK2 expression, IsExpression)
META_KEYWORDS=D programming language
META_DESCRIPTION=D Programming Language
ACRONYM=<acronym title="$+">$1</acronym> ($+)
SFINAE=$(LINK2 glossary.html#sfinae, $(ACRONYM SFINAE, Substitution Failure Is Not An Error))
COMMA=,
VER=2.0
V1=
V2=$0
DIGG=<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>
SLASHDOT=<script src="http://slashdot.org/slashdot-it.js" type="text/javascript"></script>
HOMEIMG=<img src="home.png" border=0 alt="digitalmars.com">
SEARCHIMG=<img src="search.png" border=0 alt="Search">
DOWNLOADIMG=<img src="images/download.png" border=0 alt="Download">
WIKIIMG=<img src="wiki.png" border=0 alt="D Wiki">
DIMG=<img src="d.png" border=0 alt="D Programming Language">
NEWSIMG=<img src="http://digitalmars.com/news.png" border=0 alt="User Forums">
OBJ2ASM=$(LINK2 http://digitalmars.com/ctg/obj2asm.html, obj2asm)
DUMPOBJ=$(LINK2 http://digitalmars.com/ctg/dumpobj.html, dumpobj)
SHELL=$(LINK2 http://digitalmars.com/ctg/shell.html, shell)
PHOBOSSRC=$(LINK2 https://github.com/D-Programming-Language/phobos/blob/master/$0, $0)
DRUNTIMESRC=$(LINK2 https://github.com/D-Programming-Language/druntime/blob/master/src/$0, $0)
SAMPLESRC=$(LINK2 https://github.com/D-Programming-Language/dmd/blob/master/samples/$0, /dmd/samples/d/$0)
DOLLAR=$
AMAZON= <iframe src="http://rcm.amazon.com/e/cm?t=classicempire&o=1&p=8&l=as1&asins=$0&fc1=000000&IS2=1&lt1=_blank&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>
AMAZONLINK= $(LINK2 http://www.amazon.com/exec/obidos/ASIN/$1/classicempire, $+)
WEB = $(LINK2 http://$1,$2)
LUCKY = $(WEB
google.com/search?btnI=I%27m+Feeling+Lucky&amp;ie=UTF-8&amp;oe=UTF-8&amp;q=$0,$0)
FOO=FOO
Jump to Line
Something went wrong with that request. Please try again.