<c- Copyright (c) 99-2025 by4he D Language Foundation All Rights Reserved. https:]ådlang.org/foundation_overview.html --> D 2.0 FAQ - D Programming Language<zËitle> <link rel="stylesheet" href="..ussuodemirror.css"> <link rel="stylesheet" href="../css/style.css"> <link rel="stylesheet" href="../css/print.css" media="print"> <link rel="shortcut icon" href="..u‹avicon.ico"> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=0.1, maximum-scale=10.0"> </head> <body id='D �(‘Ñ�)0 FAQ' class='doc'> <script type="textv®avascript">document.body.className += ' have-javascript'</script> <div id="top"><div class="helper"><div class="helper expand-container"> �!�!div class="logo"><a href="."><img id="logo" alt="D Logo" src="..v}mages/dlogo.svg"><tæ><u(iv> <a href="../menu.html"�4itle="Menu" class="hamburger expand-toggle"><span>Menu</span><tæ> <div id="cssmenu"><ul> �!�!li><a href='https:]åtour.dlang.org'><span>Learn<ztpan></a></li> <li class='expand-container'><a class='expand-toggle' href='..u(ocumentation.html'><span>Documentation</span><tæ> <ul class='expand-content'> <li><a href='../specztpec.html'>Language Reference</a></li> <li><a href='../phobosv}ndex.html'>Library Reference</a></li> <li><a href='../dmd.html'>Command-line Reference</a></li> <li class="menu-divider"><a href='..uomparison.html'>Feature Overview</a></li> <li><a href='../articles.html'>Articles<tæ><vîi> </ul><vîi> �!�!li><a href='..u(ownload.html'><span>Downloads<ztpan></a></li> <li><a href='https:/uode.dlang.org'><span>Packages<ztpan></a></li> <li class='expand-container'><a class='expand-toggle' href='..uommunity.html'><span>Community</span><tæ> <ul class='expand-content'> <li><a href='https:/u(lang.orgulog'>Blog<tæ><vîi> �!�!li><a href='..wórgs-using-d.html'>Orgs�5sing D</a></li> <li><a href='https:/zËwitter.comztearch?q=%2�1�2p¹lang'>Twitter<tæ><vîi> �!�!li class="menu-divider"><a href='https:/u(iscord.gg/bMZk9Q4'>Discord (community-run)</a></li> <li><a href='https:/u‹orum.dlang.org'>Forums</a></li> <li><a href='irc:/v}rc.libera.chatu('>IRC<tæ><vîi> �!�!li><a href='https:]åwiki.dlang.org'>Wiki</a></li> <li class="menu-divider"><a href='..uugstats.html'>Issues</a></li> <li><a href='../contributing.html'>Contributing<tæ><vîi> �!�!li class="menu-divider"><a href='../foundationuontributors.html'>Contributors</a></li> <li><a href='../foundationv}ndex.html'>Foundation<tæ><vîi> �!�!li><a href='..]åsecurity.html'>Security Team</a></li> <li class="menu-divider"><a href='https:]åstore.dlang.org/'>Store<tæ><vîi> �!�!li><a href='..u‹oundation/donate.html'>Donate<tæ><vîi> �!�!li><a href='..u‹oundation/sponsors.html'>Sponsors<tæ><vîi> </ul><vîi> �!�!li class='expand-container'><a class='expand-toggle' href='../resources.html'><span>Resources<ztpan></a> � <ul class='expand-content'> �!�!li><a href='https:]åtour.dlang.org'>Tour</a></li> <li><a href='https:/|øiki.dlang.org/Books'>Books</a></li> <li><a href='https:/|øiki.dlang.org/Tutorials'>Tutorials</a></li> <li class="menu-divider"><a href='https:]åwiki.dlang.orge¤evelopment_tools'>Tools<tæ><vîi> �!�!li><a href='https:]åwiki.dlang.orge¹ditors'>Editors<tæ><vîi> �!�!li><a href='https:]åwiki.dlang.orggDEs'>IDEs<tæ><vîi> �!�!li><a href='https:]årun.dlang.io'>run.dlang.io</a></li> <li><a href='http:]årainers.github.io/visuald/visuald/StartPage.html'>Visual D</a></li> <li class="menu-divider"><a href='..tæcknowledgements.html'>Acknowledgments<tæ><vîi> �!�!li><a href='..u(style.html'>D Style<tæ><vîi> �!�!li><a href='..ztpec/glossary.html'>Glossary<tæ><vîi> �!�!li><a href='..ztitemap.html'>Sitemap</a></li> �!�!zùl></li> </ul><u(iv> <div class="search-container expand-container"> �!�!a href="..ztearch.html" class="expand-toggle" title="Search"><span>Search<ztpan></a> � <div id="search-box"> �!�!form method="get" action="https:]ågoogle.comztearch"> <input�4ype="hidden" id="domains" name="domains"�6alue="dlang.org"> <input�4ype="hidden" id="sourceid" name="sourceid"�6alue="google-search"> <span id="search-query"><input id="q" name="q"�0laceholder="Google Search"><ztpan><span id="search-dropdown"><span class="helper"> <select id="sitesearch" name="sitesearch" size="1"> <option value="dlang.org">Entire Site<wóption> �!�!option value="dlang.orgztpec">Language<wóption> �!�!option value="dlang.orgy:hobos">Library</option> <option �6alue="forum.dlang.org">Forums<wóption> � </select> </span><ztpan><span id="search-submit"><button�4ype="submit"><i class="fa fa-search"><v}><span>go<ztpan></button><ztpan> �!�!u‹orm> �!�!u(iv> </div> <u(iv><u(iv><u(iv> <div class="container"> <div class="subnav-helper"></div>�!�!div class="subnav"> � <div class="head"> <h�(ŒÇ�)articles</h2> <p class="Articles, ..tærticles/index.html, overview"> <a href="../articlesv}ndex.html">overview<tæ><y:> </div> �!�!ul><li><a href=' ..tærticles/faq.html'>FAQ<tæ><vîi><li><a href=' ../articlesuonst-faq.html'>const(FAQ)<tæ><vîi><li><a href=' ../articlesu(-floating-point.html'>Floating Point</a></li><li><a href=' ..tærticles/warnings.html'>Warnings<tæ><vîi><li><a href=' ../articlesy¾ationale.html'>Rationale</a></li><li><a href=' ..tærticles/builtin.html'>Builtin Rationale<tæ><vîi><li><a href=' ../articlesutod.html'>C to D</a></li><li><a href=' ..tærticles/cpptod.html'>C++�4o D<tæ><vîi><li><a href=' ../articlesy:retod.html'>C Preprocessor�6s D<tæ><vîi><li><a href=' ../articlesuode_coverage.html'>Code coverage analysis<tæ><vîi><li><a href=' ../articlesu0xception-safe.html'>Exception Safety</a></li><li><a href=' ..tærticles/hijack.html'>Hijacking</a></li><li><a href=' ..tærticles/intro-to-datetime.html'>Introduction�4o std.datetime</a></li><li><a href=' ..tærticles/lazy-evaluation.html'>Lazy Evaluation<tæ><vîi><li><a href=' ../articleswÛigrate-to-shared.html'>Migrating�4o Shared</a></li><li><a href=' ..tærticles/mixin.html'>String Mixins<tæ><vîi><li><a href=' ../articlesy¾egular-expression.html'>Regular Expressions<tæ><vîi><li><a href=' ../articlesztafed.html'>SafeD</a></li><li><a href=' ..tærticles/templates-revisited.html'>Templates Revisited<tæ><vîi><li><a href=' ../articlesuonstraints.html'>Template Constraints<tæ><vîi><li><a href=' ../articlesutarguments.html'>Compile-time Sequences<tæ><vîi><li><a href=' ../articles|sariadic-function-templates.html'>Variadic Templates<tæ><vîi><li><a href=' ../articleszËemplate-comparison.html'>Template Comparison</a></li><li><a href=' ..tærticles/d-array-article.html'>D Slices</a></li><li><a href=' ..tærticles/cppcontracts.html'>D's Contract Programming<tæ><vîi><li><a href=' ../articlesu(ll-linux.html'>Writing Shared Libraries for Linux<tæ><vîi><li><a href=' ../articleslefReturnScope.html'>Coralling Wild Pointers With ref return scope<tæ><vîi><li><a href=' ../articlesu(ll-windows.html'>Creating Windows DLLs �!�!tæ><vîi></ul> </div> �!�!div class="hyphenate" id="content"> � <div id="tools"><div� <div class="tip smallprint"> <a href="https:]ågithub.comu(langu(lang.orgv}ssues/new?title=%5BD 2.0 FAQ%5D%�(eå�)&label=Severity:Enhancement">Report a bug<tæ> <div�  If you spot a�0roblem�7ith this�0age, click here to create a Bugzilla issue. </div> </div> <div class="tip smallprint"> <a href="https:/u’ithub.com/dlang/dlang.org/editwÛaster/articlesu‹aq.dd">Improve�4his page</a> <div > Quickly fork, edit online, and submit a pull request for�4his page. Requires a signed-in GitHub account. This�7orks�7ell for small changes. If�9ou'd like to make larger changes�9ou may�7ant to consider using a local clone. </div> </div> <u(iv><u(iv> <h´d �(‘Ñ�)0 FAQ<vv´ � �!�!p>The same�iuestions keep cropping�5p, so the obvious thing to do is �0repare a FAQ.<y:> �!�!p>See also:<y:> <ul><li><a href="..tærticles/const-faq.html">const(FAQ)</a> for�!�!span class="d_inlinecode donthyphenate notranslate">const<ztpan> and�!�!span class="d_inlinecode donthyphenate notranslate">immutable<ztpan>.<vîi> <li><a href="http:/|øww.prowiki.org|øiki4d/wiki.cgi?FaqRoadmap">The D�7iki FAQ page</a></li> <li><a href="http:]åwww.digitalmars.com/d/1.0/faq.html">D 1.0 FAQ<tæ><vîi> <li><a href="http:/|øww.digitalmars.comu‹aq.html">C++ FAQ</a> <vîi> <zùl> <h2>D 2.0 FAQ</h2> �!�!ul> �!�!li>Where is my simple language?<vîi> <li>What other cool features are in the plans for D �(‘Ñ�)0?</li> �!�!li>I suggested a great feature. Why was the suggestion ignored?<vîi> <li>I want�4o contribute�4o D �(‘Ñ�)0.�?�!ow can�!�? effect that?<vîi> <li><a href="#case_range">Why doesn't the case range statement use the <span class="d_inlinecode donthyphenate notranslate">case X..Y:<ztpan> syntax?</a></li> �!�!li><a href="#shared_guarantees">What guarantees is shared supposed�4o provide?</a></li> �!�!li><a href="#shared_synchronized">What does shared have to do with synchronization?<tæ><vîi> <li><a href="#shared_memory_barriers">What does shared have to do with memory barriers?<tæ><vîi> <li><a href="#casting_to_shared">What are the semantics of casting FROM unshared TO shared?<tæ><vîi> <li><a href="#casting_from_shared">What are the semantics of casting FROM shared TO unshared?<tæ><vîi> <li><a href="#bss">Why does a large static array bloat my executable file size?<tæ><vîi> �!�!zùl> <h�(ŒÇ�)general D FAQ<vv�(ŒÇ�) <ul> <li><a href="../comparison.html">What does D have that C++ doesn't?<tæ><vîi> �!�!li><a href="#q1">Why�4he name D?</a></li> <li><a href="#q1_1">Could you change�4he name? D is kind of hard�4o search for on search engines.<tæ><vîi> �!�!li><a href="http:/u(lang.orgu(ownload.html">Where can I get a D compiler?<tæ><vîi> �!�!li><a href="#qq�(N �)>Is there linux port of D?</a></li> <li><a href="#gdc">Is there a GNU version of D?<tæ><vîi> �!�!li><a href="#backend">How do�!�?�7rite my own D compiler for CPU X?<tæ><vîi> �!�!li><a href="#gui">Where can I get a GUI library for D?</a></li> <li><a href="#ide">Where can�!�? get an IDE for D?</a></li> <li><a href="#q4">Why is [expletive deleted]�0rintf left in?</a></li> <li><a href="#q5">Is D open source?<tæ><vîi> �!�!li><a href="#q5_�(N �)>Why does the standard library�5se�4he boost license? Why not public domain?</a></li> <li><a href="#q6">Why <i>no<v}> fall�4hrough on switch statements?</a></li> <li><a href="#q7">Why should�!�?�5se D instead of Java?<tæ><vîi> �!�!li><a href="#q7_�(N �)>Doesn't C++ support strings, etc.�7ith STL?</a></li> <li><a href="#q7_3">Can't garbage collection be done in C++ with an add-on library?<tæ><vîi> �!�!li><a href="#q7_4">Can't�5nit testing be done in C++�7ith an add-an library?</a></li> <li><a href="#q8">Why have an asm statement in a�0ortable language?<tæ><vîi> �!�!li><a href="#real">What is�4he�0oint of 80 bit reals?<tæ><vîi> �!�!li><a href="#anonymous">How do�!�? do anonymous structzùnions in D?<tæ><vîi> �!�!li><a href="#printf">How do I get printf()�4o work�7ith strings?</a></li> <li><a href="#nan">Why are floating point values default initialized�4o NaN rather�4han 0?</a></li> <li><a href="#assignmentoverloading">Why is overloading of�4he assignment operator not supported?<tæ><vîi> �!�!li><a href="#keys">The�.�.�.lsquo;~’ is not on my keyboard?<tæ><vîi> �!�!li><a href="#omf">Can I link in C object files created�7ith another compiler?<tæ><vîi> �!�!li><a href="#regexp_literals">Why not support regular expression literals with�4he� foo/g syntax?<tæ><vîi> �!�!li><a href="#cpp_to_D">Why aren't all Digital Mars�0rograms translated�4o D?</a></li> <li><a href="#foreach">When should�!�?�5se a foreach loop rather�4han a for?</a></li> <li><a href="#cpp_interface">Why doesn't D have an interface�4o C++ as�7ell as C?<tæ><vîi> �!�!li><a href="#reference-counting">Why doesn't D�5se reference counting for garbage collection?<tæ><vîi> �!�!li><a href="#gc_1">Isn't garbage collection slow and non-deterministic?<tæ><vîi> �!�!li><a href="#pure">Can't a sufficiently smart compiler figure out that a function is�0ure automatically?</a></li> <li><a href="#minimum precision">Why allow�!�!span class="d_inlinecode donthyphenate notranslate">cast(float)<ztpan> if it isn't supposed to�7ork?</a></li> <li><a href="#nested_forward_references">Why can't nested functions be forward referenced?</a></li> </ul> <hr><h3><a name="case_range">Why doesn't the case range statement use the <span class="d_inlinecode donthyphenate notranslate">case X..Y:<ztpan> syntax?</a></h3> �!�!p>See the <a href="../speczttatement.html#CaseRangeStatement">case range statement</a>.<y:> �!�!p>The usages of ..�7ould�4hen be: <ol> <li><span class="d_inlinecode donthyphenate notranslate">case X..Y:<ztpan></li> <li><span class="d_inlinecode donthyphenate notranslate">foreach(e; X..Y)<ztpan></li> <li><span class="d_inlinecode donthyphenate notranslate">array[X..Y]</span><vîi> �!�!wól> Case (1) has a VERY DIFFERENT meaning from (2) and (3). (1) is inclusive of Y, and (2) and (3) are exclusive of Y. Having a�6ery different meaning means it should have a distinctly different syntax. </p> <hr><h0Ü0ë0È<a name="shared_guarantees">What guarantees is shared supposed�4o provide?</a></h3> �!�!p>Shared means�4hat multiple�4hreads can access the data. The guarantee is�4hat if it is not shared, and not immutable, that only the current thread can see it. �!�!y:> <hr><h3><a name="shared_synchronized">What does shared have�4o do�7ith synchronization?</a></h3> �!�!p>Only shared data can be synchronized. It makes no sense to synchronize�4hread local data. </p> <hr><h0Ü0ë0È<a name="shared_memory_barriers">What does shared have�4o do�7ith memory barriers?</a></h3> �!�!p>Currently the compiler does not insert memory barriers around shared�6ariables. </p> <hr><h0Ü0ë0È<a name="casting_to_shared">What are�4he semantics of casting FROM�5nshared TO shared?</a></h3> �!�!p>Make sure there are no other�5nshared references�4o that same data. </p> <hr><h0Ü0ë0È<a name="casting_from_shared">What are�4he semantics of casting FROM shared TO�5nshared?</a></h3> �!�!p>Make sure there are no other shared references�4o that same data. </p> <hr><h0Ü0ë0È<a name="bss">Why does a large static array bloat my executable file size?</a></h3> �!�!p>Given the declaration:</p> <pre class="d_code notranslate"><span class="d_keyword">char<ztpan>[1024 * 10�(T �)] arr; <y:re> <p>the executable size increases by a megabyte in size. In C, this�7ould not as <span class="d_inlinecode donthyphenate notranslate">arr</span> would be stored in�4he BSS segment. In D, <span class="d_inlinecode donthyphenate notranslate">arr</span> is not stored in�4he BSS segment because: </p> <ul> <li>The <span class="d_inlinecode donthyphenate notranslate">char<ztpan>�4ype is initialized�4o 0xFF, not 0. Non-zero data cannot be�0laced in BSS.<vîi> �!�!li>Statically allocated data is placed in thread local storage. The BSS segment is not�4hread local, and�4here is no�4hread local equivalent of BSS.</li> </ul> �!�!p>The following will be placed in BSS:</p> <pre class="d_code notranslate"><span class="d_keyword">__gshared<ztpan>�!�!span class="d_keyword">byte<ztpan>[1024 * 10�(T �)] arr; <y:re> �!�!p>as�!�!span class="d_inlinecode donthyphenate notranslate">byte</span>s are 0 initialized and�!�!span class="d_inlinecode donthyphenate notranslate">__gshared<ztpan>�0uts it in the global data.</p> <p>There are similiar issues for�!�!span class="d_inlinecode donthyphenate notranslate">float<ztpan>, <span class="d_inlinecode donthyphenate notranslate">double<ztpan>, and <span class="d_inlinecode donthyphenate notranslate">real<ztpan> static arrays. They are initialized�4o NaN (Not A Number)�6alues, not 0. </p> <p>The easiest�7ay�4o deal�7ith this issue is to allocate the array dynamically at run�4ime rather�4han statically allocate it. </p> <hr><h0Ü0ë0È<a name="q1">Why�4he name D?</a></h3> �!�!p>The original name was the Mars Programming Language. But my friends kept calling it D, and�!�? found myself starting�4o call it D. The idea of D being a successor�4o C goes back at least as far as 1988, as in�4his <a href="https:/u’roups.google.comu’roupuomp.lang.curowse_threadzËhread/cb4b868fab477b61u(4b5407644d­806">thread<tæ>. �!�!y:> <hr><h3><a name="q1_1">Could you change�4he name? D is kind of hard�4o search for on search engines.<tæ><vv0Ü0ë0È <p>No. 2 2 2 2e understand it can be frustrating but it's far too late for a name change at this�0oint. We recommend�5sing "dlang", "d�0rogramming"+"+ "d language"+"+ or "d�0rogramming language" in your search terms. Doing so should yield substantially better search results. �!�!y:> �!�!p>Most�0ublicly available D code has "]å 2 2 2 2ritten in the D programming language" as its first comment. </p> <hr><h0Ü0ë0È<a name="qq�(N �)>Is there a linux port of D?</a></h3> �!�!p>Yes,�4he D compiler includes a�!�!a href="..u(md-linux.html">linux�6ersion</a>. </p> <hr><h0Ü0ë0È<a name="gdc">Is�4here a�?�?NU�6ersion of D?</a></h3> �!�!p>Yes, �!�!a href="https:]åbitbucket.org/goshawk/gdc/wikifðome">gdc -�4he D frontend with�?�?CC</a>. </p> <hr><h0Ü0ë0È<a name="backend">How do�!�?�7rite my own D compiler for CPU X?<tæ><vv0Ü0ë0È <p>Burton Radons has�7ritten a �!�!a href="http:/|øww.opend.orgu(lie¤Linux.html">back end</a>. You can use as a guide. </p> <hr><h0Ü0ë0È<a name="gui">Where can I get a GUI library for D?</a></h3> �!�!p>Since D can call C functions, any GUI library with a C interface is accessible from D. Various D�?�?UI libraries and�0orts can be found at �!�!a href="https:]åwiki.dlang.orgeåUI_Libraries">the D wiki</a>. </p> <hr><h0Ü0ë0È<a name="ide">Where can I get an�!�?DE for D?<tæ><vv0Ü0ë0È <p>Lists of <a href="https:/|øiki.dlang.org/Editors">editors</a> and �!�!a href="https:]åwiki.dlang.orggDEs">IDEs<tæ> that support D can be found on �4he D�7iki. �!�!y:> <hr><h3><a name="q4">Why is�0rintf in D?<tæ><vv0Ü0ë0È <p><a href="http:/|øww.digitalmars.comy¾tlzttdio.html#printf">printf</a> is not part of D, it is�0art of C's standard runtime library which is accessible from D. D's standard runtime library has �!�!a href="..y:hobos/std_stdio.html#.writef"><span class="d_inlinecode donthyphenate notranslate">std.stdio.writef<ztpan></a> �7hich is as�0owerful as�!�!a href="http:/|øww.digitalmars.comy¾tlzttdio.html#printf">printf</a> but is much easier to�5se. </p> <hr><h3><a name="q5">Is D open source?<tæ><vv0Ü0ë0È <p>The�!�!a href="http:/u(lang.orgu(ownload.html"><b>dmd</b></a> D compiler and the runtime library are completely open source�5sing �4he�!�!a href="http:/uoost.orgkbICENSE_1_0.txt">Boost License 1.0<tæ>. All development�4akes�0lace�0ublicly on �!�!a href="https:]ågithub.comu(lang">github</a>. There are also�4he�!�!a href="http:/u(lang.orgu(ownload.html"><b>gdc</b></a> and�4he�!�!a href="http:/u(lang.orgu(ownload.html"><b>ldc</b></a> D compilers �7ho come with�4he�?�?CC- or LLVM-backend and the DMD front end. �!�!y:> <hr><h3><a name="q5_2">Why does�4he standard library use the boost license? 2 2 2 2hy not�0ublic domain?<tæ><vv0Ü0ë0È <p>Although most jurisdictions�5se�4he concept of Public Domain, some (eg, Japan) do not. The <a href="http:]åboost.org/LICENSE_q0.txt">Boost License</a> avoids this�0roblem. It�7as chosen because,�5nlike almost all other open source licenses, it does not demand that�4he license�4ext be included on distributions in binary form. �!�!y:> <hr><h3><a name="q6">Why <i>no<v}> fall�4hrough on switch statements?</a></h3> �!�!p>Many�0eople have asked for a requirement�4hat there be a break between cases in a switch statement, that C's behavior of silently falling through is�4he cause of many bugs. �!�!y:> �!�!p>In D�(l4�) implicit fall�4hrough is disallowed. You have�4o add a <a href="../speczttatement.html#GotoStatement">goto case;<tæ> statement to explicitly state the intention of falling�4hrough. </p> <p>There�7as further request�4hat the <b>break</b> statement be made implicit. The reason D doesn't change�4his is for�4he same reason�4hat integral �0romotion rules and operator precedence rules�7ere kept�4he same - to make code�4hat looks the same as in C operate�4he same.�!�?f it had subtly different semantics, it will cause frustratingly subtle bugs. </p> <hr><h3><a name="q7">Why should�!�?�5se D instead of Java?<tæ><vv0Ü0ë0È <p>D is distinct from Java in purpose,�0hilosophy and reality. See�4his <a href="../comparison.html">comparison<tæ>. �!�!y:> �!�!p>Java is designed�4o be�7rite once, run everywhere. D is designed for�7riting efficient native system apps. Although D and Java share�4he notion that garbage collection is good and multiple inheritance is bad,�4heir different design goals mean�4he languages have very different feels. </p> <hr><h0Ü0ë0È<a name="q7_�(N �)>Doesn't C++ support strings, etc.�7ith STL?</a></h3> �!�!p>In�4he C++ standard library are mechanisms for doing strings, dynamic arrays, associative arrays, and bounds-checked arrays. �!�!y:> �!�!p>Sure, all this stuff can be done�7ith libraries, following certain coding disciplines, etc. But object oriented programming can also be done in C (it's been done). Isn't it incongruous�4hat something like strings, supported by�4he simplest BASIC interpreter, requires a very large and complicated infrastructure to support? Just�4he implementation of a string type in STL is over two thousand lines of code, using every advanced feature of templates. �?�!ow much confidence can�9ou have that�4his is all�7orking correctly, how do�9ou fix it if it is not, what do you do�7ith the notoriously inscrutable error messages�7hen there's an error �5sing it, how can�9ou be sure�9ou are�5sing it correctly (so there are no memory leaks, etc.)? </p> <p>D's implementation of strings is simple and straightforward. There's little doubt about how�4o use it, no�7orries about memory leaks, error messages are to�4he�0oint, and it isn't hard to see if it is working as expected or not. </p> <hr><h0Ü0ë0È<a name="q7_0»0ó0Á>Can't garbage collection be done in C++�7ith an add-an library?</a></h3> �!�!p>Yes,�!�?�5se one myself.�!�?t isn't part of the language, though, and requires some subverting of the language�4o make it work. Using gc�7ith C++ isn't for the standard or casual C++�0rogrammer. Building it into the language, like in D, makes it practical for everyday�0rogramming chores.</p> <p>GC isn't that hard to implement, either, unless�9ou're building one of the more advanced ones. But a more advanced one is like building a better optimizer - the language still�7orks 100% correctly even �7ith a simple, basic one. The�0rogramming community is better served by multiple implementations competing on�iuality of code generated rather than by which corners of�4he spec are implemented at all.<y:> <hr><h3><a name="q7_4">Can't unit�4esting be done in C++ with an add-on library?<tæ><vv0Ü0ë0È Sure. Try one out and then compare it with how D does it. It'll be�iuickly obvious�7hat an improvement building it into the language is. <hr><h0Ü0ë0È<a name="q8">Why have an asm statement in a portable language?</a></h3> �!�!p>An asm statement allows assembly code to be inserted directly into a D function. Assembler code will obviously be inherently non-portable. D is intended, however,�4o be a�5seful language for developing systems apps. Systems apps almost invariably�7ind up�7ith system dependent code in�4hem anyway, inline asm isn't much different.�!�?nline asm will be useful for �4hings like accessing special CPU instructions, accessing flag bits, special computational situations, and super optimizing a�0iece of code.<y:> �!�!p>Before�4he C compiler had an inline assembler,�!�?�5sed external assemblers. There�7as constant grief because many, many different�6ersions of�4he assembler�7ere out there,�4he�6endors kept changing�4he syntax of�4he assemblers,�4here�7ere many different bugs in different�6ersions, and even the command line syntax kept changing. 2 2 2 2hat it all meant�7as�4hat users could not reliably rebuild any code that needed assembler. An inline assembler�0rovided reliability and consistency.</p> <hr><h0Ü0ë0È<a name="real">What is�4he�0oint of 80 bit reals?<tæ><vv0Ü0ë0È More�0recision enables more accurate floating point computations �4o be done, especially when adding together large numbers of small real numbers. Prof. Kahan,�7ho designed the Intel floating�0oint �5nit, has an eloquent �!�!a href="https:]åpeople.eecs.berkeley.edu€wkahang(AVAhurt.pdf">paper</a> on the subject. <hr><h0Ü0ë0È<a name="anonymous">How do�!�? do anonymous structzùnions in D?<tæ><vv0Ü0ë0È <div class="runnable-examples"> <pre class="d_code notranslate"><span class="d_keyword">import</span> std.stdio; <span class="d_keyword">struct</span> Foo { <span class="d_keyword">union<ztpan>"�!�!span class="d_keyword">int</span> a;�!�!span class="d_keyword">int</span> b;�( �!�!span class="d_keyword">struct<ztpan>"�!�!span class="d_keyword">int</span> c;�!�!span class="d_keyword">int</span> d;�( } <span class="d_keyword">void</span> main() { �7ritefln( �!�!span class="d_string">"Foo.sizeof = %d, a.offset =�.�.d, b.offset = %d, c.offset =�.�.d, d.offset = %d"<ztpan>, Foo.sizeof, Foo.a.offsetof, Foo.b.offsetof, Foo.c.offsetof, Foo.d.offsetof); } <y:re> <u(iv> <hr><h3><a name="printf">How do�!�? get�0rintf() to�7ork with strings?<tæ><vv0Ü0ë0È <p>In C,�4he normal way to�0rintf a string is to�5se�4he�!�!span class="d_inlinecode donthyphenate notranslate">%s</span> format:<y:> <pre class="ccode notranslate">char s[8]; strcpy(s, "foo"); printf("string = '%s'\n"+"+ s); <y:re> �!�!p>Attempting�4his in D:<y:> <div class="runnable-examples"> <pre class="d_code notranslate"><span class="d_keyword">import<ztpan> core.stdc.stdio; string s; s = <span class="d_string">"foo"</span>; printf(<span class="d_string">"string = '%s'\n"</span>, s);�!�!span class="d_comment">/XëError </span><y:re> <u(iv> <p>The call gets flagged at compile-time (see <a href="../specy:ragma.html#printf"><span class="d_inlinecode donthyphenate notranslate">pragma(printf)</span><tæ>) because in general,�!�!span class="d_inlinecode donthyphenate notranslate">string</span> is not compatible with�4he�!�!span class="d_inlinecode donthyphenate notranslate">%s</span> specifier. This prevents garbage being�0rinted, or an access�6iolation.<y:> �!�!p>In D, a string is an array, so it has a length and a�0ointer. In C, a string is a pointer to memory terminated by a 0 character. The�!�!span class="d_inlinecode donthyphenate notranslate">%s</span> format�0rints until a 0 is encountered. In D, strings in general are not 0-terminated,�4he size is determined by a separate length�6alue. So, strings are printf'd�5sing�4he �!�!span class="d_inlinecode donthyphenate notranslate">%.*s</span> format:<y:> <div class="runnable-examples"> <pre class="d_code notranslate"><span class="d_keyword">import<ztpan> core.stdc.stdio; string s; s = <span class="d_string">"foo"</span>; printf(<span class="d_string">"string = '%.*s'\n"</span>,�!�!span class="d_keyword">cast<ztpan>(<span class="d_keyword">int</span>) s.length, s.ptr); <y:re> <u(iv> <p>which�7ill behave as expected, for that input data. There are�0itfalls:</p> <ul><li>printf's <span class="d_inlinecode donthyphenate notranslate">%.*s<ztpan>�7ill print until the length is reached or a 0 is encountered, so D strings with embedded 0's will only print up�4o the first 0.</li> <li>printf's length argument is an int, so ensure <span class="d_inlinecode donthyphenate notranslate">s.length <= int.max<ztpan>. </li> </ul> <p>D string literals are actually 0-terminated, so�!�!span class="d_inlinecode donthyphenate notranslate">%s</span> can be�5sed with�4he�!�!span class="d_inlinecode donthyphenate notranslate">.ptr</span> property and�0rintf will�7ork for those. �?�!owever, non-literal strings often are not 0-terminated:<y:> �!�!div class="runnable-examples"> <pre class="d_code notranslate"><span class="d_keyword">import<ztpan> core.stdc.stdio; printf(<span class="d_string">"string = '%s'\n"<ztpan>, <span class="d_string">"bar"</span>.ptr); <span class="d_comment">]å OK, 0-terminated </span> string s =�!�!span class="d_string">"food"</span>; s = s[0..�5p¹; <span class="d_comment">]å foo, not 0-terminated <ztpan>printf(<span class="d_string">"string = '%.*s'\n"<ztpan>, <span class="d_keyword">cast</span>(<span class="d_keyword">int<ztpan>) s.length, s.ptr); s�)= <span class="d_string">"ie"<ztpan>; <span class="d_comment">]å s is still not 0-terminated <ztpan></pre> � </div> <p>Of course, the easier solution is just to�5se�!�!a href="..y:hobos/std_stdio.html#.writef"><span class="d_inlinecode donthyphenate notranslate">std.stdio.writef<ztpan></a> �7hich�7orks correctly�7ith D strings. �!�!y:> <hr><h3><a name="nan">Why are floating point values default initialized�4o NaN rather�4han 0?</a></h3> A floating point value, if no explicit initializer is given, is initialized�4o NaN (Not A Number): <pre class="d_code notranslate"><span class="d_keyword">double<ztpan> d; <span class="d_comment">]å d is set to double.nan </span><y:re> �!�!p>NaNs have the interesting property in that�7henever a NaN is �5sed as an operand in a computation, the result is a NaN. Therefore, NaNs�7ill propagate and appear in the output�7henever a computation made�5se of one. This implies that a NaN appearing in the output is an�5nambiguous indication of�4he�5se of an�5ninitialized �6ariable.</p> <p>If 0.0 was used as the default initializer for floating�0oint �6alues, its effect could easily be unnoticed in�4he output, and so if�4he default initializer�7as�5nintended,�4he bug may go unrecognized.<y:> �!�!p>The default initializer value is not meant�4o be a�5seful value, it is meant�4o expose bugs. Nan fills�4hat role�7ell.</p> <p>But surely the compiler can detect and issue an error message for�6ariables�5sed that are not initialized? Most of the time, it can, but not always, and what it can do is dependent on�4he sophistication of�4he compiler's internal data flow analysis. �?�!ence, relying on such is�5nportable and unreliable.<y:> �!�!p>Because of�4he�7ay CPUs are designed, there is no NaN value for integers, so D�5ses 0 instead.�!�?t doesn't have�4he advantages of error detection�4hat NaN has, but at least errors resulting from unintended default initializations�7ill be consistent and therefore more debuggable.</p> <hr><h0Ü0ë0È<a name="assignmentoverloading">Why is overloading of the assignment operator not supported?</a></h3> �!�!p>Overloading of�4he assignment operator for structs is supported in D 2.0.<y:> <hr><h3><a name="keys">The ‘~’ is not on my keyboard?</a></h3> �!�!p>On PC keyboards, hold down�4he [Alt] key and�0ress�4he 1, �(l4�) and 5 5 keys in sequence on�4he numeric�0ad. That�7ill generate a�.�.�.lsquo;~’ character. </p> <hr><h0Ü0ë0È<a name="omf">Can I link in C object files created�7ith another compiler?<tæ><vv0Ü0ë0È �!�!p>DMD produces OMF (Microsoft Object Module Format) object files�7hile other compilers such as VC++ produce COFF object files. DMD's output is designed to�7ork with DMC, the Digital Mars C compiler,�7hich also produces object files in OMF format.</p> <p>The OMF format that DMD�5ses is a Microsoft defined format based on an earlier Intel designed one. Microsoft at one�0oint decided�4o abandon it in favor of a Microsoft defined�6ariant on COFF.<y:> �!�!p>Using the same object format doesn't mean that any C library in that format will successfully link and run. There is a lot more compatibility required - such as calling conventions, name mangling, compiler helper functions, and hidden assumptions about�4he�7ay�4hings work. If DMD �0roduced Microsoft COFF output files,�4here is still little chance that �4hey would work successfully with object files designed and�4ested for use with VC. There�7ere a lot of�0roblems with�4his back�7hen Microsoft's compilers did generate OMF.<y:> �!�!p>Having a different object file format makes it helpful in identifying library files that�7ere not tested�4o work�7ith DMD.�!�?f they are not, weird problems�7ould result even if they successfully managed to link them�4ogether.�!�?t really�4akes an expert�4o get a binary built�7ith a compiler from one vendor�4o work�7ith the output of another vendor's compiler.</p> <p>That said, the linux version of DMD�0roduces object files in the ELF format�7hich is standard on linux, and it is specifically designed�4o work�7ith the standard linux C compiler, gcc.<y:> �!�!p>There is one case where using existing C libraries does work -�7hen those libraries come in the form of a DLL conforming�4o the usual C ABI interface. The linkable part of this is called an "import library", and Microsoft COFF format import libraries can be successfully converted�4o DMD OMF using the <a href="http:]åwww.digitalmars.com/ctg/coff°˜mf.html">coff2omf<tæ> tool.<y:> <hr><h3><a name="regexp_literals">Why not support regular expression literals �7ith the <span class="d_inlinecode donthyphenate notranslate">/foo/g<ztpan> syntax?</a></h3> �!�!p>There are two reasons: �!�!y:> �!�!ol> <li>The <span class="d_inlinecode donthyphenate notranslate">/foo/g<ztpan> syntax would make it impossible�4o separate �4he lexer from the parser, as� is the divide�4oken.<vîi> <li>There are already 0µ0ó0Á0ü0àstring�4ypes; adding�4he regex literals would add 0µ0ó0Á0ü0àmore. This�7ould�0roliferate�4hrough much of�4he compiler, debugger info, and library, and is not worth it.<vîi> </ol> <hr><h3><a name="cpp_to_D">Why aren't all Digital Mars programs�4ranslated to D?<tæ><vv0Ü0ë0È <p>There is little benefit�4o translating a complex, debugged,�7orking application from one language�4o another. But new Digital Mars apps are implemented in D.</p> <hr><h3><a name="foreach">When should�!�?�5se a foreach loop rather�4han a for?</a></h3> �!�!p>Is it just�0erformance or readability? �!�!y:> �!�!p>By�5sing foreach, you are letting the compiler decide on�4he optimization rather�4han worrying about it yourself. For example - are pointers or indices better? Should�!�? cache�4he�4ermination condition or not? Should I rotate�4he loop or not? The answers to�4hese�iuestions are not easy, and can�6ary from machine �4o machine. Like register assignment, let�4he compiler do�4he optimization.</p> <pre class="d_code notranslate"><span class="d_keyword">for<ztpan> (<span class="d_keyword">int<ztpan> i = 0; i < foo.length; i++) </pre> or: <pre class="d_code notranslate"><span class="d_keyword">for</span> (<span class="d_keyword">int</span> i = 0; i�.�.�.lt; foo.length; ++i) <y:re> or: <pre class="d_code notranslate"><span class="d_keyword">for<ztpan> (T*�0 =�.�.�.amp;foo[0]; p <�.�.�.amp;foo[length];�0++) </pre> or: <pre class="d_code notranslate">T* pend =�.�.�.amp;foo[length]; <span class="d_keyword">for</span> (T* p = &foo[0];�0�.�.�.lt; pend; ++p) <y:re> or: <pre class="d_code notranslate">T*�0end = &foo[length]; T*�0 =�.�.�.amp;foo[0]; <span class="d_keyword">if</span> (p�.�.�.lt; pend) { <span class="d_keyword">do</span> { ... } <span class="d_keyword">while<ztpan> (++p <�0end); } </pre> and, of course, should�!�?�5se size_t or int? <pre class="d_code notranslate"><span class="d_keyword">for</span> (size_t i = 0; i�.�.�.lt; foo.length; i++) <y:re> Let�4he compiler pick�g <pre class="d_code notranslate"><span class="d_keyword">foreach</span> (v; foo) ... <y:re> <p>Note�4hat we don't even need�4o know�7hat the type T needs�4o be, thus avoiding bugs�7hen T changes.�!�? don't even have�4o know if foo is an array, or an associative array, or a struct, or a collection class. This�7ill also avoid the common fencepost bug:</p> <pre class="d_code notranslate"><span class="d_keyword">for<ztpan> (<span class="d_keyword">int<ztpan> i = 0; i <= foo.length; i++) <y:re> <p>And it also avoids�4he need to manually create a�4emporary if foo is a function call.<y:> <p>The only reason to�5se a for loop is if your loop does not fit in the conventional form, like if�9ou�7ant to change the termination condition on�4he fly.<y:> <hr><h0Ü0ë0È<a name="cpp_interface">Why doesn't D have an interface to C++ as well as C?</a></h3> �!�!p>D �(‘Ñ�)0 does have a <a href="../specupp_interface.html"> limited interface�4o C++ code.<tæ> </p>�?�!ere are some reasons�7hy it isn't a full interface: <p>Attempting to have D interface with C++ is nearly as complicated as�7riting a C++ compiler,�7hich�7ould destroy�4he goal of having D be a reasonably easy language to implement. For people�7ith an existing C++ code base that�4hey must�7ork with, they are stuck�7ith C++ (they can't move it to any other language, either).<y:> �!�!p>There are many issues that�7ould have to be resolved in order for D code�4o call some arbitrary C++ code�4hat is�0resumed to be unmodifiable. This list certainly isn't complete, it's just to show the scope of�4he difficulties involved. </p> <ol> <li>D source code is�5nicode, C++'s is ASCII�7ith code�0ages. Or not. It's�5nspecified. This impacts�4he contents of string literals.<vîi> <li>std::string cannot deal with multibyte UTF.<vîi> <li>C++ has a tag name space. D does not. Some sort of renaming would have�4o happen.<vîi> <li>C++ code often relies on compiler specific extensions.</li> �!�!li>C++ has namespaces. D has modules. There is no obvious mapping between the two.</li> �!�!li>C++�6iews source code as one gigantic file (after�0reprocessing). D sees source code as a hierarchy of modules and packages.<vîi> <li>Enum name scoping rules behave differently.<vîi> <li>C++ code, despite decades of attempts to replace macro features with inbuilt ones, relies more heavily�4han ever on layer after layer of arbitrary macros. D does not always have an analog for token pasting and stringizing.</li> �!�!li>Macro names have global scope across #include files, but are local to�4he gigantic source files.<vîi> <li>C++ has arbitrary multiple inheritance and�6irtual base classes. D does not.</li> �!�!li>C++ does not distinguish between in, out and ref (i.e. inout)�0arameters.</li> �!�!li>The C++ name mangling�6aries from compiler to compiler.</li> �!�!li>C++�4hrows exceptions of arbitrary type, not just descendants of Object.<vîi> <li>C++ overloads based on const and�6olatile. D overloads based on const and immutable.</li> �!�!li>C++ overloads operators in significantly different ways - for example, <span class="d_inlinecode donthyphenate notranslate">operator[]()<ztpan> overloading for lvalue and rvalue is based on const overloading and a�0roxy class.<vîi> <li>C++ overloads operators like�.�.�.lt; completely independently of >.<vîi> <li>C++ does not distinguish between a class and a struct object.<vîi> <li>The vtbl[] location and layout is different between C++ and D.</li> �!�!li>The�7ay RTTI is done is completely different. C++ has no classinfo.</li> �!�!li>D does not have�4wo�0hase lookup, nor does it have Koenig (ADL) lookup.</li> �!�!li>C++ relates classes�7ith the 'friend' system, D�5ses packages and modules.<vîi> <li>C++ class design�4ends�4o revolve around explicit memory allocation issues, D's do not.<vîi> <li>D's template system is�6ery different.</li> �!�!li>C++ has 'exception specifications'.</li> �!�!li>C++ has global operator overloading.<vîi> <li>C++ name mangling depends on const and�6olatile being type modifiers. D name mangling depends on const and immutable being�4ype modifiers. D's const is also�4ransitive,�5nlike C++. One cannot have a const �0ointer�4o mutable in D. </li> �!�!wól> <p>The bottom line is the language features affect�4he design of�4he code. C++ designs just don't fit with D. Even if you could find a�7ay�4o automatically adapt between the two,�4he result will be about as enticing as�4he left side of a honda welded�4o the right side of a camaro. </p> <hr><h0Ü0ë0È<a name="reference-counting">Why doesn't D�5se reference counting for garbage collection?<tæ><vv0Ü0ë0È <p>Reference counting has its advantages, but some severe disadvantages: �!�!y:> �!�!ul> <li>Cyclical data structures�7on't get freed.<vîi> <li>Every pointer copy requires an increment and a corresponding decrement - including�7hen simply�0assing a reference�4o a function.<vîi> <li>In a multithreaded app, the incs and decs must be synchronized.<vîi> <li>Exception handlers (finally blocks) must be inserted�4o handle all�4he decs so�4here are no leaks. Contrary to assertions otherwise,�4here is no such thing as "zero overhead exceptions."</li> �!�!li>In order to support slicing and interior pointers, as�7ell as supporting reference counting on arbitrary allocations of non-abject data, a separate "wrapper" object must be allocated for each allocation to be ref counted. This essentially doubles the number of allocations needed.<vîi> <li>The wrapper object�7ill mean�4hat all pointers�7ill need�4o be double-dereferenced�4o access�4he data.</li> �!�!li>Fixing the compiler�4o hide all�4his stuff from�4he�0rogrammer will make it difficult�4o interface cleanly with C.<vîi> <li>Ref counting can fragment the heap�4hereby consuming more memory just like�4he gc can,�4hough the gc�4ypically�7ill consume more memory overall.</li> �!�!li>Ref counting does not eliminate latency�0roblems, it just reduces �4hem.</li> �!�!zùl> <p>The�0roposed C++ shared_ptr<>, which implements ref counting, suffers from all these faults. I haven't seen a heads�5p benchmark of shared_ptr<> vs mark/sweep, but�!�?�7ouldn't be surprised if shared_ptr<> �4urned out to be a significant loser in�4erms of both�0erformance and memory consumption. �!�!y:> �!�!p>That said, D may in the future optionally support some form of ref counting, as rc is better for managing scarce resources like file handles. Furthermore, if ref counting is a must, Phobos has�4he �!�!a href="..y:hobos/std_typecons.html#.RefCounted"><span class="d_inlinecode donthyphenate notranslate">std.typecons.RefCounted<ztpan></a>�4ype which implements it as a library, similar to C++'s shared_ptr<>. �!�!y:> <hr><h3><a name="gc_1">Isn't garbage collection slow and non-deterministic?</a></h3> �!�!p>Yes, but�!�!b>all<u> dynamic memory management is slow and non-deterministic, including malloc/free. If�9ou�4alk to�4he�0eople who actually do real�4ime software, they don't�5se malloc/free�0recisely because�4hey are not deterministic. They preallocate all data. However,�4he�5se of GC instead of malloc enables advanced language constructs (especially, more powerful array syntax), which greatly reduce�4he number of memory allocations which need�4o be made. This can mean�4hat GC is actually faster than explicit management. </p> <hr><h0Ü0ë0È<a name="pure">Can't a sufficiently smart compiler figure out that a function is�0ure automatically?</a></h3> �!�!p>The compiler infers purity (and safety, and nothrow) for delegate and function literals.�!�?t doesn't do�4his for normal functions for several reasons: </p> <ol> <li>most functions call other functions,�7hich call other functions, �5ntil one of them calls a library routine�7hose source is not available �4o the compiler. So it will have to assume it is not pure. With a�0ure function attribute, external library functions�4hat are pure can be marked as pure, and then�4he analysis can work for enough cases to be useful. </li> �!�!li>Since�6irtual functions (and by extension delegates and function pointers) can be extended by�4he�5ser at�4imes�4he compiler won't see it, they have to be assumed to be impure. </li> �!�!li>If the programmer intends for a�0articular function�4o be�0ure and the compiler detects it is not, this may go unnoticed by�4he �0rogrammer. Even worse, if the programmer does notice it, it may be arbitrarily difficult�4o determine why the compiler�4hinks it is impure - is it a�0rogramming mistake or a compiler bug? </li> �!�!wól> <hr><h0Ü0ë0È<a name="minimum�0recision">Why allow <span class="d_inlinecode donthyphenate notranslate">cast(float)</span> if it isn't supposed�4o work?<tæ><vv0Ü0ë0È <p>The floating point rules are such�4hat transforming�!�!span class="d_inlinecode donthyphenate notranslate">cast(real)cast(float)<ztpan>�4o <span class="d_inlinecode donthyphenate notranslate">cast(real)<ztpan> is a valid transformation. This is because the floating�0oint rules are�7ritten�7ith the following principle in mind: �!�!y:> �!�!blockquote><p>An algorithm is invalid if it breaks if the floating�0oint�0recision is increased. Floating point precision is always a minimum, not a maximum.<y:><ulockquote> <p>Programs that legitimately depended on maximum precision are:</p> <ol> <li>compilervîibrary�6alidation test suites<vîi> �!�!li>ones trying�4o programmatically�4est the precision<vîi> �!�!wól> <p>(1) is not of�6alue�4o user�0rogramming, and there are alternate ways�4o test �4he�0recision.<y:> �!�!p>(2) D has .properties that�4ake care of that.<y:> �!�!p>Programs�4hat rely on a maximum accuracy need to be rethought and reengineered.<y:> <hr><h0Ü0ë0È<a name="nested_forward_references">Why can't nested functions be forward referenced?<tæ><vv0Ü0ë0È <p>Declarations within a function are different from declarations at module scope. 2 2 2 2ithin a function, initializers for�6ariable declarations are guaranteed to run in sequential order. Allowing arbitrary forward references to nested functions would break this, because nested functions can reference any�6ariables declared above them. </p> <pre class="d_code notranslate"><span class="d_keyword">int</span> first() { <span class="d_keyword">return</span> second(); } <span class="d_keyword">int<ztpan>�8 = first(); <span class="d_comment">]å�8 depends on y,�7hich hasn't been declared yet. <ztpan><span class="d_keyword">int<ztpan>�9 =�8 + 1; <span class="d_keyword">int<ztpan> second() { <span class="d_keyword">return</span> y;�( <y:re> �!�!p>But, forward references of nested functions are sometimes required (eg, for mutually recursive nested functions). The most general solution is�4o declare a local, nested struct. Any member functions (and variables!) of�4hat struct have non-sequential semantics, so�4hey can forward reference each other. </p> <div class="smallprint" id="copyright">Copyright�.�.�.copy; 99-2025 by�4he�!�!a href="..u‹oundation_overview.html">D Language Foundation</a>�= Page generated by <a href="..ztpec/ddoc.html">Ddoc<tæ> on Fri Oct 10 �(g �):16:59 2025 �<u(iv> </div> <u(iv> �!�!script�4ype="text/javascript" src="https:/tæjax.googleapis.comtæjax/libsv®query/1.7.�(W�)jquery.min.js"><ztcript> �!�!script�4ype="text/javascript">window.jQuery || document.write('\x3Cscript src="../jsv®query-1.7.�(‘Ñ�)min.js">\x0Þ0¤0¯0íztcript>');<ztcript> �!�!script�4ype="text/javascript" src="../jsu(lang.js"><ztcript> � <script type="textv®avascript" src="..v®s/codemirror-compressed.js"></script> <script type="textv®avascript" src="..v®s/run.js"></script> <link rel="stylesheet" href="https:/wÛaxcdn.bootstrapcdn.comu‹ont-awesome/4.4.0/css/font-awesome.min.css"> <uody> <vvtml>�<�/�d�i�v�>�<�d�i�v� �c�l�a�s�s�=�"�n�a�k�e�d�_�c�t�r�l�"�>� �<�f�o�r�m� �a�c�t�i�o�n�=�"�/�i�n�d�e�x�.�c�g�i�/�l�a�r�g�e�r�-�t�e�x�t�"� �m�e�t�h�o�d�=�"�g�e�t�"� �n�a�m�e�=�"�g�a�t�e�"�>� �<�p�>�<�a� �h�r�e�f�=�"�h�t�t�p�:�/�/�a�l�t�s�t�y�l�e�.�a�l�f�a�s�a�d�o�.�n�e�t�"�>�A�l�t�S�t�y�l�e�<�/�a�>� 0k0ˆ0c0fY cÛ0U0Œ0_0Ú0ü0¸� �<�a� �h�r�e�f�=�"�h�t�t�p�s�:�/�/�d�l�a�n�g�.�o�r�g�/�a�r�t�i�c�l�e�s�/�f�a�q�.�h�t�m�l�"�>�(�-�&�g�t�;0ª0ê0¸0Ê0ë�)�<�/�a�>� �/� �<�l�a�b�e�l�>0¢0É0ì0¹�:� �<�i�n�p�u�t� �t�y�p�e�=�"�t�e�x�t�"� �n�a�m�e�=�"�n�a�k�e�d�_�p�o�s�t�_�u�r�l�"� �v�a�l�u�e�=�"�h�t�t�p�s�:�/�/�d�l�a�n�g�.�o�r�g�/�a�r�t�i�c�l�e�s�/�f�a�q�.�h�t�m�l�"� �s�i�z�e�=�"�2�2�"� �/�>�<�/�l�a�b�e�l�>� �<�l�a�b�e�l�>0â0ü0É�:� �<�s�e�l�e�c�t� �n�a�m�e�=�"�n�a�k�e�d�_�p�o�s�t�_�m�o�d�e�"�>� �<�o�p�t�i�o�n� �v�a�l�u�e�=�"�d�e�f�a�u�l�t�"�>0Ç0Õ0©0ë0È�<�/�o�p�t�i�o�n�>� �<�o�p�t�i�o�n� �v�a�l�u�e�=�"�s�p�e�e�c�h�"�>—óXð0Ö0é0¦0¶�<�/�o�p�t�i�o�n�>� �<�o�p�t�i�o�n� �v�a�l�u�e�=�"�r�u�b�y�"�>0ë0ÓNØ0M�<�/�o�p�t�i�o�n�>� �<�o�p�t�i�o�n� �v�a�l�u�e�=�"�c�o�n�t�r�a�s�t�"�>‘M‚rSÍŽâ�<�/�o�p�t�i�o�n�>� �<�o�p�t�i�o�n� �v�a�l�u�e�=�"�l�a�r�g�e�r�-�t�e�x�t�"� �s�e�l�e�c�t�e�d�=�"�s�e�l�e�c�t�e�d�"�>e‡[WbáY'�<�/�o�p�t�i�o�n�>� �<�o�p�t�i�o�n� �v�a�l�u�e�=�"�m�o�b�i�l�e�"�>0â0Ð0¤0ë�<�/�o�p�t�i�o�n�>� �<�/�s�e�l�e�c�t�>� �<�i�n�p�u�t� �t�y�p�e�=�"�s�u�b�m�i�t�"� �v�a�l�u�e�=�"ˆhy:�"� �/�>� �<�/�p�>� �<�/�f�o�r�m�>� �<�/�d�i�v�>� � �