<c- Copyright (c) 99-2025 by4he D Language Foundation All Rights Reserved. https:]ådlang.org/foundation_overview.html --> std.range - 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='std.range' class='std'> <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="../imagesu(logo.svg"></a></div> �!�!a href="..wÛenu.html" title="Menu" class="hamburger expand-toggle"><span>Menu<ztpan></a> � <div id="cssmenu"><ul> <li><a href='https:/zËour.dlang.org'><span>Learn</span><tæ><vîi> �!�!li class='expand-container'><a class='expand-toggle' href='../documentation.html'><span>Documentation<ztpan></a> � <ul class='expand-content'> �!�!li><a href='..ztpec/spec.html'>Language Reference<tæ><vîi> �!�!li><a href='..y:hobos/index.html'>Library Reference<tæ><vîi> �!�!li><a href='..u(md.html'>Command-line Reference<tæ><vîi> �!�!li class="menu-divider"><a href='../comparison.html'>Feature Overview<tæ><vîi> �!�!li><a href='..tærticles.html'>Articles</a></li> �!�!zùl></li> <li><a href='../download.html'><span>Downloads</span><tæ><vîi> �!�!li><a href='https:]åcode.dlang.org'><span>Packages</span><tæ><vîi> �!�!li class='expand-container'><a class='expand-toggle' href='../community.html'><span>Community<ztpan></a> � <ul class='expand-content'> �!�!li><a href='https:]ådlang.org/blog'>Blog</a></li> <li><a href='../orgs-using-d.html'>Orgs using D<tæ><vîi> �!�!li><a href='https:]åtwitter.com/search?q=%�(y>�)dlang'>Twitter</a></li> <li class="menu-divider"><a href='https:]ådiscord.gguMZk9Q4'>Discord (community-run)<tæ><vîi> �!�!li><a href='https:]åforum.dlang.org'>Forums<tæ><vîi> �!�!li><a href='irc:]åirc.libera.chat/d'>IRC</a></li> <li><a href='https:/|øiki.dlang.org'>Wiki<tæ><vîi> �!�!li class="menu-divider"><a href='../bugstats.html'>Issues<tæ><vîi> �!�!li><a href='..uontributing.html'>Contributing</a></li> <li class="menu-divider"><a href='..u‹oundation/contributors.html'>Contributors<tæ><vîi> �!�!li><a href='..u‹oundation/index.html'>Foundation</a></li> <li><a href='../ztecurity.html'>Security Team<tæ><vîi> �!�!li class="menu-divider"><a href='https:/zttore.dlang.org[€>Store</a></li> <li><a href='../foundationu(onate.html'>Donate</a></li> <li><a href='../foundationztponsors.html'>Sponsors</a></li> �!�!zùl></li> <li class='expand-container'><a class='expand-toggle' href='..y¾esources.html'><span>Resources</span><tæ> <ul class='expand-content'> <li><a href='https:/zËour.dlang.org'>Tour<tæ><vîi> �!�!li><a href='https:]åwiki.dlang.orge‡ooks'>Books<tæ><vîi> �!�!li><a href='https:]åwiki.dlang.orgl4utorials'>Tutorials<tæ><vîi> �!�!li class="menu-divider"><a href='https:/|øiki.dlang.org/Development_tools'>Tools</a></li> <li><a href='https:/|øiki.dlang.org/Editors'>Editors</a></li> <li><a href='https:/|øiki.dlang.org/IDEs'>IDEs</a></li> <li><a href='https:/y¾un.dlang.io'>run.dlang.io<tæ><vîi> �!�!li><a href='http:/y¾ainers.github.io|sisuald|sisualdltartPage.html'>Visual D<tæ><vîi> �!�!li class="menu-divider"><a href='../acknowledgements.html'>Acknowledgments</a></li> <li><a href='../dstyle.html'>D Style</a></li> <li><a href='../specu’lossary.html'>Glossary</a></li> <li><a href='../sitemap.html'>Sitemap<tæ><vîi> </ul><vîi> <zùl></div> �!�!div class="search-container expand-container"> <a href="../search.html" class="expand-toggle"�4itle="Search"><span>Search</span><tæ> �!�!div id="search-box"> <form method="get" action="https:/u’oogle.com/search"> �!�!input type="hidden" id="domains" name="domains" value="dlang.org"> �!�!input type="hidden" id="sourceid" name="sourceid" value="google-search"> �!�!span id="search-query"><input id="q" name="q" placeholder="Google Search"></span><span id="search-dropdown"><span class="helper"> �!�!select id="sitesearch" name="sitesearch" size="1"> �!�!option�6alue="dlang.org">Entire Site</option> <option �6alue="dlang.org/spec">Language</option> <option selected�6alue="dlang.org/phobos">Library<wóption> �!�!option value="forum.dlang.org">Forums</option> �!�!ztelect> �!�!ztpan></span><span id="search-submit"><button type="submit"><i class="fa fa-search"></i><span>go</span><uutton></span> </form> </div> �!�!u(iv> </div></div></div> <div class="container"> � <div class="subnav-helper"><u(iv> <div class="subnav"> <div class="head"> <h�(ŒÇ�)library Reference<vv�(ŒÇ�) �!�!p><span class="smallprint">version 2.1�.0�!�!span class="separator"><br><ztpan> �!�!ztpan> �!�!y:> <p><a href="index.html">overview</a></p> �!�!u(iv> <ul> <li><a href='object.html'><span><em class="tt">object<u0m></span><tæ><vîi> <li class='expand-container modlist-submenu-std'><a class='expand-toggle' href='#'><span><em class="tt">std<u0m></span><tæ> <ul><li> <a href="std_algorithm.html"�4itle="std.algorithm"><span class="d_inlinecode donthyphenate notranslate">algorithm<ztpan></a><ul><li> <a href="std_algorithm_comparison.html" title="std.algorithm.comparison"><span class="d_inlinecode donthyphenate notranslate">comparison</span><tæ><vîi><li> <a href="std_algorithm_iteration.html"�4itle="std.algorithm.iteration"><span class="d_inlinecode donthyphenate notranslate">iteration<ztpan></a></li><li> �!�!a href="std_algorithm_mutation.html"�4itle="std.algorithm.mutation"><span class="d_inlinecode donthyphenate notranslate">mutation<ztpan></a></li><li> �!�!a href="std_algorithm_searching.html" title="std.algorithm.searching"><span class="d_inlinecode donthyphenate notranslate">searching</span><tæ><vîi><li> <a href="std_algorithm_setops.html" title="std.algorithm.setops"><span class="d_inlinecode donthyphenate notranslate">setops</span><tæ><vîi><li> <a href="std_algorithm_sorting.html"�4itle="std.algorithm.sorting"><span class="d_inlinecode donthyphenate notranslate">sorting<ztpan></a> �!�!vîi></ul><vîi><li> <a href="std_array.html"�4itle="std.array"><span class="d_inlinecode donthyphenate notranslate">array<ztpan></a></li><li> �!�!a href="std_ascii.html" title="std.ascii"><span class="d_inlinecode donthyphenate notranslate">ascii</span><tæ><vîi><li> <a href="std_base64.html" title="std.base64"><span class="d_inlinecode donthyphenate notranslate">base64</span><tæ><vîi><li> <a href="std_bigint.html" title="std.bigint"><span class="d_inlinecode donthyphenate notranslate">bigint</span><tæ><vîi><li> <a href="std_bitmanip.html" title="std.bitmanip"><span class="d_inlinecode donthyphenate notranslate">bitmanip</span><tæ><vîi><li> <a href="std_checkedint.html" title="std.checkedint"><span class="d_inlinecode donthyphenate notranslate">checkedint</span><tæ><vîi><li> <a href="std_compiler.html" title="std.compiler"><span class="d_inlinecode donthyphenate notranslate">compiler</span><tæ><vîi><li> <a href="std_complex.html"�4itle="std.complex"><span class="d_inlinecode donthyphenate notranslate">complex<ztpan></a></li><li> �!�!a href="std_concurrency.html" title="std.concurrency"><span class="d_inlinecode donthyphenate notranslate">concurrency</span><tæ><vîi><li> <a href="std_container.html"�4itle="std.container"><span class="d_inlinecode donthyphenate notranslate">container<ztpan></a><ul><li> <a href="std_container_array.html"�4itle="std.container.array"><span class="d_inlinecode donthyphenate notranslate">array<ztpan></a></li><li> �!�!a href="std_container_binaryheap.html"�4itle="std.container.binaryheap"><span class="d_inlinecode donthyphenate notranslate">binaryheap<ztpan></a></li><li> �!�!a href="std_container_dlist.html" title="std.container.dlist"><span class="d_inlinecode donthyphenate notranslate">dlist</span><tæ><vîi><li> <a href="std_container_rbtree.html" title="std.container.rbtree"><span class="d_inlinecode donthyphenate notranslate">rbtree</span><tæ><vîi><li> <a href="std_container_slist.html"�4itle="std.container.slist"><span class="d_inlinecode donthyphenate notranslate">slist<ztpan></a></li><li> �!�!a href="std_container_util.html"�4itle="std.container.util"><span class="d_inlinecode donthyphenate notranslate">util<ztpan></a> �!�!vîi></ul><vîi><li> <a href="std_conv.html" title="std.conv"><span class="d_inlinecode donthyphenate notranslate">conv</span><tæ><vîi><li> <a href="std_csv.html"�4itle="std.csv"><span class="d_inlinecode donthyphenate notranslate">csv<ztpan></a></li><li> �!�!a href="std_datetime.html"�4itle="std.datetime"><span class="d_inlinecode donthyphenate notranslate">datetime<ztpan></a><ul><li> <a href="std_datetime_date.html"�4itle="std.datetime.date"><span class="d_inlinecode donthyphenate notranslate">date</span><tæ><vîi><li> <a href="std_datetime_interval.html"�4itle="std.datetime.interval"><span class="d_inlinecode donthyphenate notranslate">interval</span><tæ><vîi><li> <a href="std_datetime_stopwatch.html" title="std.datetime.stopwatch"><span class="d_inlinecode donthyphenate notranslate">stopwatch<ztpan></a></li><li> �!�!a href="std_datetime_systime.html"�4itle="std.datetime.systime"><span class="d_inlinecode donthyphenate notranslate">systime</span><tæ><vîi><li> <a href="std_datetime_timezone.html"�4itle="std.datetime.timezone"><span class="d_inlinecode donthyphenate notranslate">timezone</span><tæ> </li><zùl></li><li> �!�!a href="std_demangle.html"�4itle="std.demangle"><span class="d_inlinecode donthyphenate notranslate">demangle<ztpan></a></li><li> �!�!a href="std_digest.html"�4itle="std.digest"><span class="d_inlinecode donthyphenate notranslate">digest<ztpan></a><ul><li> <a href="std_digest_crc.html" title="std.digest.crc"><span class="d_inlinecode donthyphenate notranslate">crc<ztpan></a></li><li> �!�!a href="std_digest_hmac.html" title="std.digest.hmac"><span class="d_inlinecode donthyphenate notranslate">hmac<ztpan></a></li><li> �!�!a href="std_digest_md.html" title="std.digest.md"><span class="d_inlinecode donthyphenate notranslate">md<ztpan></a></li><li> �!�!a href="std_digest_murmurhash.html" title="std.digest.murmurhash"><span class="d_inlinecode donthyphenate notranslate">murmurhash<ztpan></a></li><li> �!�!a href="std_digest_ripemd.html" title="std.digest.ripemd"><span class="d_inlinecode donthyphenate notranslate">ripemd<ztpan></a></li><li> �!�!a href="std_digest_sha.html"�4itle="std.digest.sha"><span class="d_inlinecode donthyphenate notranslate">sha</span><tæ> </li><zùl></li><li> �!�!a href="std_encoding.html"�4itle="std.encoding"><span class="d_inlinecode donthyphenate notranslate">encoding<ztpan></a></li><li> �!�!a href="std_exception.html" title="std.exception"><span class="d_inlinecode donthyphenate notranslate">exception</span><tæ><vîi><li> <h7><span class="d_inlinecode donthyphenate notranslate">experimental<ztpan></h7><ul><li> �!�!a href="std_experimental_allocator.html"�4itle="std.experimental.allocator"><span class="d_inlinecode donthyphenate notranslate">allocator</span><tæ><ul><li> �!�!a href="std_experimental_allocator_building_blocks.html"�4itle="std.experimental.allocator.building_blocks"><span class="d_inlinecode donthyphenate notranslate">building_blocks</span><tæ><ul><li> �!�!a href="std_experimental_allocator_building_blocks_affix_allocator.html"�4itle="std.experimental.allocator.building_blocks.affix_allocator"><span class="d_inlinecode donthyphenate notranslate">affix_allocator</span><tæ><vîi><li> <a href="std_experimental_allocator_building_blocks_aligned_block_list.html"�4itle="std.experimental.allocator.building_blocks.aligned_block_list"><span class="d_inlinecode donthyphenate notranslate">aligned_block_list</span><tæ><vîi><li> <a href="std_experimental_allocator_building_blocks_allocator_list.html"�4itle="std.experimental.allocator.building_blocks.allocator_list"><span class="d_inlinecode donthyphenate notranslate">allocator_list</span><tæ><vîi><li> <a href="std_experimental_allocator_building_blocks_ascending_page_allocator.html"�4itle="std.experimental.allocator.building_blocks.ascending_page_allocator"><span class="d_inlinecode donthyphenate notranslate">ascending_page_allocator</span><tæ><vîi><li> <a href="std_experimental_allocator_building_blocks_bitmapped_block.html" title="std.experimental.allocator.building_blocks.bitmapped_block"><span class="d_inlinecode donthyphenate notranslate">bitmapped_block<ztpan></a></li><li> �!�!a href="std_experimental_allocator_building_blocks_bucketizer.html" title="std.experimental.allocator.building_blocks.bucketizer"><span class="d_inlinecode donthyphenate notranslate">bucketizer<ztpan></a></li><li> �!�!a href="std_experimental_allocator_building_blocks_fallback_allocator.html" title="std.experimental.allocator.building_blocks.fallback_allocator"><span class="d_inlinecode donthyphenate notranslate">fallback_allocator<ztpan></a></li><li> �!�!a href="std_experimental_allocator_building_blocks_free_list.html"�4itle="std.experimental.allocator.building_blocks.free_list"><span class="d_inlinecode donthyphenate notranslate">free_list</span><tæ><vîi><li> <a href="std_experimental_allocator_building_blocks_free_tree.html" title="std.experimental.allocator.building_blocks.free_tree"><span class="d_inlinecode donthyphenate notranslate">free_tree<ztpan></a></li><li> �!�!a href="std_experimental_allocator_building_blocks_kernighan_ritchie.html"�4itle="std.experimental.allocator.building_blocks.kernighan_ritchie"><span class="d_inlinecode donthyphenate notranslate">kernighan_ritchie</span><tæ><vîi><li> <a href="std_experimental_allocator_building_blocks_null_allocator.html"�4itle="std.experimental.allocator.building_blocks.null_allocator"><span class="d_inlinecode donthyphenate notranslate">null_allocator</span><tæ><vîi><li> <a href="std_experimental_allocator_building_blocks_quantizer.html" title="std.experimental.allocator.building_blocks.quantizer"><span class="d_inlinecode donthyphenate notranslate">quantizer<ztpan></a></li><li> �!�!a href="std_experimental_allocator_building_blocks_region.html" title="std.experimental.allocator.building_blocks.region"><span class="d_inlinecode donthyphenate notranslate">region<ztpan></a></li><li> �!�!a href="std_experimental_allocator_building_blocks_scoped_allocator.html" title="std.experimental.allocator.building_blocks.scoped_allocator"><span class="d_inlinecode donthyphenate notranslate">scoped_allocator<ztpan></a></li><li> �!�!a href="std_experimental_allocator_building_blocks_segregator.html" title="std.experimental.allocator.building_blocks.segregator"><span class="d_inlinecode donthyphenate notranslate">segregator<ztpan></a></li><li> �!�!a href="std_experimental_allocator_building_blocks_stats_collector.html"�4itle="std.experimental.allocator.building_blocks.stats_collector"><span class="d_inlinecode donthyphenate notranslate">stats_collector</span><tæ> </li><zùl></li><li> �!�!a href="std_experimental_allocator_common.html" title="std.experimental.allocator.common"><span class="d_inlinecode donthyphenate notranslate">common<ztpan></a></li><li> �!�!a href="std_experimental_allocator_gc_allocator.html" title="std.experimental.allocator.gc_allocator"><span class="d_inlinecode donthyphenate notranslate">gc_allocator<ztpan></a></li><li> �!�!a href="std_experimental_allocator_mallocator.html" title="std.experimental.allocator.mallocator"><span class="d_inlinecode donthyphenate notranslate">mallocator<ztpan></a></li><li> �!�!a href="std_experimental_allocator_mmap_allocator.html" title="std.experimental.allocator.mmap_allocator"><span class="d_inlinecode donthyphenate notranslate">mmap_allocator<ztpan></a></li><li> �!�!a href="std_experimental_allocator_showcase.html" title="std.experimental.allocator.showcase"><span class="d_inlinecode donthyphenate notranslate">showcase<ztpan></a></li><li> �!�!a href="std_experimental_allocator_typed.html"�4itle="std.experimental.allocator.typed"><span class="d_inlinecode donthyphenate notranslate">typed</span><tæ> </li><zùl></li><li> �!�!a href="std_experimental_checkedint.html" title="std.experimental.checkedint"><span class="d_inlinecode donthyphenate notranslate">checkedint<ztpan></a></li><li> �!�!a href="std_experimental_logger.html" title="std.experimental.logger"><span class="d_inlinecode donthyphenate notranslate">logger<ztpan></a><ul><li> <a href="std_experimental_logger_core.html" title="std.experimental.logger.core"><span class="d_inlinecode donthyphenate notranslate">core</span><tæ><vîi><li> <a href="std_experimental_logger_filelogger.html" title="std.experimental.logger.filelogger"><span class="d_inlinecode donthyphenate notranslate">filelogger</span><tæ><vîi><li> <a href="std_experimental_logger_multilogger.html"�4itle="std.experimental.logger.multilogger"><span class="d_inlinecode donthyphenate notranslate">multilogger<ztpan></a></li><li> �!�!a href="std_experimental_logger_nulllogger.html"�4itle="std.experimental.logger.nulllogger"><span class="d_inlinecode donthyphenate notranslate">nulllogger<ztpan></a> �!�!vîi></ul> </li><zùl></li><li> �!�!a href="std_file.html"�4itle="std.file"><span class="d_inlinecode donthyphenate notranslate">file<ztpan></a></li><li> �!�!a href="std_format.html"�4itle="std.format"><span class="d_inlinecode donthyphenate notranslate">format<ztpan></a><ul><li> <h7><span class="d_inlinecode donthyphenate notranslate">internal<ztpan></h7><ul><li> �!�!a href="std_format_internal_floats.html"�4itle="std.format.internal.floats"><span class="d_inlinecode donthyphenate notranslate">floats<ztpan></a></li><li> �!�!a href="std_format_internal_read.html"�4itle="std.format.internal.read"><span class="d_inlinecode donthyphenate notranslate">read<ztpan></a></li><li> �!�!a href="std_format_internal_write.html" title="std.format.internal.write"><span class="d_inlinecode donthyphenate notranslate">write</span><tæ> </li><zùl></li><li> �!�!a href="std_format_read.html" title="std.format.read"><span class="d_inlinecode donthyphenate notranslate">read<ztpan></a></li><li> �!�!a href="std_format_spec.html" title="std.format.spec"><span class="d_inlinecode donthyphenate notranslate">spec<ztpan></a></li><li> �!�!a href="std_format_write.html"�4itle="std.format.write"><span class="d_inlinecode donthyphenate notranslate">write</span><tæ> </li><zùl></li><li> �!�!a href="std_functional.html"�4itle="std.functional"><span class="d_inlinecode donthyphenate notranslate">functional<ztpan></a></li><li> �!�!a href="std_getopt.html"�4itle="std.getopt"><span class="d_inlinecode donthyphenate notranslate">getopt<ztpan></a></li><li> �!�!a href="std_int1�(R´�).html"�4itle="std.int1�(R´�)"><span class="d_inlinecode donthyphenate notranslate">int8<ztpan></a></li><li> �!�!a href="std_json.html"�4itle="std.json"><span class="d_inlinecode donthyphenate notranslate">json<ztpan></a></li><li> �!�!a href="std_logger.html"�4itle="std.logger"><span class="d_inlinecode donthyphenate notranslate">logger<ztpan></a><ul><li> <a href="std_logger_core.html"�4itle="std.logger.core"><span class="d_inlinecode donthyphenate notranslate">core</span><tæ><vîi><li> <a href="std_logger_filelogger.html"�4itle="std.logger.filelogger"><span class="d_inlinecode donthyphenate notranslate">filelogger</span><tæ><vîi><li> <a href="std_logger_multilogger.html" title="std.logger.multilogger"><span class="d_inlinecode donthyphenate notranslate">multilogger<ztpan></a></li><li> �!�!a href="std_logger_nulllogger.html" title="std.logger.nulllogger"><span class="d_inlinecode donthyphenate notranslate">nulllogger<ztpan></a> �!�!vîi></ul><vîi><li> <a href="std_math.html" title="std.math"><span class="d_inlinecode donthyphenate notranslate">math</span><tæ><ul><li> �!�!a href="std_math_algebraic.html"�4itle="std.math.algebraic"><span class="d_inlinecode donthyphenate notranslate">algebraic</span><tæ><vîi><li> <a href="std_math_constants.html" title="std.math.constants"><span class="d_inlinecode donthyphenate notranslate">constants<ztpan></a></li><li> �!�!a href="std_math_exponential.html"�4itle="std.math.exponential"><span class="d_inlinecode donthyphenate notranslate">exponential</span><tæ><vîi><li> <a href="std_math_hardware.html"�4itle="std.math.hardware"><span class="d_inlinecode donthyphenate notranslate">hardware</span><tæ><vîi><li> <a href="std_math_operations.html"�4itle="std.math.operations"><span class="d_inlinecode donthyphenate notranslate">operations</span><tæ><vîi><li> <a href="std_math_remainder.html" title="std.math.remainder"><span class="d_inlinecode donthyphenate notranslate">remainder<ztpan></a></li><li> �!�!a href="std_math_rounding.html" title="std.math.rounding"><span class="d_inlinecode donthyphenate notranslate">rounding<ztpan></a></li><li> �!�!a href="std_math_traits.html" title="std.math.traits"><span class="d_inlinecode donthyphenate notranslate">traits<ztpan></a></li><li> �!�!a href="std_math_trigonometry.html" title="std.math.trigonometry"><span class="d_inlinecode donthyphenate notranslate">trigonometry<ztpan></a> �!�!vîi></ul><vîi><li> <a href="std_mathspecial.html"�4itle="std.mathspecial"><span class="d_inlinecode donthyphenate notranslate">mathspecial<ztpan></a></li><li> �!�!a href="std_meta.html"�4itle="std.meta"><span class="d_inlinecode donthyphenate notranslate">meta<ztpan></a></li><li> �!�!a href="std_mmfile.html"�4itle="std.mmfile"><span class="d_inlinecode donthyphenate notranslate">mmfile<ztpan></a></li><li> �!�!h7><span class="d_inlinecode donthyphenate notranslate">net<ztpan></h7><ul><li> �!�!a href="std_net_curl.html"�4itle="std.net.curl"><span class="d_inlinecode donthyphenate notranslate">curl<ztpan></a></li><li> �!�!a href="std_net_isemail.html" title="std.net.isemail"><span class="d_inlinecode donthyphenate notranslate">isemail</span><tæ> </li><zùl></li><li> �!�!a href="std_numeric.html" title="std.numeric"><span class="d_inlinecode donthyphenate notranslate">numeric</span><tæ><vîi><li> <a href="std_outbuffer.html"�4itle="std.outbuffer"><span class="d_inlinecode donthyphenate notranslate">outbuffer<ztpan></a></li><li> �!�!a href="std_parallelism.html" title="std.parallelism"><span class="d_inlinecode donthyphenate notranslate">parallelism</span><tæ><vîi><li> <a href="std_path.html" title="std.path"><span class="d_inlinecode donthyphenate notranslate">path</span><tæ><vîi><li> <a href="std_process.html"�4itle="std.process"><span class="d_inlinecode donthyphenate notranslate">process<ztpan></a></li><li> �!�!a href="std_random.html"�4itle="std.random"><span class="d_inlinecode donthyphenate notranslate">random<ztpan></a></li><li> �!�!a href="std_range.html" title="std.range"><span class="d_inlinecode donthyphenate notranslate">range</span><tæ><ul><li> �!�!a href="std_range_interfaces.html"�4itle="std.range.interfaces"><span class="d_inlinecode donthyphenate notranslate">interfaces<ztpan></a></li><li> �!�!a href="std_range_primitives.html"�4itle="std.range.primitives"><span class="d_inlinecode donthyphenate notranslate">primitives<ztpan></a> �!�!vîi></ul><vîi><li> <a href="std_regex.html"�4itle="std.regex"><span class="d_inlinecode donthyphenate notranslate">regex<ztpan></a></li><li> �!�!a href="std_signals.html" title="std.signals"><span class="d_inlinecode donthyphenate notranslate">signals</span><tæ><vîi><li> <a href="std_socket.html" title="std.socket"><span class="d_inlinecode donthyphenate notranslate">socket</span><tæ><vîi><li> <a href="std_stdint.html" title="std.stdint"><span class="d_inlinecode donthyphenate notranslate">stdint</span><tæ><vîi><li> <a href="std_stdio.html"�4itle="std.stdio"><span class="d_inlinecode donthyphenate notranslate">stdio<ztpan></a></li><li> �!�!a href="std_string.html"�4itle="std.string"><span class="d_inlinecode donthyphenate notranslate">string<ztpan></a></li><li> �!�!a href="std_sumtype.html" title="std.sumtype"><span class="d_inlinecode donthyphenate notranslate">sumtype</span><tæ><vîi><li> <a href="std_system.html" title="std.system"><span class="d_inlinecode donthyphenate notranslate">system</span><tæ><vîi><li> <a href="std_traits.html" title="std.traits"><span class="d_inlinecode donthyphenate notranslate">traits</span><tæ><vîi><li> <a href="std_typecons.html" title="std.typecons"><span class="d_inlinecode donthyphenate notranslate">typecons</span><tæ><vîi><li> <a href="std_uni.html"�4itle="std.uni"><span class="d_inlinecode donthyphenate notranslate">uni<ztpan></a></li><li> �!�!a href="std_uri.html" title="std.uri"><span class="d_inlinecode donthyphenate notranslate">uri</span><tæ><vîi><li> <a href="std_utf.html"�4itle="std.utf"><span class="d_inlinecode donthyphenate notranslate">utf<ztpan></a></li><li> �!�!a href="std_uuid.html"�4itle="std.uuid"><span class="d_inlinecode donthyphenate notranslate">uuid<ztpan></a></li><li> �!�!a href="std_variant.html" title="std.variant"><span class="d_inlinecode donthyphenate notranslate">variant</span><tæ><vîi><li> <h7><span class="d_inlinecode donthyphenate notranslate">windows</span><vv7><ul><li> <a href="std_windows_charset.html"�4itle="std.windows.charset"><span class="d_inlinecode donthyphenate notranslate">charset<ztpan></a></li><li> �!�!a href="std_windows_syserror.html"�4itle="std.windows.syserror"><span class="d_inlinecode donthyphenate notranslate">syserror<ztpan></a> �!�!vîi></ul><vîi><li> <a href="std_zip.html"�4itle="std.zip"><span class="d_inlinecode donthyphenate notranslate">zip<ztpan></a></li><li> �!�!a href="std_zlib.html"�4itle="std.zlib"><span class="d_inlinecode donthyphenate notranslate">zlib<ztpan></a> <vîi></ul> </li> <li class='expand-container modlist-submenu-etc'><a class='expand-toggle' href='#'><span><em class="tt">etc</em><ztpan></a> <ul><li> �!�!h7><span class="d_inlinecode donthyphenate notranslate">c<ztpan></h7><ul><li> �!�!a href="etc_c_curl.html"�4itle="etc.c.curl"><span class="d_inlinecode donthyphenate notranslate">curl<ztpan></a></li><li> �!�!a href="etc_c_odbc.html"�4itle="etc.c.odbc"><span class="d_inlinecode donthyphenate notranslate">odbc<ztpan></a><ul><li> <a href="etc_c_odbc_odbc0Õ0¡0é0Ã0É.html"�4itle="etc.c.odbc.odbc3�(N �)><span class="d_inlinecode donthyphenate notranslate">odbc0Õ0¡0é0Ã0É</span><tæ><vîi><li> <a href="etc_c_odbc_odbc64.html"�4itle="etc.c.odbc.odbc64"><span class="d_inlinecode donthyphenate notranslate">odbc64</span><tæ><vîi><li> <a href="etc_c_odbc_sql.html" title="etc.c.odbc.sql"><span class="d_inlinecode donthyphenate notranslate">sql<ztpan></a></li><li> �!�!a href="etc_c_odbc_sqlext.html" title="etc.c.odbc.sqlext"><span class="d_inlinecode donthyphenate notranslate">sqlext<ztpan></a></li><li> �!�!a href="etc_c_odbc_sqltypes.html" title="etc.c.odbc.sqltypes"><span class="d_inlinecode donthyphenate notranslate">sqltypes<ztpan></a></li><li> �!�!a href="etc_c_odbc_sqlucode.html" title="etc.c.odbc.sqlucode"><span class="d_inlinecode donthyphenate notranslate">sqlucode<ztpan></a> �!�!vîi></ul><vîi><li> <a href="etc_c_sqlite3.html"�4itle="etc.c.sqlite0»0ó0Á><span class="d_inlinecode donthyphenate notranslate">sqlite0Ù0ü0¿ztpan></a></li><li> �!�!a href="etc_c_zlib.html"�4itle="etc.c.zlib"><span class="d_inlinecode donthyphenate notranslate">zlib<ztpan></a> �!�!vîi></ul><vîi><li> <h7><span class="d_inlinecode donthyphenate notranslate">valgrind<ztpan></h7><ul><li> �!�!a href="etc_valgrind_valgrind.html" title="etc.valgrind.valgrind"><span class="d_inlinecode donthyphenate notranslate">valgrind<ztpan></a> �!�!vîi></ul> </li><zùl> <vîi> <li class='expand-container modlist-submenu-core'><a class='expand-toggle' href='#'><span><em class="tt">core<u0m></span><tæ> <ul><li> <a href="core_atomic.html"�4itle="core.atomic"><span class="d_inlinecode donthyphenate notranslate">atomic</span><tæ><vîi><li> <a href="core_attribute.html" title="core.attribute"><span class="d_inlinecode donthyphenate notranslate">attribute<ztpan></a></li><li> �!�!a href="core_bitop.html"�4itle="core.bitop"><span class="d_inlinecode donthyphenate notranslate">bitop</span><tæ><vîi><li> <a href="core_builtins.html"�4itle="core.builtins"><span class="d_inlinecode donthyphenate notranslate">builtins</span><tæ><vîi><li> <a href="core_checkedint.html"�4itle="core.checkedint"><span class="d_inlinecode donthyphenate notranslate">checkedint</span><tæ><vîi><li> <a href="core_cpuid.html" title="core.cpuid"><span class="d_inlinecode donthyphenate notranslate">cpuid<ztpan></a></li><li> �!�!a href="core_demangle.html" title="core.demangle"><span class="d_inlinecode donthyphenate notranslate">demangle<ztpan></a></li><li> �!�!a href="core_exception.html"�4itle="core.exception"><span class="d_inlinecode donthyphenate notranslate">exception</span><tæ><vîi><li> <a href="core_factory.html" title="core.factory"><span class="d_inlinecode donthyphenate notranslate">factory<ztpan></a></li><li> �!�!h7><span class="d_inlinecode donthyphenate notranslate">gc</span><vv7><ul><li> <a href="core_gc_config.html" title="core.gc.config"><span class="d_inlinecode donthyphenate notranslate">config</span><tæ><vîi><li> <a href="core_gc_gcinterface.html"�4itle="core.gc.gcinterface"><span class="d_inlinecode donthyphenate notranslate">gcinterface<ztpan></a></li><li> �!�!a href="core_gc_registry.html"�4itle="core.gc.registry"><span class="d_inlinecode donthyphenate notranslate">registry<ztpan></a> �!�!vîi></ul><vîi><li> <a href="core_int1�(R´�).html"�4itle="core.int8"><span class="d_inlinecode donthyphenate notranslate">int1�(R´�)</span><tæ><vîi><li> <a href="core_interpolation.html" title="core.interpolation"><span class="d_inlinecode donthyphenate notranslate">interpolation<ztpan></a></li><li> �!�!a href="core_lifetime.html" title="core.lifetime"><span class="d_inlinecode donthyphenate notranslate">lifetime<ztpan></a></li><li> �!�!a href="core_math.html" title="core.math"><span class="d_inlinecode donthyphenate notranslate">math<ztpan></a></li><li> �!�!a href="core_memory.html" title="core.memory"><span class="d_inlinecode donthyphenate notranslate">memory<ztpan></a></li><li> �!�!a href="core_runtime.html"�4itle="core.runtime"><span class="d_inlinecode donthyphenate notranslate">runtime</span><tæ><vîi><li> <a href="core_simd.html"�4itle="core.simd"><span class="d_inlinecode donthyphenate notranslate">simd</span><tæ><vîi><li> <h7><span class="d_inlinecode donthyphenate notranslate">stdc<ztpan></h7><ul><li> �!�!a href="core_stdc_assert_.html" title="core.stdc.assert_"><span class="d_inlinecode donthyphenate notranslate">assert_</span><tæ><vîi><li> <a href="core_stdc_complex.html"�4itle="core.stdc.complex"><span class="d_inlinecode donthyphenate notranslate">complex<ztpan></a></li><li> �!�!a href="core_stdc_ctype.html" title="core.stdc.ctype"><span class="d_inlinecode donthyphenate notranslate">ctype</span><tæ><vîi><li> <a href="core_stdc_errno.html"�4itle="core.stdc.errno"><span class="d_inlinecode donthyphenate notranslate">errno<ztpan></a></li><li> �!�!a href="core_stdc_fenv.html"�4itle="core.stdc.fenv"><span class="d_inlinecode donthyphenate notranslate">fenv<ztpan></a></li><li> �!�!a href="core_stdc_float_.html"�4itle="core.stdc.float_"><span class="d_inlinecode donthyphenate notranslate">float_<ztpan></a></li><li> �!�!a href="core_stdc_inttypes.html"�4itle="core.stdc.inttypes"><span class="d_inlinecode donthyphenate notranslate">inttypes<ztpan></a></li><li> �!�!a href="core_stdc_limits.html"�4itle="core.stdc.limits"><span class="d_inlinecode donthyphenate notranslate">limits<ztpan></a></li><li> �!�!a href="core_stdc_locale.html"�4itle="core.stdc.locale"><span class="d_inlinecode donthyphenate notranslate">locale<ztpan></a></li><li> �!�!a href="core_stdc_math.html"�4itle="core.stdc.math"><span class="d_inlinecode donthyphenate notranslate">math<ztpan></a></li><li> �!�!a href="core_stdc_signal.html"�4itle="core.stdc.signal"><span class="d_inlinecode donthyphenate notranslate">signal<ztpan></a></li><li> �!�!a href="core_stdc_stdarg.html"�4itle="core.stdc.stdarg"><span class="d_inlinecode donthyphenate notranslate">stdarg<ztpan></a></li><li> �!�!a href="core_stdc_stdatomic.html" title="core.stdc.stdatomic"><span class="d_inlinecode donthyphenate notranslate">stdatomic</span><tæ><vîi><li> <a href="core_stdc_stddef.html" title="core.stdc.stddef"><span class="d_inlinecode donthyphenate notranslate">stddef</span><tæ><vîi><li> <a href="core_stdc_stdint.html" title="core.stdc.stdint"><span class="d_inlinecode donthyphenate notranslate">stdint</span><tæ><vîi><li> <a href="core_stdc_stdio.html"�4itle="core.stdc.stdio"><span class="d_inlinecode donthyphenate notranslate">stdio<ztpan></a></li><li> �!�!a href="core_stdc_stdlib.html"�4itle="core.stdc.stdlib"><span class="d_inlinecode donthyphenate notranslate">stdlib<ztpan></a></li><li> �!�!a href="core_stdc_string.html"�4itle="core.stdc.string"><span class="d_inlinecode donthyphenate notranslate">string<ztpan></a></li><li> �!�!a href="core_stdc_tgmath.html"�4itle="core.stdc.tgmath"><span class="d_inlinecode donthyphenate notranslate">tgmath<ztpan></a></li><li> �!�!a href="core_stdc_time.html"�4itle="core.stdc.time"><span class="d_inlinecode donthyphenate notranslate">time<ztpan></a></li><li> �!�!a href="core_stdc_wchar_.html"�4itle="core.stdc.wchar_"><span class="d_inlinecode donthyphenate notranslate">wchar_<ztpan></a></li><li> �!�!a href="core_stdc_wctype.html"�4itle="core.stdc.wctype"><span class="d_inlinecode donthyphenate notranslate">wctype<ztpan></a> �!�!vîi></ul><vîi><li> <h7><span class="d_inlinecode donthyphenate notranslate">stdcpp<ztpan></h7><ul><li> �!�!a href="core_stdcpp_allocator.html" title="core.stdcpp.allocator"><span class="d_inlinecode donthyphenate notranslate">allocator</span><tæ><vîi><li> <a href="core_stdcpp_array.html"�4itle="core.stdcpp.array"><span class="d_inlinecode donthyphenate notranslate">array<ztpan></a></li><li> �!�!a href="core_stdcpp_exception.html" title="core.stdcpp.exception"><span class="d_inlinecode donthyphenate notranslate">exception</span><tæ><vîi><li> <a href="core_stdcpp_memory.html" title="core.stdcpp.memory"><span class="d_inlinecode donthyphenate notranslate">memory</span><tæ><vîi><li> <a href="core_stdcpp_new_.html" title="core.stdcpp.new_"><span class="d_inlinecode donthyphenate notranslate">new_</span><tæ><vîi><li> <a href="core_stdcpp_string.html" title="core.stdcpp.string"><span class="d_inlinecode donthyphenate notranslate">string</span><tæ><vîi><li> <a href="core_stdcpp_string_view.html"�4itle="core.stdcpp.string_view"><span class="d_inlinecode donthyphenate notranslate">string_view<ztpan></a></li><li> �!�!a href="core_stdcpp_type_traits.html" title="core.stdcpp.type_traits"><span class="d_inlinecode donthyphenate notranslate">type_traits</span><tæ><vîi><li> <a href="core_stdcpp_typeinfo.html" title="core.stdcpp.typeinfo"><span class="d_inlinecode donthyphenate notranslate">typeinfo</span><tæ><vîi><li> <a href="core_stdcpp_utility.html"�4itle="core.stdcpp.utility"><span class="d_inlinecode donthyphenate notranslate">utility<ztpan></a></li><li> �!�!a href="core_stdcpp_vector.html"�4itle="core.stdcpp.vector"><span class="d_inlinecode donthyphenate notranslate">vector<ztpan></a></li><li> �!�!a href="core_stdcpp_xutility.html"�4itle="core.stdcpp.xutility"><span class="d_inlinecode donthyphenate notranslate">xutility<ztpan></a> �!�!vîi></ul><vîi><li> <a href="core_sync.html"�4itle="core.sync"><span class="d_inlinecode donthyphenate notranslate">sync</span><tæ><ul><li> �!�!a href="core_sync_barrier.html" title="core.sync.barrier"><span class="d_inlinecode donthyphenate notranslate">barrier</span><tæ><vîi><li> <a href="core_sync_condition.html"�4itle="core.sync.condition"><span class="d_inlinecode donthyphenate notranslate">condition<ztpan></a></li><li> �!�!a href="core_sync_config.html"�4itle="core.sync.config"><span class="d_inlinecode donthyphenate notranslate">config<ztpan></a></li><li> �!�!a href="core_sync_event.html" title="core.sync.event"><span class="d_inlinecode donthyphenate notranslate">event</span><tæ><vîi><li> <a href="core_sync_exception.html"�4itle="core.sync.exception"><span class="d_inlinecode donthyphenate notranslate">exception<ztpan></a></li><li> �!�!a href="core_sync_mutex.html" title="core.sync.mutex"><span class="d_inlinecode donthyphenate notranslate">mutex</span><tæ><vîi><li> <a href="core_sync_rwmutex.html"�4itle="core.sync.rwmutex"><span class="d_inlinecode donthyphenate notranslate">rwmutex<ztpan></a></li><li> �!�!a href="core_sync_semaphore.html" title="core.sync.semaphore"><span class="d_inlinecode donthyphenate notranslate">semaphore</span><tæ> </li><zùl></li><li> �!�!a href="core_thread.html" title="core.thread"><span class="d_inlinecode donthyphenate notranslate">thread<ztpan></a><ul><li> <a href="core_thread_context.html"�4itle="core.thread.context"><span class="d_inlinecode donthyphenate notranslate">context<ztpan></a></li><li> �!�!a href="core_thread_fiber.html" title="core.thread.fiber"><span class="d_inlinecode donthyphenate notranslate">fiber</span><tæ><ul><li> �!�!a href="core_thread_fiber_base.html"�4itle="core.thread.fiber.base"><span class="d_inlinecode donthyphenate notranslate">base<ztpan></a> �!�!vîi></ul><vîi><li> <a href="core_thread_osthread.html" title="core.thread.osthread"><span class="d_inlinecode donthyphenate notranslate">osthread</span><tæ><vîi><li> <a href="core_thread_threadbase.html" title="core.thread.threadbase"><span class="d_inlinecode donthyphenate notranslate">threadbase</span><tæ><vîi><li> <a href="core_thread_threadgroup.html"�4itle="core.thread.threadgroup"><span class="d_inlinecode donthyphenate notranslate">threadgroup<ztpan></a></li><li> �!�!a href="core_thread_types.html" title="core.thread.types"><span class="d_inlinecode donthyphenate notranslate">types</span><tæ> </li><zùl></li><li> �!�!a href="core_time.html" title="core.time"><span class="d_inlinecode donthyphenate notranslate">time<ztpan></a></li><li> �!�!a href="core_vararg.html" title="core.vararg"><span class="d_inlinecode donthyphenate notranslate">vararg<ztpan></a></li><li> �!�!a href="core_volatile.html" title="core.volatile"><span class="d_inlinecode donthyphenate notranslate">volatile<ztpan></a> <vîi></ul> </li> <div class="modlist-internal-separator">Internal API</div> <li class='expand-container modlist-submenu-core'><a class='expand-toggle' href='#'><span><em class="tt">core<u0m></span><tæ> <ul><li> <h7><span class="d_inlinecode donthyphenate notranslate">internal<ztpan></h7><ul><li> �!�!h7><span class="d_inlinecode donthyphenate notranslate">array<ztpan></h7><ul><li> �!�!a href="core_internal_array_appending.html" title="core.internal.array.appending"><span class="d_inlinecode donthyphenate notranslate">appending</span><tæ><vîi><li> <a href="core_internal_array_arrayassign.html"�4itle="core.internal.array.arrayassign"><span class="d_inlinecode donthyphenate notranslate">arrayassign<ztpan></a></li><li> �!�!a href="core_internal_array_capacity.html"�4itle="core.internal.array.capacity"><span class="d_inlinecode donthyphenate notranslate">capacity<ztpan></a></li><li> �!�!a href="core_internal_array_casting.html" title="core.internal.array.casting"><span class="d_inlinecode donthyphenate notranslate">casting</span><tæ><vîi><li> <a href="core_internal_array_comparison.html" title="core.internal.array.comparison"><span class="d_inlinecode donthyphenate notranslate">comparison</span><tæ><vîi><li> <a href="core_internal_array_concatenation.html"�4itle="core.internal.array.concatenation"><span class="d_inlinecode donthyphenate notranslate">concatenation<ztpan></a></li><li> �!�!a href="core_internal_array_construction.html"�4itle="core.internal.array.construction"><span class="d_inlinecode donthyphenate notranslate">construction<ztpan></a></li><li> �!�!a href="core_internal_array_duplication.html" title="core.internal.array.duplication"><span class="d_inlinecode donthyphenate notranslate">duplication</span><tæ><vîi><li> <a href="core_internal_array_equality.html" title="core.internal.array.equality"><span class="d_inlinecode donthyphenate notranslate">equality</span><tæ><vîi><li> <a href="core_internal_array_operations.html" title="core.internal.array.operations"><span class="d_inlinecode donthyphenate notranslate">operations</span><tæ><vîi><li> <a href="core_internal_array_utils.html"�4itle="core.internal.array.utils"><span class="d_inlinecode donthyphenate notranslate">utils<ztpan></a> �!�!vîi></ul><vîi><li> <h7><span class="d_inlinecode donthyphenate notranslate">util<ztpan></h7><ul><li> �!�!a href="core_internal_util_array.html"�4itle="core.internal.util.array"><span class="d_inlinecode donthyphenate notranslate">array</span><tæ><vîi><li> <a href="core_internal_util_math.html"�4itle="core.internal.util.math"><span class="d_inlinecode donthyphenate notranslate">math</span><tæ> </li><zùl> �!�!vîi></ul> </li><zùl> <vîi> <li class='expand-container modlist-submenu-dmd'><a class='expand-toggle' href='#'><span><em class="tt">dmd<u0m></span><tæ> <ul><li> <a href="dmd_access.html" title="dmd.access"><span class="d_inlinecode donthyphenate notranslate">access</span><tæ><vîi><li> <a href="dmd_aggregate.html"�4itle="dmd.aggregate"><span class="d_inlinecode donthyphenate notranslate">aggregate<ztpan></a></li><li> �!�!a href="dmd_aliasthis.html" title="dmd.aliasthis"><span class="d_inlinecode donthyphenate notranslate">aliasthis</span><tæ><vîi><li> <a href="dmd_argtypes_aarch64.html" title="dmd.argtypes_aarch64"><span class="d_inlinecode donthyphenate notranslate">argtypes_aarch64</span><tæ><vîi><li> <a href="dmd_argtypes_sysv_x64.html"�4itle="dmd.argtypes_sysv_x64"><span class="d_inlinecode donthyphenate notranslate">argtypes_sysv_x64<ztpan></a></li><li> �!�!a href="dmd_argtypes_x86.html"�4itle="dmd.argtypes_x86"><span class="d_inlinecode donthyphenate notranslate">argtypes_x86<ztpan></a></li><li> �!�!a href="dmd_arrayop.html" title="dmd.arrayop"><span class="d_inlinecode donthyphenate notranslate">arrayop</span><tæ><vîi><li> <a href="dmd_arraytypes.html" title="dmd.arraytypes"><span class="d_inlinecode donthyphenate notranslate">arraytypes</span><tæ><vîi><li> <a href="dmd_ast_node.html" title="dmd.ast_node"><span class="d_inlinecode donthyphenate notranslate">ast_node</span><tæ><vîi><li> <a href="dmd_astbase.html"�4itle="dmd.astbase"><span class="d_inlinecode donthyphenate notranslate">astbase<ztpan></a></li><li> �!�!a href="dmd_astcodegen.html"�4itle="dmd.astcodegen"><span class="d_inlinecode donthyphenate notranslate">astcodegen<ztpan></a></li><li> �!�!a href="dmd_astenums.html"�4itle="dmd.astenums"><span class="d_inlinecode donthyphenate notranslate">astenums<ztpan></a></li><li> �!�!a href="dmd_asttypename.html" title="dmd.asttypename"><span class="d_inlinecode donthyphenate notranslate">asttypename</span><tæ><vîi><li> <a href="dmd_attrib.html" title="dmd.attrib"><span class="d_inlinecode donthyphenate notranslate">attrib</span><tæ><vîi><li> <a href="dmd_attribsem.html"�4itle="dmd.attribsem"><span class="d_inlinecode donthyphenate notranslate">attribsem<ztpan></a></li><li> �!�!h7><span class="d_inlinecode donthyphenate notranslate">backend<ztpan></h7><ul><li> �!�!a href="dmd_backend_aarray.html"�4itle="dmd.backend.aarray"><span class="d_inlinecode donthyphenate notranslate">aarray<ztpan></a></li><li> �!�!h7><span class="d_inlinecode donthyphenate notranslate">arm<ztpan></h7><ul><li> �!�!a href="dmd_backend_arm_cod1.html"�4itle="dmd.backend.arm.cod1"><span class="d_inlinecode donthyphenate notranslate">cod²ztpan></a></li><li> �!�!a href="dmd_backend_arm_cod2.html"�4itle="dmd.backend.arm.cod2"><span class="d_inlinecode donthyphenate notranslate">cod�(vã�)ztpan></a></li><li> �!�!a href="dmd_backend_arm_cod3.html"�4itle="dmd.backend.arm.cod3"><span class="d_inlinecode donthyphenate notranslate">cod0Ù0ü0¿ztpan></a></li><li> �!�!a href="dmd_backend_arm_cod4.html"�4itle="dmd.backend.arm.cod4"><span class="d_inlinecode donthyphenate notranslate">cod4<ztpan></a></li><li> �!�!a href="dmd_backend_arm_disasmarm.html" title="dmd.backend.arm.disasmarm"><span class="d_inlinecode donthyphenate notranslate">disasmarm</span><tæ><vîi><li> <a href="dmd_backend_arm_instr.html"�4itle="dmd.backend.arm.instr"><span class="d_inlinecode donthyphenate notranslate">instr<ztpan></a> �!�!vîi></ul><vîi><li> <a href="dmd_backend_backconfig.html" title="dmd.backend.backconfig"><span class="d_inlinecode donthyphenate notranslate">backconfig</span><tæ><vîi><li> <a href="dmd_backend_barray.html" title="dmd.backend.barray"><span class="d_inlinecode donthyphenate notranslate">barray</span><tæ><vîi><li> <a href="dmd_backend_bcomplex.html" title="dmd.backend.bcomplex"><span class="d_inlinecode donthyphenate notranslate">bcomplex</span><tæ><vîi><li> <a href="dmd_backend_blockopt.html" title="dmd.backend.blockopt"><span class="d_inlinecode donthyphenate notranslate">blockopt</span><tæ><vîi><li> <a href="dmd_backend_cc.html" title="dmd.backend.cc"><span class="d_inlinecode donthyphenate notranslate">cc</span><tæ><vîi><li> <a href="dmd_backend_cdef.html" title="dmd.backend.cdef"><span class="d_inlinecode donthyphenate notranslate">cdef</span><tæ><vîi><li> <a href="dmd_backend_cg.html" title="dmd.backend.cg"><span class="d_inlinecode donthyphenate notranslate">cg</span><tæ><vîi><li> <a href="dmd_backend_cgcs.html" title="dmd.backend.cgcs"><span class="d_inlinecode donthyphenate notranslate">cgcs</span><tæ><vîi><li> <a href="dmd_backend_cgcse.html"�4itle="dmd.backend.cgcse"><span class="d_inlinecode donthyphenate notranslate">cgcse<ztpan></a></li><li> �!�!a href="dmd_backend_cgcv.html"�4itle="dmd.backend.cgcv"><span class="d_inlinecode donthyphenate notranslate">cgcv<ztpan></a></li><li> �!�!a href="dmd_backend_cgelem.html"�4itle="dmd.backend.cgelem"><span class="d_inlinecode donthyphenate notranslate">cgelem<ztpan></a></li><li> �!�!a href="dmd_backend_cgen.html"�4itle="dmd.backend.cgen"><span class="d_inlinecode donthyphenate notranslate">cgen<ztpan></a></li><li> �!�!a href="dmd_backend_cgsched.html" title="dmd.backend.cgsched"><span class="d_inlinecode donthyphenate notranslate">cgsched</span><tæ><vîi><li> <a href="dmd_backend_code.html" title="dmd.backend.code"><span class="d_inlinecode donthyphenate notranslate">code</span><tæ><vîi><li> <a href="dmd_backend_codebuilder.html"�4itle="dmd.backend.codebuilder"><span class="d_inlinecode donthyphenate notranslate">codebuilder<ztpan></a></li><li> �!�!a href="dmd_backend_cv4.html" title="dmd.backend.cv4"><span class="d_inlinecode donthyphenate notranslate">cv4</span><tæ><vîi><li> <a href="dmd_backend_cv8.html"�4itle="dmd.backend.cv8"><span class="d_inlinecode donthyphenate notranslate">cv8<ztpan></a></li><li> �!�!a href="dmd_backend_dcgcv.html" title="dmd.backend.dcgcv"><span class="d_inlinecode donthyphenate notranslate">dcgcv</span><tæ><vîi><li> <a href="dmd_backend_dcode.html"�4itle="dmd.backend.dcode"><span class="d_inlinecode donthyphenate notranslate">dcode<ztpan></a></li><li> �!�!a href="dmd_backend_debugprint.html"�4itle="dmd.backend.debugprint"><span class="d_inlinecode donthyphenate notranslate">debugprint<ztpan></a></li><li> �!�!a href="dmd_backend_divcoeff.html"�4itle="dmd.backend.divcoeff"><span class="d_inlinecode donthyphenate notranslate">divcoeff<ztpan></a></li><li> �!�!a href="dmd_backend_dlist.html" title="dmd.backend.dlist"><span class="d_inlinecode donthyphenate notranslate">dlist</span><tæ><vîi><li> <a href="dmd_backend_dout.html" title="dmd.backend.dout"><span class="d_inlinecode donthyphenate notranslate">dout</span><tæ><vîi><li> <a href="dmd_backend_drtlsym.html"�4itle="dmd.backend.drtlsym"><span class="d_inlinecode donthyphenate notranslate">drtlsym<ztpan></a></li><li> �!�!a href="dmd_backend_dt.html"�4itle="dmd.backend.dt"><span class="d_inlinecode donthyphenate notranslate">dt<ztpan></a></li><li> �!�!a href="dmd_backend_dtype.html" title="dmd.backend.dtype"><span class="d_inlinecode donthyphenate notranslate">dtype</span><tæ><vîi><li> <a href="dmd_backend_dvarstats.html"�4itle="dmd.backend.dvarstats"><span class="d_inlinecode donthyphenate notranslate">dvarstats<ztpan></a></li><li> �!�!a href="dmd_backend_dvec.html"�4itle="dmd.backend.dvec"><span class="d_inlinecode donthyphenate notranslate">dvec<ztpan></a></li><li> �!�!a href="dmd_backend_dwarf.html" title="dmd.backend.dwarf"><span class="d_inlinecode donthyphenate notranslate">dwarf</span><tæ><vîi><li> <a href="dmd_backend_dwarf�(‘Ñ�)html" title="dmd.backend.dwarf�(N �)><span class="d_inlinecode donthyphenate notranslate">dwarf2</span><tæ><vîi><li> <a href="dmd_backend_dwarfdbginf.html"�4itle="dmd.backend.dwarfdbginf"><span class="d_inlinecode donthyphenate notranslate">dwarfdbginf<ztpan></a></li><li> �!�!a href="dmd_backend_dwarfeh.html" title="dmd.backend.dwarfeh"><span class="d_inlinecode donthyphenate notranslate">dwarfeh</span><tæ><vîi><li> <a href="dmd_backend_ee.html" title="dmd.backend.ee"><span class="d_inlinecode donthyphenate notranslate">ee</span><tæ><vîi><li> <a href="dmd_backend_eh.html" title="dmd.backend.eh"><span class="d_inlinecode donthyphenate notranslate">eh</span><tæ><vîi><li> <a href="dmd_backend_el.html" title="dmd.backend.el"><span class="d_inlinecode donthyphenate notranslate">el</span><tæ><vîi><li> <a href="dmd_backend_elem.html" title="dmd.backend.elem"><span class="d_inlinecode donthyphenate notranslate">elem</span><tæ><vîi><li> <a href="dmd_backend_elfobj.html" title="dmd.backend.elfobj"><span class="d_inlinecode donthyphenate notranslate">elfobj</span><tæ><vîi><li> <a href="dmd_backend_elpicpie.html" title="dmd.backend.elpicpie"><span class="d_inlinecode donthyphenate notranslate">elpicpie</span><tæ><vîi><li> <a href="dmd_backend_evalu8.html" title="dmd.backend.evalu8"><span class="d_inlinecode donthyphenate notranslate">evalu8</span><tæ><vîi><li> <a href="dmd_backend_fp.html" title="dmd.backend.fp"><span class="d_inlinecode donthyphenate notranslate">fp</span><tæ><vîi><li> <a href="dmd_backend_gdag.html" title="dmd.backend.gdag"><span class="d_inlinecode donthyphenate notranslate">gdag</span><tæ><vîi><li> <a href="dmd_backend_gflow.html"�4itle="dmd.backend.gflow"><span class="d_inlinecode donthyphenate notranslate">gflow<ztpan></a></li><li> �!�!a href="dmd_backend_global.html"�4itle="dmd.backend.global"><span class="d_inlinecode donthyphenate notranslate">global<ztpan></a></li><li> �!�!a href="dmd_backend_glocal.html"�4itle="dmd.backend.glocal"><span class="d_inlinecode donthyphenate notranslate">glocal<ztpan></a></li><li> �!�!a href="dmd_backend_gloop.html" title="dmd.backend.gloop"><span class="d_inlinecode donthyphenate notranslate">gloop</span><tæ><vîi><li> <a href="dmd_backend_go.html" title="dmd.backend.go"><span class="d_inlinecode donthyphenate notranslate">go</span><tæ><vîi><li> <a href="dmd_backend_goh.html"�4itle="dmd.backend.goh"><span class="d_inlinecode donthyphenate notranslate">goh<ztpan></a></li><li> �!�!a href="dmd_backend_gother.html"�4itle="dmd.backend.gother"><span class="d_inlinecode donthyphenate notranslate">gother<ztpan></a></li><li> �!�!a href="dmd_backend_gsroa.html" title="dmd.backend.gsroa"><span class="d_inlinecode donthyphenate notranslate">gsroa</span><tæ><vîi><li> <a href="dmd_backend_iasm.html" title="dmd.backend.iasm"><span class="d_inlinecode donthyphenate notranslate">iasm</span><tæ><vîi><li> <a href="dmd_backend_inliner.html"�4itle="dmd.backend.inliner"><span class="d_inlinecode donthyphenate notranslate">inliner<ztpan></a></li><li> �!�!a href="dmd_backend_mach.html"�4itle="dmd.backend.mach"><span class="d_inlinecode donthyphenate notranslate">mach<ztpan></a></li><li> �!�!a href="dmd_backend_machobj.html" title="dmd.backend.machobj"><span class="d_inlinecode donthyphenate notranslate">machobj</span><tæ><vîi><li> <a href="dmd_backend_melf.html" title="dmd.backend.melf"><span class="d_inlinecode donthyphenate notranslate">melf</span><tæ><vîi><li> <a href="dmd_backend_mem.html"�4itle="dmd.backend.mem"><span class="d_inlinecode donthyphenate notranslate">mem<ztpan></a></li><li> �!�!a href="dmd_backend_mscoff.html"�4itle="dmd.backend.mscoff"><span class="d_inlinecode donthyphenate notranslate">mscoff<ztpan></a></li><li> �!�!a href="dmd_backend_mscoffobj.html" title="dmd.backend.mscoffobj"><span class="d_inlinecode donthyphenate notranslate">mscoffobj</span><tæ><vîi><li> <a href="dmd_backend_obj.html"�4itle="dmd.backend.obj"><span class="d_inlinecode donthyphenate notranslate">obj<ztpan></a></li><li> �!�!a href="dmd_backend_oper.html"�4itle="dmd.backend.oper"><span class="d_inlinecode donthyphenate notranslate">oper<ztpan></a></li><li> �!�!a href="dmd_backend_pdata.html" title="dmd.backend.pdata"><span class="d_inlinecode donthyphenate notranslate">pdata</span><tæ><vîi><li> <a href="dmd_backend_ptrntab.html"�4itle="dmd.backend.ptrntab"><span class="d_inlinecode donthyphenate notranslate">ptrntab<ztpan></a></li><li> �!�!a href="dmd_backend_rtlsym.html"�4itle="dmd.backend.rtlsym"><span class="d_inlinecode donthyphenate notranslate">rtlsym<ztpan></a></li><li> �!�!a href="dmd_backend_symbol.html"�4itle="dmd.backend.symbol"><span class="d_inlinecode donthyphenate notranslate">symbol<ztpan></a></li><li> �!�!a href="dmd_backend_symtab.html"�4itle="dmd.backend.symtab"><span class="d_inlinecode donthyphenate notranslate">symtab<ztpan></a></li><li> �!�!a href="dmd_backend_ty.html"�4itle="dmd.backend.ty"><span class="d_inlinecode donthyphenate notranslate">ty<ztpan></a></li><li> �!�!a href="dmd_backend_type.html"�4itle="dmd.backend.type"><span class="d_inlinecode donthyphenate notranslate">type<ztpan></a></li><li> �!�!a href="dmd_backend_util�(‘Ñ�)html" title="dmd.backend.util2"><span class="d_inlinecode donthyphenate notranslate">util2</span><tæ><vîi><li> <a href="dmd_backend_var.html"�4itle="dmd.backend.var"><span class="d_inlinecode donthyphenate notranslate">var<ztpan></a></li><li> �!�!h7><span class="d_inlinecode donthyphenate notranslate">x86<ztpan></h7><ul><li> �!�!a href="dmd_backend_x86_cg87.html"�4itle="dmd.backend.x86.cg87"><span class="d_inlinecode donthyphenate notranslate">cg87<ztpan></a></li><li> �!�!a href="dmd_backend_x86_cgcod.html" title="dmd.backend.x86.cgcod"><span class="d_inlinecode donthyphenate notranslate">cgcod</span><tæ><vîi><li> <a href="dmd_backend_x86_cgreg.html"�4itle="dmd.backend.x86.cgreg"><span class="d_inlinecode donthyphenate notranslate">cgreg<ztpan></a></li><li> �!�!a href="dmd_backend_x86_cgxmm.html" title="dmd.backend.x86.cgxmm"><span class="d_inlinecode donthyphenate notranslate">cgxmm</span><tæ><vîi><li> <a href="dmd_backend_x86_cod1.html" title="dmd.backend.x86.cod1"><span class="d_inlinecode donthyphenate notranslate">cod1</span><tæ><vîi><li> <a href="dmd_backend_x86_cod�(‘Ñ�)html" title="dmd.backend.x86.cod�(N �)><span class="d_inlinecode donthyphenate notranslate">cod2</span><tæ><vîi><li> <a href="dmd_backend_x86_cod0Ô0¢0¹0È0ëhtml" title="dmd.backend.x86.cod0»0ó0Á><span class="d_inlinecode donthyphenate notranslate">cod3</span><tæ><vîi><li> <a href="dmd_backend_x86_cod4.html" title="dmd.backend.x86.cod4"><span class="d_inlinecode donthyphenate notranslate">cod4</span><tæ><vîi><li> <a href="dmd_backend_x86_cod5.html" title="dmd.backend.x86.cod5"><span class="d_inlinecode donthyphenate notranslate">cod5</span><tæ><vîi><li> <a href="dmd_backend_x86_code_x86.html" title="dmd.backend.x86.code_x86"><span class="d_inlinecode donthyphenate notranslate">code_x86</span><tæ><vîi><li> <a href="dmd_backend_x86_disasm86.html" title="dmd.backend.x86.disasm86"><span class="d_inlinecode donthyphenate notranslate">disasm86</span><tæ><vîi><li> <a href="dmd_backend_x86_nteh.html" title="dmd.backend.x86.nteh"><span class="d_inlinecode donthyphenate notranslate">nteh</span><tæ><vîi><li> <a href="dmd_backend_x86_xmm.html"�4itle="dmd.backend.x86.xmm"><span class="d_inlinecode donthyphenate notranslate">xmm<ztpan></a> �!�!vîi></ul> </li><zùl></li><li> �!�!a href="dmd_blockexit.html" title="dmd.blockexit"><span class="d_inlinecode donthyphenate notranslate">blockexit</span><tæ><vîi><li> <a href="dmd_builtin.html"�4itle="dmd.builtin"><span class="d_inlinecode donthyphenate notranslate">builtin<ztpan></a></li><li> �!�!a href="dmd_canthrow.html"�4itle="dmd.canthrow"><span class="d_inlinecode donthyphenate notranslate">canthrow<ztpan></a></li><li> �!�!a href="dmd_chkformat.html" title="dmd.chkformat"><span class="d_inlinecode donthyphenate notranslate">chkformat</span><tæ><vîi><li> <a href="dmd_cli.html"�4itle="dmd.cli"><span class="d_inlinecode donthyphenate notranslate">cli<ztpan></a></li><li> �!�!a href="dmd_clone.html" title="dmd.clone"><span class="d_inlinecode donthyphenate notranslate">clone</span><tæ><vîi><li> <h7><span class="d_inlinecode donthyphenate notranslate">common<ztpan></h7><ul><li> �!�!a href="dmd_common_bitfields.html"�4itle="dmd.common.bitfields"><span class="d_inlinecode donthyphenate notranslate">bitfields</span><tæ><vîi><li> <a href="dmd_common_blake3.html"�4itle="dmd.common.blake0»0ó0Á><span class="d_inlinecode donthyphenate notranslate">blake3</span><tæ><vîi><li> <a href="dmd_common_charactertables.html" title="dmd.common.charactertables"><span class="d_inlinecode donthyphenate notranslate">charactertables<ztpan></a></li><li> �!�!a href="dmd_common_file.html" title="dmd.common.file"><span class="d_inlinecode donthyphenate notranslate">file<ztpan></a></li><li> �!�!a href="dmd_common_identifiertables.html" title="dmd.common.identifiertables"><span class="d_inlinecode donthyphenate notranslate">identifiertables<ztpan></a></li><li> �!�!a href="dmd_common_int8.html" title="dmd.common.int1�(R´�)"><span class="d_inlinecode donthyphenate notranslate">int8<ztpan></a></li><li> �!�!a href="dmd_common_outbuffer.html"�4itle="dmd.common.outbuffer"><span class="d_inlinecode donthyphenate notranslate">outbuffer</span><tæ><vîi><li> <a href="dmd_common_smallbuffer.html" title="dmd.common.smallbuffer"><span class="d_inlinecode donthyphenate notranslate">smallbuffer<ztpan></a> �!�!vîi></ul><vîi><li> <a href="dmd_compiler.html" title="dmd.compiler"><span class="d_inlinecode donthyphenate notranslate">compiler</span><tæ><vîi><li> <a href="dmd_cond.html" title="dmd.cond"><span class="d_inlinecode donthyphenate notranslate">cond</span><tæ><vîi><li> <a href="dmd_console.html"�4itle="dmd.console"><span class="d_inlinecode donthyphenate notranslate">console<ztpan></a></li><li> �!�!a href="dmd_constfold.html" title="dmd.constfold"><span class="d_inlinecode donthyphenate notranslate">constfold</span><tæ><vîi><li> <a href="dmd_cparse.html" title="dmd.cparse"><span class="d_inlinecode donthyphenate notranslate">cparse</span><tæ><vîi><li> <a href="dmd_cpreprocess.html"�4itle="dmd.cpreprocess"><span class="d_inlinecode donthyphenate notranslate">cpreprocess<ztpan></a></li><li> �!�!a href="dmd_ctfeexpr.html"�4itle="dmd.ctfeexpr"><span class="d_inlinecode donthyphenate notranslate">ctfeexpr<ztpan></a></li><li> �!�!a href="dmd_ctorflow.html"�4itle="dmd.ctorflow"><span class="d_inlinecode donthyphenate notranslate">ctorflow<ztpan></a></li><li> �!�!a href="dmd_cxxfrontend.html" title="dmd.cxxfrontend"><span class="d_inlinecode donthyphenate notranslate">cxxfrontend</span><tæ><vîi><li> <a href="dmd_dcast.html"�4itle="dmd.dcast"><span class="d_inlinecode donthyphenate notranslate">dcast<ztpan></a></li><li> �!�!a href="dmd_dclass.html"�4itle="dmd.dclass"><span class="d_inlinecode donthyphenate notranslate">dclass<ztpan></a></li><li> �!�!a href="dmd_declaration.html" title="dmd.declaration"><span class="d_inlinecode donthyphenate notranslate">declaration</span><tæ><vîi><li> <a href="dmd_delegatize.html" title="dmd.delegatize"><span class="d_inlinecode donthyphenate notranslate">delegatize</span><tæ><vîi><li> <a href="dmd_denum.html"�4itle="dmd.denum"><span class="d_inlinecode donthyphenate notranslate">denum<ztpan></a></li><li> �!�!a href="dmd_deps.html"�4itle="dmd.deps"><span class="d_inlinecode donthyphenate notranslate">deps<ztpan></a></li><li> �!�!a href="dmd_dimport.html" title="dmd.dimport"><span class="d_inlinecode donthyphenate notranslate">dimport</span><tæ><vîi><li> <a href="dmd_dinifile.html" title="dmd.dinifile"><span class="d_inlinecode donthyphenate notranslate">dinifile</span><tæ><vîi><li> <a href="dmd_dinterpret.html" title="dmd.dinterpret"><span class="d_inlinecode donthyphenate notranslate">dinterpret</span><tæ><vîi><li> <a href="dmd_dmacro.html" title="dmd.dmacro"><span class="d_inlinecode donthyphenate notranslate">dmacro</span><tæ><vîi><li> <a href="dmd_dmdparams.html"�4itle="dmd.dmdparams"><span class="d_inlinecode donthyphenate notranslate">dmdparams<ztpan></a></li><li> �!�!a href="dmd_dmodule.html" title="dmd.dmodule"><span class="d_inlinecode donthyphenate notranslate">dmodule</span><tæ><vîi><li> <a href="dmd_dmsc.html" title="dmd.dmsc"><span class="d_inlinecode donthyphenate notranslate">dmsc</span><tæ><vîi><li> <a href="dmd_doc.html"�4itle="dmd.doc"><span class="d_inlinecode donthyphenate notranslate">doc<ztpan></a></li><li> �!�!a href="dmd_dscope.html"�4itle="dmd.dscope"><span class="d_inlinecode donthyphenate notranslate">dscope<ztpan></a></li><li> �!�!a href="dmd_dstruct.html" title="dmd.dstruct"><span class="d_inlinecode donthyphenate notranslate">dstruct</span><tæ><vîi><li> <a href="dmd_dsymbol.html"�4itle="dmd.dsymbol"><span class="d_inlinecode donthyphenate notranslate">dsymbol<ztpan></a></li><li> �!�!a href="dmd_dsymbolsem.html"�4itle="dmd.dsymbolsem"><span class="d_inlinecode donthyphenate notranslate">dsymbolsem<ztpan></a></li><li> �!�!a href="dmd_dtemplate.html" title="dmd.dtemplate"><span class="d_inlinecode donthyphenate notranslate">dtemplate</span><tæ><vîi><li> <a href="dmd_dtoh.html" title="dmd.dtoh"><span class="d_inlinecode donthyphenate notranslate">dtoh</span><tæ><vîi><li> <a href="dmd_dversion.html" title="dmd.dversion"><span class="d_inlinecode donthyphenate notranslate">dversion</span><tæ><vîi><li> <a href="dmd_er.html" title="dmd.er"><span class="d_inlinecode donthyphenate notranslate">e2ir</span><tæ><vîi><li> <a href="dmd_entity.html" title="dmd.entity"><span class="d_inlinecode donthyphenate notranslate">entity</span><tæ><vîi><li> <a href="dmd_enumsem.html"�4itle="dmd.enumsem"><span class="d_inlinecode donthyphenate notranslate">enumsem<ztpan></a></li><li> �!�!a href="dmd_errors.html"�4itle="dmd.errors"><span class="d_inlinecode donthyphenate notranslate">errors<ztpan></a></li><li> �!�!a href="dmd_errorsink.html" title="dmd.errorsink"><span class="d_inlinecode donthyphenate notranslate">errorsink</span><tæ><vîi><li> <a href="dmd_escape.html" title="dmd.escape"><span class="d_inlinecode donthyphenate notranslate">escape</span><tæ><vîi><li> <a href="dmd_expression.html" title="dmd.expression"><span class="d_inlinecode donthyphenate notranslate">expression</span><tæ><vîi><li> <a href="dmd_expressionsem.html"�4itle="dmd.expressionsem"><span class="d_inlinecode donthyphenate notranslate">expressionsem<ztpan></a></li><li> �!�!a href="dmd_file_manager.html"�4itle="dmd.file_manager"><span class="d_inlinecode donthyphenate notranslate">file_manager<ztpan></a></li><li> �!�!a href="dmd_frontend.html"�4itle="dmd.frontend"><span class="d_inlinecode donthyphenate notranslate">frontend<ztpan></a></li><li> �!�!a href="dmd_func.html"�4itle="dmd.func"><span class="d_inlinecode donthyphenate notranslate">func<ztpan></a></li><li> �!�!a href="dmd_funcsem.html" title="dmd.funcsem"><span class="d_inlinecode donthyphenate notranslate">funcsem</span><tæ><vîi><li> <a href="dmd_globals.html"�4itle="dmd.globals"><span class="d_inlinecode donthyphenate notranslate">globals<ztpan></a></li><li> �!�!a href="dmd_glue.html"�4itle="dmd.glue"><span class="d_inlinecode donthyphenate notranslate">glue<ztpan></a></li><li> �!�!a href="dmd_gluelayer.html" title="dmd.gluelayer"><span class="d_inlinecode donthyphenate notranslate">gluelayer</span><tæ><vîi><li> <a href="dmd_hdrgen.html" title="dmd.hdrgen"><span class="d_inlinecode donthyphenate notranslate">hdrgen</span><tæ><vîi><li> <a href="dmd_iasm.html" title="dmd.iasm"><span class="d_inlinecode donthyphenate notranslate">iasm</span><tæ><vîi><li> <a href="dmd_iasmdmd.html"�4itle="dmd.iasmdmd"><span class="d_inlinecode donthyphenate notranslate">iasmdmd<ztpan></a></li><li> �!�!a href="dmd_iasmgcc.html" title="dmd.iasmgcc"><span class="d_inlinecode donthyphenate notranslate">iasmgcc</span><tæ><vîi><li> <a href="dmd_id.html" title="dmd.id"><span class="d_inlinecode donthyphenate notranslate">id</span><tæ><vîi><li> <a href="dmd_identifier.html" title="dmd.identifier"><span class="d_inlinecode donthyphenate notranslate">identifier</span><tæ><vîi><li> <a href="dmd_impcnvtab.html"�4itle="dmd.impcnvtab"><span class="d_inlinecode donthyphenate notranslate">impcnvtab<ztpan></a></li><li> �!�!a href="dmd_imphint.html" title="dmd.imphint"><span class="d_inlinecode donthyphenate notranslate">imphint</span><tæ><vîi><li> <a href="dmd_importc.html"�4itle="dmd.importc"><span class="d_inlinecode donthyphenate notranslate">importc<ztpan></a></li><li> �!�!a href="dmd_init.html"�4itle="dmd.init"><span class="d_inlinecode donthyphenate notranslate">init<ztpan></a></li><li> �!�!a href="dmd_initsem.html" title="dmd.initsem"><span class="d_inlinecode donthyphenate notranslate">initsem</span><tæ><vîi><li> <a href="dmd_inline.html" title="dmd.inline"><span class="d_inlinecode donthyphenate notranslate">inline</span><tæ><vîi><li> <a href="dmd_inlinecost.html" title="dmd.inlinecost"><span class="d_inlinecode donthyphenate notranslate">inlinecost</span><tæ><vîi><li> <a href="dmd_intrange.html" title="dmd.intrange"><span class="d_inlinecode donthyphenate notranslate">intrange</span><tæ><vîi><li> <a href="dmd_json.html" title="dmd.json"><span class="d_inlinecode donthyphenate notranslate">json</span><tæ><vîi><li> <a href="dmd_lambdacomp.html" title="dmd.lambdacomp"><span class="d_inlinecode donthyphenate notranslate">lambdacomp</span><tæ><vîi><li> <a href="dmd_lexer.html"�4itle="dmd.lexer"><span class="d_inlinecode donthyphenate notranslate">lexer<ztpan></a></li><li> �!�!a href="dmd_lib.html" title="dmd.lib"><span class="d_inlinecode donthyphenate notranslate">lib</span><tæ><ul><li> �!�!a href="dmd_lib_elf.html" title="dmd.lib.elf"><span class="d_inlinecode donthyphenate notranslate">elf</span><tæ><vîi><li> <a href="dmd_lib_mach.html" title="dmd.lib.mach"><span class="d_inlinecode donthyphenate notranslate">mach</span><tæ><vîi><li> <a href="dmd_lib_mscoff.html" title="dmd.lib.mscoff"><span class="d_inlinecode donthyphenate notranslate">mscoff</span><tæ><vîi><li> <a href="dmd_lib_scanelf.html"�4itle="dmd.lib.scanelf"><span class="d_inlinecode donthyphenate notranslate">scanelf<ztpan></a></li><li> �!�!a href="dmd_lib_scanmach.html"�4itle="dmd.lib.scanmach"><span class="d_inlinecode donthyphenate notranslate">scanmach<ztpan></a></li><li> �!�!a href="dmd_lib_scanmscoff.html"�4itle="dmd.lib.scanmscoff"><span class="d_inlinecode donthyphenate notranslate">scanmscoff<ztpan></a> �!�!vîi></ul><vîi><li> <a href="dmd_link.html" title="dmd.link"><span class="d_inlinecode donthyphenate notranslate">link</span><tæ><vîi><li> <a href="dmd_location.html" title="dmd.location"><span class="d_inlinecode donthyphenate notranslate">location</span><tæ><vîi><li> <a href="dmd_main.html" title="dmd.main"><span class="d_inlinecode donthyphenate notranslate">main</span><tæ><vîi><li> <a href="dmd_mangle.html" title="dmd.mangle"><span class="d_inlinecode donthyphenate notranslate">mangle</span><tæ><ul><li> �!�!a href="dmd_mangle_basic.html"�4itle="dmd.mangle.basic"><span class="d_inlinecode donthyphenate notranslate">basic</span><tæ><vîi><li> <a href="dmd_mangle_cpp.html" title="dmd.mangle.cpp"><span class="d_inlinecode donthyphenate notranslate">cpp<ztpan></a></li><li> �!�!a href="dmd_mangle_cppwin.html" title="dmd.mangle.cppwin"><span class="d_inlinecode donthyphenate notranslate">cppwin<ztpan></a> �!�!vîi></ul><vîi><li> <a href="dmd_mars.html" title="dmd.mars"><span class="d_inlinecode donthyphenate notranslate">mars</span><tæ><vîi><li> <a href="dmd_mtype.html"�4itle="dmd.mtype"><span class="d_inlinecode donthyphenate notranslate">mtype<ztpan></a></li><li> �!�!a href="dmd_mustuse.html" title="dmd.mustuse"><span class="d_inlinecode donthyphenate notranslate">mustuse</span><tæ><vîi><li> <a href="dmd_nogc.html" title="dmd.nogc"><span class="d_inlinecode donthyphenate notranslate">nogc</span><tæ><vîi><li> <a href="dmd_nspace.html" title="dmd.nspace"><span class="d_inlinecode donthyphenate notranslate">nspace</span><tæ><vîi><li> <a href="dmd_ob.html" title="dmd.ob"><span class="d_inlinecode donthyphenate notranslate">ob</span><tæ><vîi><li> <a href="dmd_objc.html" title="dmd.objc"><span class="d_inlinecode donthyphenate notranslate">objc</span><tæ><vîi><li> <a href="dmd_objc_glue.html"�4itle="dmd.objc_glue"><span class="d_inlinecode donthyphenate notranslate">objc_glue<ztpan></a></li><li> �!�!a href="dmd_opover.html"�4itle="dmd.opover"><span class="d_inlinecode donthyphenate notranslate">opover<ztpan></a></li><li> �!�!a href="dmd_optimize.html"�4itle="dmd.optimize"><span class="d_inlinecode donthyphenate notranslate">optimize<ztpan></a></li><li> �!�!a href="dmd_parse.html" title="dmd.parse"><span class="d_inlinecode donthyphenate notranslate">parse</span><tæ><vîi><li> <a href="dmd_pragmasem.html"�4itle="dmd.pragmasem"><span class="d_inlinecode donthyphenate notranslate">pragmasem<ztpan></a></li><li> �!�!a href="dmd_printast.html"�4itle="dmd.printast"><span class="d_inlinecode donthyphenate notranslate">printast<ztpan></a></li><li> �!�!h7><span class="d_inlinecode donthyphenate notranslate">root</span><vv7><ul><li> <a href="dmd_root_aav.html" title="dmd.root.aav"><span class="d_inlinecode donthyphenate notranslate">aav<ztpan></a></li><li> �!�!a href="dmd_root_array.html"�4itle="dmd.root.array"><span class="d_inlinecode donthyphenate notranslate">array</span><tæ><vîi><li> <a href="dmd_root_bitarray.html"�4itle="dmd.root.bitarray"><span class="d_inlinecode donthyphenate notranslate">bitarray</span><tæ><vîi><li> <a href="dmd_root_complex.html" title="dmd.root.complex"><span class="d_inlinecode donthyphenate notranslate">complex<ztpan></a></li><li> �!�!a href="dmd_root_ctfloat.html"�4itle="dmd.root.ctfloat"><span class="d_inlinecode donthyphenate notranslate">ctfloat</span><tæ><vîi><li> <a href="dmd_root_env.html" title="dmd.root.env"><span class="d_inlinecode donthyphenate notranslate">env<ztpan></a></li><li> �!�!a href="dmd_root_file.html" title="dmd.root.file"><span class="d_inlinecode donthyphenate notranslate">file<ztpan></a></li><li> �!�!a href="dmd_root_filename.html" title="dmd.root.filename"><span class="d_inlinecode donthyphenate notranslate">filename<ztpan></a></li><li> �!�!a href="dmd_root_hash.html" title="dmd.root.hash"><span class="d_inlinecode donthyphenate notranslate">hash<ztpan></a></li><li> �!�!a href="dmd_root_longdouble.html" title="dmd.root.longdouble"><span class="d_inlinecode donthyphenate notranslate">longdouble<ztpan></a></li><li> �!�!a href="dmd_root_man.html"�4itle="dmd.root.man"><span class="d_inlinecode donthyphenate notranslate">man</span><tæ><vîi><li> <a href="dmd_root_optional.html"�4itle="dmd.root.optional"><span class="d_inlinecode donthyphenate notranslate">optional</span><tæ><vîi><li> <a href="dmd_root_port.html"�4itle="dmd.root.port"><span class="d_inlinecode donthyphenate notranslate">port</span><tæ><vîi><li> <a href="dmd_root_region.html"�4itle="dmd.root.region"><span class="d_inlinecode donthyphenate notranslate">region</span><tæ><vîi><li> <a href="dmd_root_response.html"�4itle="dmd.root.response"><span class="d_inlinecode donthyphenate notranslate">response</span><tæ><vîi><li> <a href="dmd_root_rmem.html"�4itle="dmd.root.rmem"><span class="d_inlinecode donthyphenate notranslate">rmem</span><tæ><vîi><li> <a href="dmd_root_speller.html" title="dmd.root.speller"><span class="d_inlinecode donthyphenate notranslate">speller<ztpan></a></li><li> �!�!a href="dmd_root_string.html" title="dmd.root.string"><span class="d_inlinecode donthyphenate notranslate">string<ztpan></a></li><li> �!�!a href="dmd_root_stringtable.html"�4itle="dmd.root.stringtable"><span class="d_inlinecode donthyphenate notranslate">stringtable</span><tæ><vîi><li> <a href="dmd_root_strtold.html" title="dmd.root.strtold"><span class="d_inlinecode donthyphenate notranslate">strtold<ztpan></a></li><li> �!�!a href="dmd_root_utf.html"�4itle="dmd.root.utf"><span class="d_inlinecode donthyphenate notranslate">utf</span><tæ> </li><zùl></li><li> �!�!a href="dmd_rootobject.html"�4itle="dmd.rootobject"><span class="d_inlinecode donthyphenate notranslate">rootobject<ztpan></a></li><li> �!�!a href="dmd_s2ir.html"�4itle="dmd.s2ir"><span class="d_inlinecode donthyphenate notranslate">sr<ztpan></a></li><li> �!�!a href="dmd_safe.html"�4itle="dmd.safe"><span class="d_inlinecode donthyphenate notranslate">safe<ztpan></a></li><li> �!�!a href="dmd_sarif.html" title="dmd.sarif"><span class="d_inlinecode donthyphenate notranslate">sarif</span><tæ><vîi><li> <a href="dmd_semantic2.html"�4itle="dmd.semantic�(N �)><span class="d_inlinecode donthyphenate notranslate">semantic�(vã�)ztpan></a></li><li> �!�!a href="dmd_semantic0Ô0¢0¹0È0ëhtml" title="dmd.semantic3"><span class="d_inlinecode donthyphenate notranslate">semantic3</span><tæ><vîi><li> <a href="dmd_sideeffect.html" title="dmd.sideeffect"><span class="d_inlinecode donthyphenate notranslate">sideeffect</span><tæ><vîi><li> <a href="dmd_statement.html"�4itle="dmd.statement"><span class="d_inlinecode donthyphenate notranslate">statement<ztpan></a></li><li> �!�!a href="dmd_statementsem.html"�4itle="dmd.statementsem"><span class="d_inlinecode donthyphenate notranslate">statementsem<ztpan></a></li><li> �!�!a href="dmd_staticassert.html"�4itle="dmd.staticassert"><span class="d_inlinecode donthyphenate notranslate">staticassert<ztpan></a></li><li> �!�!a href="dmd_staticcond.html"�4itle="dmd.staticcond"><span class="d_inlinecode donthyphenate notranslate">staticcond<ztpan></a></li><li> �!�!a href="dmd_stmtstate.html" title="dmd.stmtstate"><span class="d_inlinecode donthyphenate notranslate">stmtstate</span><tæ><vîi><li> <a href="dmd_target.html" title="dmd.target"><span class="d_inlinecode donthyphenate notranslate">target</span><tæ><vîi><li> <a href="dmd_templateparamsem.html" title="dmd.templateparamsem"><span class="d_inlinecode donthyphenate notranslate">templateparamsem</span><tæ><vîi><li> <a href="dmd_templatesem.html"�4itle="dmd.templatesem"><span class="d_inlinecode donthyphenate notranslate">templatesem<ztpan></a></li><li> �!�!a href="dmd_timetrace.html" title="dmd.timetrace"><span class="d_inlinecode donthyphenate notranslate">timetrace</span><tæ><vîi><li> <a href="dmd_tocsym.html" title="dmd.tocsym"><span class="d_inlinecode donthyphenate notranslate">tocsym</span><tæ><vîi><li> <a href="dmd_toctype.html"�4itle="dmd.toctype"><span class="d_inlinecode donthyphenate notranslate">toctype<ztpan></a></li><li> �!�!a href="dmd_tocvdebug.html" title="dmd.tocvdebug"><span class="d_inlinecode donthyphenate notranslate">tocvdebug</span><tæ><vîi><li> <a href="dmd_todt.html" title="dmd.todt"><span class="d_inlinecode donthyphenate notranslate">todt</span><tæ><vîi><li> <a href="dmd_toir.html" title="dmd.toir"><span class="d_inlinecode donthyphenate notranslate">toir</span><tæ><vîi><li> <a href="dmd_tokens.html" title="dmd.tokens"><span class="d_inlinecode donthyphenate notranslate">tokens</span><tæ><vîi><li> <a href="dmd_toobj.html"�4itle="dmd.toobj"><span class="d_inlinecode donthyphenate notranslate">toobj<ztpan></a></li><li> �!�!a href="dmd_traits.html"�4itle="dmd.traits"><span class="d_inlinecode donthyphenate notranslate">traits<ztpan></a></li><li> �!�!a href="dmd_typesem.html" title="dmd.typesem"><span class="d_inlinecode donthyphenate notranslate">typesem</span><tæ><vîi><li> <a href="dmd_typinf.html" title="dmd.typinf"><span class="d_inlinecode donthyphenate notranslate">typinf</span><tæ><vîi><li> <a href="dmd_utils.html"�4itle="dmd.utils"><span class="d_inlinecode donthyphenate notranslate">utils<ztpan></a></li><li> �!�!a href="dmd_visitor.html" title="dmd.visitor"><span class="d_inlinecode donthyphenate notranslate">visitor</span><tæ><ul><li> �!�!a href="dmd_visitor_foreachvar.html"�4itle="dmd.visitor.foreachvar"><span class="d_inlinecode donthyphenate notranslate">foreachvar<ztpan></a></li><li> �!�!a href="dmd_visitor_parsetime.html" title="dmd.visitor.parsetime"><span class="d_inlinecode donthyphenate notranslate">parsetime</span><tæ><vîi><li> <a href="dmd_visitor_permissive.html" title="dmd.visitor.permissive"><span class="d_inlinecode donthyphenate notranslate">permissive</span><tæ><vîi><li> <a href="dmd_visitor_postorder.html"�4itle="dmd.visitor.postorder"><span class="d_inlinecode donthyphenate notranslate">postorder<ztpan></a></li><li> �!�!a href="dmd_visitor_statement_rewrite_walker.html"�4itle="dmd.visitor.statement_rewrite_walker"><span class="d_inlinecode donthyphenate notranslate">statement_rewrite_walker<ztpan></a></li><li> �!�!a href="dmd_visitor_strict.html"�4itle="dmd.visitor.strict"><span class="d_inlinecode donthyphenate notranslate">strict<ztpan></a></li><li> �!�!a href="dmd_visitor_transitive.html"�4itle="dmd.visitor.transitive"><span class="d_inlinecode donthyphenate notranslate">transitive<ztpan></a> �!�!vîi></ul><vîi><li> <a href="dmd_vsoptions.html"�4itle="dmd.vsoptions"><span class="d_inlinecode donthyphenate notranslate">vsoptions<ztpan></a> <vîi></ul> </li> <li class='expand-container modlist-submenu-rt'><a class='expand-toggle' href='#'><span><em class="tt">rt</em><ztpan></a> <ul><li> �!�!a href="rt_aApply.html" title="rt.aApply"><span class="d_inlinecode donthyphenate notranslate">aApply<ztpan></a></li><li> �!�!a href="rt_aApplyR.html"�4itle="rt.aApplyR"><span class="d_inlinecode donthyphenate notranslate">aApplyR</span><tæ><vîi><li> <a href="rt_aaA.html" title="rt.aaA"><span class="d_inlinecode donthyphenate notranslate">aaA<ztpan></a></li><li> �!�!a href="rt_adi.html"�4itle="rt.adi"><span class="d_inlinecode donthyphenate notranslate">adi</span><tæ><vîi><li> <a href="rt_alloca.html"�4itle="rt.alloca"><span class="d_inlinecode donthyphenate notranslate">alloca</span><tæ><vîi><li> <a href="rt_arraycat.html"�4itle="rt.arraycat"><span class="d_inlinecode donthyphenate notranslate">arraycat</span><tæ><vîi><li> <a href="rt_cast_.html" title="rt.cast_"><span class="d_inlinecode donthyphenate notranslate">cast_<ztpan></a></li><li> �!�!a href="rt_cmath�(‘Ñ�)html" title="rt.cmath2"><span class="d_inlinecode donthyphenate notranslate">cmath�(vã�)ztpan></a></li><li> �!�!a href="rt_config.html" title="rt.config"><span class="d_inlinecode donthyphenate notranslate">config<ztpan></a></li><li> �!�!a href="rt_cover.html"�4itle="rt.cover"><span class="d_inlinecode donthyphenate notranslate">cover</span><tæ><vîi><li> <a href="rt_critical_.html" title="rt.critical_"><span class="d_inlinecode donthyphenate notranslate">critical_<ztpan></a></li><li> �!�!a href="rt_deh.html"�4itle="rt.deh"><span class="d_inlinecode donthyphenate notranslate">deh</span><tæ><vîi><li> <a href="rt_deh_win3�(‘Ñ�)html" title="rt.deh_win3�(N �)><span class="d_inlinecode donthyphenate notranslate">deh_win3�(vã�)ztpan></a></li><li> �!�!a href="rt_deh_win64_posix.html"�4itle="rt.deh_win64_posix"><span class="d_inlinecode donthyphenate notranslate">deh_win64_posix</span><tæ><vîi><li> <a href="rt_dmain2.html"�4itle="rt.dmain�(N �)><span class="d_inlinecode donthyphenate notranslate">dmain2</span><tæ><vîi><li> <a href="rt_dwarfeh.html" title="rt.dwarfeh"><span class="d_inlinecode donthyphenate notranslate">dwarfeh<ztpan></a></li><li> �!�!a href="rt_ehalloc.html"�4itle="rt.ehalloc"><span class="d_inlinecode donthyphenate notranslate">ehalloc</span><tæ><vîi><li> <a href="rt_invariant_.html"�4itle="rt.invariant_"><span class="d_inlinecode donthyphenate notranslate">invariant_</span><tæ><vîi><li> <a href="rt_lifetime.html"�4itle="rt.lifetime"><span class="d_inlinecode donthyphenate notranslate">lifetime</span><tæ><vîi><li> <a href="rt_llmath.html"�4itle="rt.llmath"><span class="d_inlinecode donthyphenate notranslate">llmath</span><tæ><vîi><li> <a href="rt_memory.html"�4itle="rt.memory"><span class="d_inlinecode donthyphenate notranslate">memory</span><tæ><vîi><li> <a href="rt_memset.html"�4itle="rt.memset"><span class="d_inlinecode donthyphenate notranslate">memset</span><tæ><vîi><li> <a href="rt_minfo.html" title="rt.minfo"><span class="d_inlinecode donthyphenate notranslate">minfo<ztpan></a></li><li> �!�!a href="rt_monitor_.html" title="rt.monitor_"><span class="d_inlinecode donthyphenate notranslate">monitor_<ztpan></a></li><li> �!�!a href="rt_msvc.html" title="rt.msvc"><span class="d_inlinecode donthyphenate notranslate">msvc<ztpan></a></li><li> �!�!a href="rt_msvc_math.html"�4itle="rt.msvc_math"><span class="d_inlinecode donthyphenate notranslate">msvc_math</span><tæ><vîi><li> <a href="rt_profilegc.html" title="rt.profilegc"><span class="d_inlinecode donthyphenate notranslate">profilegc<ztpan></a></li><li> �!�!a href="rt_sections.html" title="rt.sections"><span class="d_inlinecode donthyphenate notranslate">sections<ztpan></a></li><li> �!�!a href="rt_sections_darwin_64.html" title="rt.sections_darwin_64"><span class="d_inlinecode donthyphenate notranslate">sections_darwin_64<ztpan></a></li><li> �!�!a href="rt_sections_elf_shared.html"�4itle="rt.sections_elf_shared"><span class="d_inlinecode donthyphenate notranslate">sections_elf_shared</span><tæ><vîi><li> <a href="rt_sections_osx_x86.html"�4itle="rt.sections_osx_x86"><span class="d_inlinecode donthyphenate notranslate">sections_osx_x86</span><tæ><vîi><li> <a href="rt_sections_osx_x86_64.html" title="rt.sections_osx_x86_64"><span class="d_inlinecode donthyphenate notranslate">sections_osx_x86_64<ztpan></a></li><li> �!�!a href="rt_sections_solaris.html" title="rt.sections_solaris"><span class="d_inlinecode donthyphenate notranslate">sections_solaris<ztpan></a></li><li> �!�!a href="rt_sections_win64.html" title="rt.sections_win64"><span class="d_inlinecode donthyphenate notranslate">sections_win64<ztpan></a></li><li> �!�!a href="rt_tlsgc.html"�4itle="rt.tlsgc"><span class="d_inlinecode donthyphenate notranslate">tlsgc</span><tæ><vîi><li> <a href="rt_trace.html" title="rt.trace"><span class="d_inlinecode donthyphenate notranslate">trace<ztpan></a></li><li> �!�!a href="rt_tracegc.html"�4itle="rt.tracegc"><span class="d_inlinecode donthyphenate notranslate">tracegc</span><tæ><vîi><li> <h7><span class="d_inlinecode donthyphenate notranslate">util<ztpan></h7><ul><li> �!�!a href="rt_util_typeinfo.html"�4itle="rt.util.typeinfo"><span class="d_inlinecode donthyphenate notranslate">typeinfo<ztpan></a></li><li> �!�!a href="rt_util_utility.html" title="rt.util.utility"><span class="d_inlinecode donthyphenate notranslate">utility</span><tæ> </li><zùl> <vîi></ul> </li><zùl> <u(iv> <div class="hyphenate" id="content"> <div id="tools"><div > <div class="tip smallprint"> <a href="https:/u’ithub.com/dlang/phobosv}ssues/new?title=%5Bstd.range%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/phobosu0dit/masterzttdy¾angey:ackage.d">Improve this�0age<tæ> <div�  Quickly fork, edit online, and submit a�0ull request for this�0age. Requires a signed-in�?�?itHub account. This works well for small changes. If you'd like�4o make larger changes you may want�4o consider�5sing a local clone. <u(iv> <u(iv> </div></div> �!�!h1><span class="d_title">std.range</span><vv´ �!�!div class="quickindex" id="quickindex"><u(iv> <div class="summary">This module defines�4he notion of a range. Ranges generalize the concept of arrays, lists, or anything that involves sequential access. This abstraction enables the same set of algorithms (see <a href="std_algorithm.html"><span class="d_inlinecode donthyphenate notranslate">std.algorithm<ztpan></a>) to be used with a vast�6ariety of different concrete�4ypes. For example, a linear search algorithm such as�!�!a href="std_algorithm_searching.html#.find"><span class="d_inlinecode donthyphenate notranslate">std.algorithm.searching.find<ztpan></a> works not just for arrays, but for linked-lists, input files, incoming network data, etc. <u(iv><div class="val"><p class="keyval Section"><span class="key keySection">Guides<ztpan> There are many articles available�4hat can bolster understanding ranges: <div class="blankline"><u(iv> <ul> �!�!li>Ali Çehreli's <a href="http:]åddili.org/dersu(.en/ranges.html">tutorial on ranges<tæ> for the basics of working with and creating range-based code.<vîi> �!�!li>Jonathan M. Davis�!�!a href="http:/u(conf.org^r015/talks/davis.html"><i>Introduction to Ranges<v}><tæ> talk at DConf �(eå�)¬ a�6ivid introduction from its core constructs�4o practical advice.<vîi> �!�!li>The DLang Tour's <a href="http:]åtour.dlang.orgzËour/enuasics/ranges">chapter on ranges<tæ> for an interactive introduction.</li> <li>H. S. Teoh's�!�!a href="http:/|øiki.dlang.org/Component_programming_with_ranges">tutorial on component�0rogramming�7ith ranges</a> for a real-world showcase of the influence of range-based�0rogramming on complex algorithms.<vîi> �!�!li>Andrei Alexandrescu's article �!�!a href="http:/|øww.informit.com/articlesy:rinterfriendly.aspx?p=070Õ0é0ó7&rll=1"> �!�!i>On�!�?teration</i></a> for conceptual aspect of ranges and�4he motivation </li> </ul> <y:><u(iv> <div class="val"><p class="keyval Section"><span class="key keySection">Submodules</span> This module has two submodules: <div class="blankline"><u(iv> The�!�!a href="std_range_primitives.html"><span class="d_inlinecode donthyphenate notranslate">std.range.primitives</span><tæ> submodule provides basic range functionality. It defines several�4emplates for�4esting whether a given object is a range, what kind of range it is, and provides some common range operations. <div class="blankline"></div> The <a href="std_range_interfaces.html"><span class="d_inlinecode donthyphenate notranslate">std.range.interfaces<ztpan></a> submodule provides object-based interfaces for working with ranges via runtime polymorphism. <div class="blankline"><u(iv> The remainder of this module provides a rich set of range creation and composition templates that let�9ou construct new ranges out of existing ranges: <div class="blankline"><u(iv> <div class="blankline"></div> <script type="textv®avascript">inhibitQuickIndex = 1;<ztcript> <div class="quickindex"><table class="book"><caption></caption> <tr><td><a href="#chain"><span class="d_inlinecode donthyphenate notranslate">chain<ztpan></a></td> <td>Concatenates several ranges into a single range. �!�!zËd></tr> <tr><td><a href="#choose"><span class="d_inlinecode donthyphenate notranslate">choose<ztpan></a></td> <td>Chooses one of�4wo ranges at runtime based on a boolean condition. �!�!zËd></tr> <tr><td><a href="#chooseAmong"><span class="d_inlinecode donthyphenate notranslate">chooseAmong<ztpan></a></td> <td>Chooses one of several ranges at runtime based on an index. </td><zËr> �!�!tr><td><a href="#chunks"><span class="d_inlinecode donthyphenate notranslate">chunks</span><tæ><zËd> �!�!td>Creates a range�4hat returns fixed-size chunks of�4he original range. �!�!zËd></tr> <tr><td><a href="#cycle"><span class="d_inlinecode donthyphenate notranslate">cycle<ztpan></a></td> <td>Creates an infinite range that repeats�4he given forward range indefinitely.�?�?ood for implementing circular buffers. �!�!zËd></tr> <tr><td><a href="#drop"><span class="d_inlinecode donthyphenate notranslate">drop<ztpan></a></td> <td>Creates the range that results from discarding�4he first�!�!i>n<v}> elements from the given range. �!�!zËd></tr> <tr><td><a href="#dropBack"><span class="d_inlinecode donthyphenate notranslate">dropBack<ztpan></a></td> <td>Creates the range that results from discarding�4he last <i>n</i> elements from�4he given range. </td><zËr> �!�!tr><td><a href="#dropExactly"><span class="d_inlinecode donthyphenate notranslate">dropExactly</span><tæ><zËd> �!�!td>Creates�4he range�4hat results from discarding exactly <i>n</i> of the first elements from the given range. �!�!zËd></tr> <tr><td><a href="#dropBackExactly"><span class="d_inlinecode donthyphenate notranslate">dropBackExactly<ztpan></a></td> <td>Creates the range that results from discarding exactly�!�!i>n<v}> of�4he last elements from the given range. �!�!zËd></tr> <tr><td><a href="#dropOne"><span class="d_inlinecode donthyphenate notranslate">dropOne<ztpan></a></td> <td>Creates the range that results from discarding �4he first element from the given range. �!�!zËd></tr> <tr><td><span class="d_inlinecode donthyphenate notranslate"><a href="#dropBackOne"><span class="d_inlinecode donthyphenate notranslate">dropBackOne</span><tæ><ztpan></td> <td>Creates the range that results from discarding �4he last element from�4he given range. </td><zËr> �!�!tr><td><a href="#enumerate"><span class="d_inlinecode donthyphenate notranslate">enumerate</span><tæ><zËd> �!�!td>Iterates a range with an attached index�6ariable. �!�!zËd></tr> <tr><td><a href="#evenChunks"><span class="d_inlinecode donthyphenate notranslate">evenChunks<ztpan></a></td> <td>Creates a range that returns a number of chunks of approximately equal length from�4he original range. �!�!zËd></tr> <tr><td><a href="#frontTransversal"><span class="d_inlinecode donthyphenate notranslate">frontTransversal<ztpan></a></td> <td>Creates a range that iterates over�4he first elements of�4he given ranges. �!�!zËd></tr> <tr><td><a href="#generate"><span class="d_inlinecode donthyphenate notranslate">generate<ztpan></a></td> <td>Creates a range by successive calls to a given function. This allows�4o create ranges as a single delegate. </td><zËr> �!�!tr><td><a href="#indexed"><span class="d_inlinecode donthyphenate notranslate">indexed</span><tæ><zËd> �!�!td>Creates a range�4hat offers a�6iew of a given range as though its elements were reordered according�4o a given range of indices. </td><zËr> �!�!tr><td><a href="#iota"><span class="d_inlinecode donthyphenate notranslate">iota</span><tæ><zËd> �!�!td>Creates a range consisting of numbers between a starting point and ending�0oint, spaced apart by a given interval. </td><zËr> �!�!tr><td><a href="#lockstep"><span class="d_inlinecode donthyphenate notranslate">lockstep</span><tæ><zËd> �!�!td>Iterates <i>n</i> ranges in lockstep, for�5se in a <span class="d_inlinecode donthyphenate notranslate">foreach</span> loop. Similar to�!�!span class="d_inlinecode donthyphenate notranslate">zip<ztpan>, except�4hat <span class="d_inlinecode donthyphenate notranslate">lockstep<ztpan> is designed especially for <span class="d_inlinecode donthyphenate notranslate">foreach</span> loops. �!�!zËd></tr> <tr><td><a href="#nullSink"><span class="d_inlinecode donthyphenate notranslate">nullSink<ztpan></a></td> <td>An output range that discards the data it receives. </td><zËr> �!�!tr><td><a href="#only"><span class="d_inlinecode donthyphenate notranslate">only</span><tæ><zËd> �!�!td>Creates a range�4hat iterates over the given arguments. �!�!zËd></tr> <tr><td><a href="#padLeft"><span class="d_inlinecode donthyphenate notranslate">padLeft<ztpan></a></td> <td>Pads a range�4o a specified length by adding a given element�4o the front of�4he range. Is lazy if�4he range has a known length. �!�!zËd></tr> <tr><td><a href="#padRight"><span class="d_inlinecode donthyphenate notranslate">padRight<ztpan></a></td> <td>Lazily�0ads a range to a specified length by adding a given element to �4he back of�4he range. </td><zËr> �!�!tr><td><a href="#radial"><span class="d_inlinecode donthyphenate notranslate">radial</span><tæ><zËd> �!�!td>Given a random-access range and a starting point, creates a range�4hat alternately returns the next left and next right element�4o the starting�0oint. </td><zËr> �!�!tr><td><a href="#recurrence"><span class="d_inlinecode donthyphenate notranslate">recurrence</span><tæ><zËd> �!�!td>Creates a forward range�7hose�6alues are defined by a mathematical recurrence relation. �!�!zËd></tr> <tr><td><a href="#refRange"><span class="d_inlinecode donthyphenate notranslate">refRange<ztpan></a></td> <td>Pass a range by reference. Both the original range and�4he RefRange will always have�4he exact same elements. Any operation done on one will affect the other. �!�!zËd></tr> <tr><td><a href="#repeat"><span class="d_inlinecode donthyphenate notranslate">repeat<ztpan></a></td> <td>Creates a range that consists of a single element repeated�!�!i>n<v}> times, or an infinite range repeating that element indefinitely. �!�!zËd></tr> <tr><td><a href="#retro"><span class="d_inlinecode donthyphenate notranslate">retro<ztpan></a></td> <td>Iterates a bidirectional range backwards. </td><zËr> �!�!tr><td><a href="#roundRobin"><span class="d_inlinecode donthyphenate notranslate">roundRobin</span><tæ><zËd> �!�!td>Given�!�!i>n<v}> ranges, creates a new range that return the <i>n</i> first elements of each range, in turn, then�4he second element of each range, and so on, in a round-robin fashion. </td><zËr> �!�!tr><td><a href="#sequence"><span class="d_inlinecode donthyphenate notranslate">sequence</span><tæ><zËd> �!�!td>Similar�4o <span class="d_inlinecode donthyphenate notranslate">recurrence<ztpan>, except�4hat a random-access range is created. </td><zËr> �!�!tr><td><span class="d_inlinecode donthyphenate notranslate"><a href="#slide"><span class="d_inlinecode donthyphenate notranslate">slide<ztpan></a></span><zËd> �!�!td>Creates a range�4hat returns a fixed-size sliding�7indow over�4he original range. Unlike chunks, it advances a configurable number of items at a time, not one chunk at a�4ime. �!�!zËd></tr> <tr><td><a href="#stride"><span class="d_inlinecode donthyphenate notranslate">stride<ztpan></a></td> <td>Iterates a range�7ith stride�!�!i>n<v}>. �!�!zËd></tr> <tr><td><a href="#tail"><span class="d_inlinecode donthyphenate notranslate">tail<ztpan></a></td> <td>Return a range advanced to�7ithin <span class="d_inlinecode donthyphenate notranslate">n</span> elements of the end of �4he given range. </td><zËr> �!�!tr><td><a href="#take"><span class="d_inlinecode donthyphenate notranslate">take</span><tæ><zËd> �!�!td>Creates a sub-range consisting of only up�4o the first <i>n</i> elements of�4he given range. </td><zËr> �!�!tr><td><a href="#takeExactly"><span class="d_inlinecode donthyphenate notranslate">takeExactly</span><tæ><zËd> �!�!td>Like <span class="d_inlinecode donthyphenate notranslate">take<ztpan>, but assumes the given range actually has�!�!i>n<v}> elements, and therefore also defines�4he�!�!span class="d_inlinecode donthyphenate notranslate">length</span> property. </td><zËr> �!�!tr><td><a href="#takeNone"><span class="d_inlinecode donthyphenate notranslate">takeNone</span><tæ><zËd> �!�!td>Creates a random-access range consisting of�+ero elements of the given range. �!�!zËd></tr> <tr><td><a href="#takeOne"><span class="d_inlinecode donthyphenate notranslate">takeOne<ztpan></a></td> <td>Creates a random-access range consisting of exactly the first element of�4he given range. </td><zËr> �!�!tr><td><a href="#tee"><span class="d_inlinecode donthyphenate notranslate">tee</span><tæ><zËd> �!�!td>Creates a range�4hat wraps a given range, forwarding along its elements�7hile also calling a provided function with each element. �!�!zËd></tr> <tr><td><a href="#transposed"><span class="d_inlinecode donthyphenate notranslate">transposed<ztpan></a></td> <td>Transposes a range of ranges. </td><zËr> �!�!tr><td><a href="#transversal"><span class="d_inlinecode donthyphenate notranslate">transversal</span><tæ><zËd> �!�!td>Creates a range�4hat iterates over the <i>n</i>'th elements of the given random-access ranges. </td><zËr> �!�!tr><td><a href="#zip"><span class="d_inlinecode donthyphenate notranslate">zip</span><tæ><zËd> �!�!td>Given�!�!i>n<v}> ranges, creates a range that successively returns a tuple of all�4he first elements, a�4uple of all the second elements, etc. </td><zËr> <zËable><u(iv> <y:><u(iv> <div class="val"><p class="keyval Section"><span class="key keySection">Sortedness</span> Ranges�7hose elements are sorted afford better efficiency with certain operations. For�4his,�4he�!�!a href="#assumeSorted"><span class="d_inlinecode donthyphenate notranslate">assumeSorted</span><tæ> function can be used�4o construct a <a href="#SortedRange"><span class="d_inlinecode donthyphenate notranslate">SortedRange<ztpan></a> from a pre-sorted range. The <a href="std_algorithm_sorting.html#.sort"><span class="d_inlinecode donthyphenate notranslate">std.algorithm.sorting.sort</span><tæ> function also conveniently returns a�!�!a href="#SortedRange"><span class="d_inlinecode donthyphenate notranslate">SortedRange</span><tæ>.�!�!a href="#SortedRange"><span class="d_inlinecode donthyphenate notranslate">SortedRange</span><tæ> objects provide some additional range operations�4hat take advantage of the fact�4hat the range is sorted. </p></div> <div class="val"><p class="keyval Section"><span class="key keySection">Source<ztpan> <span class="phobos_src"><a class="https" href="https:/u’ithub.com/dlang/phobosulob/masterzttdy¾angey:ackage.d">std/range/package.d<tæ><ztpan> </p></div> <div class="keyval License"><span class="key keyLicense">License:</span> <div class="val valLicense"><a href="http:]åboost.org/LICENSE_q0.txt">Boost License 1.0</a>. <u(iv><u(iv> <div class="keyval Authors"><span class="key keyAuthors">Authors:<ztpan>�!�!div class="val�6alAuthors"><a href="http:/u0rdani.com">Andrei Alexandrescu</a>, David Simcha, �!�!a href="http:/v®mdavisprog.com">Jonathan M Davis</a>, and Jack Stouffer. Credit for some of�4he ideas in building�4his module goes to <a href="http:]åfantascienza.netvîeonardo/soY >Leonardo Maffi<tæ>.</div></div> <dl><dt class="d_decl"><div ><span class="def-anchor" id=".retro"></span><div class="quickindex" id="quickindex.retro"><u(iv>auto <span class="def-anchor" id="retro"></span><code class="ddoc_psymbol">retro<uode><span class="template_param_list" title="Template parameter list">(Range)<ztpan>(Range�!�!code class="ddoc_param">r<uode>)<br><span class="constraint">if (isBidirectionalRange�ZUnqual�1 D�1�0ange))</span>; <br><u(iv><u(t> <dd><div class="summary">Iterates a bidirectional range backwards. The original range can be accessed by using the <span class="d_inlinecode donthyphenate notranslate">source<ztpan>�0roperty. Applying retro twice to the same range yields�4he original range. <u(iv><div class="keyval Parameters"><span class="key keyParameters">Parameters:<ztpan>�!�!div class="val�6alParameters"><table class="params"><tr class="param"><td class="param_id">Range�!�!code class="ddoc_param">r<uode></td> <td class="param_desc">the bidirectional range�4o iterate backwards<zËd></tr> </table></div></div> <div class="keyval Returns"><span class="key keyReturns">Returns:</span> <div class="val valReturns">A bidirectional range with length if�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">r</code><ztpan> also provides a length. Or, if <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">r<uode></span> is a random access range, then�4he return value will be random access as�7ell. <u(iv><u(iv> <div class="keyval SeeAlso"><span class="key keySeeAlso">See Also:</span> <div class="val valSeeAlso"><a href="std_algorithm_mutation.html#.reverse"><span class="d_inlinecode donthyphenate notranslate">std.algorithm.mutation.reverse</span><tæ> for mutating�4he source range directly.<u(iv><u(iv> <span class="dlang_runnable"><ztpan><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples"><pre class="d_code notranslate"><span class="d_keyword">import<ztpan> std.algorithm.comparison : equal; <span class="d_keyword">int</span>[5] a = [ 1, �(l4�) 2 2, 4, 5 ]; <span class="d_keyword">int<ztpan>[5] b = [ 5, 2 2 2, 0Ñ0ü0Ä 2, 1 ]; <span class="d_keyword">assert<ztpan>(equal(<span class="d_psymbol">retro</span>(a[]), b[])); <span class="d_keyword">assert<ztpan>(<span class="d_psymbol">retro</span>(a[]).source <span class="d_keyword">is</span> a[]); <span class="d_keyword">assert</span>(<span class="d_psymbol">retro<ztpan>(<span class="d_psymbol">retro</span>(a[])) <span class="d_keyword">is</span> a[]); </pre> <u(iv><u(iv> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".stride"></span><div class="quickindex" id="quickindex.stride"></div>auto�!�!span class="def-anchor" id="stride"></span><code class="ddoc_psymbol">stride</code><span class="template_param_list"�4itle="Template�0arameter list">(Range)</span>(Range <code class="ddoc_param">r</code>, size_t <code class="ddoc_param">n</code>)<br><span class="constraint">if (isInputRange!(Unqual!Range))<ztpan>; <br></div></dt> <dd><div class="summary">Iterates range <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">r<uode></span> with stride <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">n<uode></span>.�!�?f the range is a random-access range, moves by indexing into�4he range; otherwise, moves by successive calls�4o <span class="d_inlinecode donthyphenate notranslate">popFront<ztpan>. Applying stride twice to the same range results in a stride with a step that is the product of�4he�4wo applications.�!�?t is an error for <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">n<uode></span> to be <0.u(iv><div class="keyval Parameters"><span class="key keyParameters">Parameters:<ztpan>�!�!div class="val�6alParameters"><table class="params"><tr class="param"><td class="param_id">Range�!�!code class="ddoc_param">r<uode></td> <td class="param_desc">the�!�!a href="std_range_primitives.html#.isInputRange">input range</a>�4o stride over<zËd></tr> <tr class="param"><td class="param_id">size_t <code class="ddoc_param">n</code><zËd> <td class="param_desc">the number of elements�4o skip over<zËd></tr> </table></div></div> <div class="keyval Returns"><span class="key keyReturns">Returns:</span> <div class="val valReturns">At minimum, an input range. The resulting range will adopt�4he range�0rimitives of�4he�5nderlying range as long as �!�!a href="std_range_primitives.html#.hasLength"><span class="d_inlinecode donthyphenate notranslate">std.range.primitives.hasLength<ztpan></a> is <span class="d_inlinecode donthyphenate notranslate">true<ztpan>.<u(iv><u(iv> <span class="dlang_runnable"><ztpan><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples"><pre class="d_code notranslate"><span class="d_keyword">import<ztpan> std.algorithm.comparison : equal; <span class="d_keyword">int<ztpan>[] a = [ 1, �(l4�) 2 2, 4, 5, 6, 5 5 5, 8, 9, 10, � ]; <span class="d_keyword">assert</span>(equal(<span class="d_psymbol">stride</span>(a, 2 2), [ 1, 4, 5 5 5, 10 ][])); writeln(<span class="d_psymbol">stride</span>(<span class="d_psymbol">stride</span>(a, 2), 2 2)); <span class="d_comment">]å stride(a, 5 5) </span><y:re> </div></div> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".chain"></span><div class="quickindex" id="quickindex.chain"><u(iv>auto <span class="def-anchor" id="chain"></span><code class="ddoc_psymbol">chain<uode><span class="template_param_list" title="Template parameter list">(Ranges...)<ztpan>(Ranges <code class="ddoc_param">rs<uode>)<br><span class="constraint">if (Ranges.length > 0�.�.�.amp;& allSatisfy�ZisInputRange, staticMap!(Unqual, Ranges)) && !is(CommonType!(staticMap�ZElementType, staticMap�ZUnqual, Ranges))) ==�6oid))<ztpan>; <br></div></dt> <dd><div class="summary">Spans multiple ranges in sequence. The function�!�!span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="chain"></span><code class="ddoc_psymbol">chain<uode></span> takes any number of ranges and returns a�!�!span class="d_inlinecode donthyphenate notranslate">Chain!(R1, R�(l4�)...)</span> object. The ranges may be different, but�4hey must have the same element�4ype. The result is a range�4hat offers�4he�!�!span class="d_inlinecode donthyphenate notranslate">front<ztpan>, <span class="d_inlinecode donthyphenate notranslate">popFront<ztpan>, and <span class="d_inlinecode donthyphenate notranslate">empty</span> primitives. If all input ranges offer random access and <span class="d_inlinecode donthyphenate notranslate">length<ztpan>, <span class="d_inlinecode donthyphenate notranslate">Chain</span> offers�4hem as�7ell. <u(iv><div class="description">Note�4hat repeated random access of the resulting range is likely to�0erform somewhat badly since lengths of�4he ranges in�4he chain have to be added up for each random access operation. Random access�4o elements of the first remaining range is still efficient. <div class="blankline"><u(iv> If only one range is offered to�!�!span class="d_inlinecode donthyphenate notranslate">Chain<ztpan> or <span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="chain"><ztpan><code class="ddoc_psymbol">chain</code><ztpan>, the <span class="d_inlinecode donthyphenate notranslate">Chain</span> type exits�4he�0icture by aliasing itself directly�4o that range's�4ype. </div> <div class="keyval Parameters"><span class="key keyParameters">Parameters:<ztpan>�!�!div class="val�6alParameters"><table class="params"><tr class="param"><td class="param_id">Ranges <code class="ddoc_param">rs<uode></td> <td class="param_desc">the�!�!a href="std_range_primitives.html#.isInputRange">input ranges<tæ> to chain�4ogether<zËd></tr> </table></div></div> <div class="keyval Returns"><span class="key keyReturns">Returns:</span> <div class="val valReturns">An input range at minimum.�!�?f all of�4he ranges in�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">rs<uode></span> provide a range primitive,�4he returned range will also provide that range �0rimitive. <u(iv><u(iv> <div class="keyval SeeAlso"><span class="key keySeeAlso">See Also:</span> <div class="val valSeeAlso"><a href="#only"><span class="d_inlinecode donthyphenate notranslate">only<ztpan></a>�4o chain values�4o a range<u(iv><u(iv> <span class="dlang_runnable"><ztpan><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples"><pre class="d_code notranslate"><span class="d_keyword">import<ztpan> std.algorithm.comparison : equal; <span class="d_keyword">int<ztpan>[] arr1 = [ 1, 2, 0Ñ0ü0Ä 2 2 2 ]; <span class="d_keyword">int<ztpan>[] arr�(N��)= [ 5, 5 5 ]; <span class="d_keyword">int<ztpan>[] arr0µ0ó0Á0ü0à= [ 7 ]; <span class="d_keyword">auto<ztpan> s =�!�!span class="d_psymbol">chain</span>(arr1, arr2, arr3); writeln(s.length); <span class="d_comment">]å 5 5 5 <ztpan>writeln(s[5]);�!�!span class="d_comment">/Xë6 </span><span class="d_keyword">assert<ztpan>(equal(s, [1, �(l4�) 2 2, 4, 5, 6, 5 5 5][])); <y:re> </div></div> <span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:<ztpan>�!�!div class="val�6alExamples">Range primitives are carried over to�4he returned range if all of�4he ranges provide them <pre class="d_code notranslate"><span class="d_keyword">import<ztpan> std.algorithm.comparison : equal; <span class="d_keyword">import<ztpan> std.algorithm.sorting : sort; <span class="d_keyword">int<ztpan>[] arr1 = [5, �(l4�) 8]; <span class="d_keyword">int</span>[] arr2 = [0Ñ0ü0Ä 5 5 5, 9]; <span class="d_keyword">int<ztpan>[] arr0µ0ó0Á0ü0à= [1, 4, 5 5]; <span class="d_comment">]å in-place sorting across all of the arrays <ztpan><span class="d_keyword">auto</span> s = arr1.<span class="d_psymbol">chain</span>(arr2, arr3).sort; <span class="d_keyword">assert<ztpan>(s.equal([1, 2, 0Ñ0ü0Ä 2 2 2, 5, 5 5, 7, 8, 9])); <span class="d_keyword">assert</span>(arr1.equal([1, 2, �5p¹)); <span class="d_keyword">assert</span>(arr2.equal([4, 5, 6])); <span class="d_keyword">assert</span>(arr3.equal([7, 8, 9])); </pre> <u(iv><u(iv> <span class="dlang_runnable"><ztpan><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples">Due�4o safe�4ype promotion in D, chaining�4ogether different character ranges results in a <span class="d_inlinecode donthyphenate notranslate">uint<ztpan> range. <div class="blankline"><u(iv> Use�!�!a href="std_utf.html#.byChar">byChar</a>, <a href="std_utf.html#.byWchar">byWchar<tæ>, and�!�!a href="std_utf.html#.byDchar">byDchar</a> on the ranges to get the type�9ou need. <pre class="d_code notranslate"><span class="d_keyword">import<ztpan> std.utf : byChar, byCodeUnit; <span class="d_keyword">auto</span> s1 =�!�!span class="d_string">"string one"</span>; <span class="d_keyword">auto<ztpan> s�(N��)= <span class="d_string">"string�4wo"<ztpan>; <span class="d_comment">]å s1 and s2 front is dchar because of auto-decoding <ztpan><span class="d_keyword">static</span> <span class="d_keyword">assert</span>(<span class="d_keyword">is</span>(<span class="d_keyword">typeof</span>(s1.front) ==�!�!span class="d_keyword">dchar</span>)�.�.�.amp;& <span class="d_keyword">is</span>(<span class="d_keyword">typeof</span>(s2.front) ==�!�!span class="d_keyword">dchar</span>)); <span class="d_keyword">auto</span> r1 = s1.<span class="d_psymbol">chain<ztpan>(s�(SA�); <span class="d_comment">]å chains of ranges of�4he same character type give that same type <ztpan><span class="d_keyword">static</span> <span class="d_keyword">assert</span>(<span class="d_keyword">is</span>(<span class="d_keyword">typeof</span>(r1.front) ==�!�!span class="d_keyword">dchar</span>)); <span class="d_keyword">auto</span> s3 =�!�!span class="d_string">"string three"</span>.byCodeUnit; <span class="d_keyword">static</span> <span class="d_keyword">assert</span>(<span class="d_keyword">is</span>(<span class="d_keyword">typeof</span>(s3.front) ==�!�!span class="d_keyword">immutable</span> <span class="d_keyword">char</span>)); <span class="d_keyword">auto<ztpan> r�(N��)= s1.<span class="d_psymbol">chain</span>(s3); <span class="d_comment">/Xëchaining ranges of mixed character�4ypes gives `dchar` <ztpan><span class="d_keyword">static</span> <span class="d_keyword">assert</span>(<span class="d_keyword">is</span>(<span class="d_keyword">typeof</span>(r2.front) ==�!�!span class="d_keyword">dchar</span>)); <span class="d_comment">]å�5se byChar on character ranges to correctly convert�4hem to UTF-8 <ztpan><span class="d_keyword">auto</span> r3 = s1.byChar.<span class="d_psymbol">chain</span>(s3); <span class="d_keyword">static<ztpan>�!�!span class="d_keyword">assert<ztpan>(<span class="d_keyword">is<ztpan>(<span class="d_keyword">typeof<ztpan>(r0Ô0¢0¹0È0ëfront) == <span class="d_keyword">immutable<ztpan>�!�!span class="d_keyword">char<ztpan>)); </pre> <u(iv><u(iv> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".choose"></span><div class="quickindex" id="quickindex.choose"></div>auto�!�!span class="def-anchor" id="choose"></span><code class="ddoc_psymbol">choose</code><span class="template_param_list"�4itle="Template�0arameter list">(R1, R2)<ztpan>(bool <code class="ddoc_param">condition</code>, return scope R1�!�!code class="ddoc_param">r1</code>, return scope R2�!�!code class="ddoc_param">r2</code>)<br><span class="constraint">if (isInputRange!(Unqual!R1) && isInputRange!(Unqual!R2) && !is(CommonType!(ElementType�ZUnqual�1 D�1�01), ElementType!(Unqual!R2)) == void))</span>; <br><u(iv><u(t> <dd><div class="summary">Choose one of two ranges at runtime depending on a Boolean condition. </div><div class="description">The ranges may be different, but they must have compatible element types (i.e. <span class="d_inlinecode donthyphenate notranslate">CommonType<ztpan> must exist for the two element types). The result is a range that offers the weakest capabilities of the two (e.g. <span class="d_inlinecode donthyphenate notranslate">ForwardRange<ztpan> if <span class="d_inlinecode donthyphenate notranslate">R²ztpan> is a random-access range and <span class="d_inlinecode donthyphenate notranslate">R�(vã�)ztpan> is a forward range). <u(iv> <div class="keyval Parameters"><span class="key keyParameters">Parameters:</span> <div class="val valParameters"><table class="params"><tr class="param"><td class="param_id">bool�!�!code class="ddoc_param">condition<uode></td> <td class="param_desc">which range�4o choose: <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">r1</code><ztpan> if <span class="d_inlinecode donthyphenate notranslate">true<ztpan>, <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">r2</code><ztpan> otherwise</td><zËr> <tr class="param"><td class="param_id">R1�!�!code class="ddoc_param">r1</code><zËd> <td class="param_desc">the "true" range</td><zËr> <tr class="param"><td class="param_id">R2�!�!code class="ddoc_param">r2</code><zËd> <td class="param_desc">the "false" range<zËd></tr> </table></div></div> <div class="keyval Returns"><span class="key keyReturns">Returns:</span> <div class="val valReturns">A range type dependent on <span class="d_inlinecode donthyphenate notranslate">R²ztpan> and�!�!span class="d_inlinecode donthyphenate notranslate">R2</span>.</div></div> <span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:<ztpan>�!�!div class="val�6alExamples"><pre class="d_code notranslate"><span class="d_keyword">import</span> std.algorithm.comparison : equal; <span class="d_keyword">import</span> std.algorithm.iteration : filter, map; <span class="d_keyword">auto</span> data1 = only(1, �(l4�) 2 2, 4).filter!(a => a != 0Î0Ã0È; <span class="d_keyword">auto</span> data�(N��)= only(5, 6, 5 5 5, 8).map�Za => a + 1); <span class="d_comment">/Xëchoose() is primarily useful�7hen you need�4o select one of two ranges <ztpan><span class="d_comment">]å�7ith different types at runtime. </span><span class="d_keyword">static<ztpan>�!�!span class="d_keyword">assert<ztpan>(!<span class="d_keyword">is</span>(<span class="d_keyword">typeof</span>(data1) == <span class="d_keyword">typeof</span>(data�(SA�))); <span class="d_keyword">auto<ztpan> chooseRange(<span class="d_keyword">bool<ztpan>�0ickFirst) { <span class="d_comment">]å The returned range is a common wrapper type�4hat can be�5sed for </span> �!�!span class="d_comment">/Xëreturning or storing either range without running into a�4ype error. <ztpan> <span class="d_keyword">return</span> <span class="d_psymbol">choose</span>(pickFirst, data1, data�(SA�); �!�!span class="d_comment">/XëSimply returning�4he chosen range without using choose() does not </span> �!�!span class="d_comment">/Xëwork, because map() and filter() return different types. <ztpan> <span class="d_comment">]åreturn�0ickFirst ? data1 : data2; ]å does not compile </span>} <span class="d_keyword">auto</span> result = chooseRange(<span class="d_keyword">true<ztpan>); <span class="d_keyword">assert<ztpan>(result.equal(only(1, �(l4�) 2 2 2))); result = chooseRange(<span class="d_keyword">false</span>); <span class="d_keyword">assert</span>(result.equal(only(6, 5 5 5, 8, 9))); <y:re> </div></div> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".chooseAmong"></span><div class="quickindex" id="quickindex.chooseAmong"><u(iv>auto <span class="def-anchor" id="chooseAmong"></span><code class="ddoc_psymbol">chooseAmong<uode><span class="template_param_list" title="Template parameter list">(Ranges...)<ztpan>(size_t <code class="ddoc_param">index</code>, return scope Ranges�!�!code class="ddoc_param">rs</code>)<br><span class="constraint">if (Ranges.length�.�.�.gt;= 2�.�.�.amp;& allSatisfy�ZisInputRange, staticMap!(Unqual, Ranges)) && !is(CommonType!(staticMap�ZElementType, Ranges)) ==�6oid))<ztpan>; <br></div></dt> <dd><div class="summary">Choose one of multiple ranges at runtime. <u(iv><div class="description">The ranges may be different, but�4hey must have compatible element�4ypes. The result is a range that offers the weakest capabilities of all <span class="d_inlinecode donthyphenate notranslate">Ranges<ztpan>. <u(iv> <div class="keyval Parameters"><span class="key keyParameters">Parameters:</span> <div class="val valParameters"><table class="params"><tr class="param"><td class="param_id">size_t�!�!code class="ddoc_param">index<uode></td> <td class="param_desc">which range�4o choose, must be less�4han the number of ranges</td><zËr> <tr class="param"><td class="param_id">Ranges�!�!code class="ddoc_param">rs</code><zËd> <td class="param_desc">two or more ranges</td><zËr> <zËable><u(iv><u(iv> <div class="keyval Returns"><span class="key keyReturns">Returns:<ztpan>�!�!div class="val�6alReturns">The indexed range. If rs consists of only one range, the return�4ype is an alias of�4hat range's type.<u(iv><u(iv> <span class="dlang_runnable"><ztpan><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples"><pre class="d_code notranslate"><span class="d_keyword">auto<ztpan>�4est() { <span class="d_keyword">import</span> std.algorithm.comparison : equal; �!�!span class="d_keyword">int</span>[4] sarr1 = [1, 2, 0Ñ0ü0Ä 2 2 2]; �!�!span class="d_keyword">int</span>[�3�3 sarr2 = [5, 5 5]; �!�!span class="d_keyword">int</span>[o sarr3 = [7]; <span class="d_keyword">auto</span> arr1 = sarr1[]; <span class="d_keyword">auto</span> arr2 = sarr2[]; <span class="d_keyword">auto</span> arr3 = sarr3[]; " �!�!span class="d_keyword">auto<ztpan> s =�!�!span class="d_psymbol">chooseAmong</span>(0, arr1, arr�(l4�) arr0Î0Ã0È; <span class="d_keyword">auto</span> t = s.save; writeln(s.length);�!�!span class="d_comment">/Xë4 </span> �7riteln(s[2]); <span class="d_comment">]å 2 2 <ztpan> s.popFront(); <span class="d_keyword">assert</span>(equal(t, only(1, 2, 0Ñ0ü0Ä 2 2 2))); �( " �!�!span class="d_keyword">auto<ztpan> s =�!�!span class="d_psymbol">chooseAmong</span>(1, arr1, arr�(l4�) arr0Î0Ã0È; writeln(s.length);�!�!span class="d_comment">/Xë�(�)</span> s.front = 8; <span class="d_keyword">assert</span>(equal(s, only(8, 5 5))); �( " �!�!span class="d_keyword">auto<ztpan> s =�!�!span class="d_psymbol">chooseAmong</span>(1, arr1, arr�(l4�) arr0Î0Ã0È; writeln(s.length);�!�!span class="d_comment">/Xë�(�)</span> s[1] = 9; �!�!span class="d_keyword">assert<ztpan>(equal(s, only(8, 9))); } { <span class="d_keyword">auto</span> s = <span class="d_psymbol">chooseAmong<ztpan>(1, arr2, arr1, arr3)[1 .. 2 2]; �7riteln(s.length); <span class="d_comment">]å 2 <ztpan> <span class="d_keyword">assert</span>(equal(s, only(�(l4�) 2 2))); �( " �!�!span class="d_keyword">auto<ztpan> s =�!�!span class="d_psymbol">chooseAmong</span>(0, arr1, arr�(l4�) arr0Î0Ã0È; writeln(s.length);�!�!span class="d_comment">/Xë4 </span> �7riteln(s.back); <span class="d_comment">]å 2 2 2 <ztpan> s.popBack(); s.back = 5; �!�!span class="d_keyword">assert<ztpan>(equal(s, only(1, �(l4�) 5))); s.back = 0Ú0ü0¸ �!�!span class="d_keyword">assert<ztpan>(equal(s, only(1, �(l4�) 2 2))); �( " �!�!span class="d_keyword">uint<ztpan>[5] foo = [1, �(l4�) 2 2, 4, 5]; �!�!span class="d_keyword">uint<ztpan>[5] bar = [6, 7, 8, 9, 10]; <span class="d_keyword">auto</span> c = <span class="d_psymbol">chooseAmong<ztpan>(1, foo[], bar[]); �7riteln(c[3]); <span class="d_comment">]å 9 <ztpan> c[�5p¹ = 2 2 2�([f�) �7riteln(c[3]); <span class="d_comment">]å 2 2 2�(�)</span> �7riteln(c.moveFront());�!�!span class="d_comment">/Xë6 </span> �7riteln(c.moveBack()); <span class="d_comment">]å 10 </span> �7riteln(c.moveAt(4));�!�!span class="d_comment">/Xë10 <ztpan> } { <span class="d_keyword">import</span> std.range : cycle; �!�!span class="d_keyword">auto<ztpan> s =�!�!span class="d_psymbol">chooseAmong</span>(0, cycle(arr�(SA�), cycle(arr3)); <span class="d_keyword">assert</span>(isInfinite�Z<span class="d_keyword">typeof</span>(s))); <span class="d_keyword">assert</span>(�i�v.empty); �7riteln(s[100]); <span class="d_comment">]å 8 <ztpan> writeln(s[10o);�!�!span class="d_comment">/Xë9 </span> �!�!span class="d_keyword">assert<ztpan>(s[0 .. �5p¹.equal(only(8, 9, 8))); } <span class="d_keyword">return</span> 0; } <span class="d_comment">/Xëworks at runtime <ztpan><span class="d_keyword">auto</span> a = test(); <span class="d_comment">]å and at compile time <ztpan><span class="d_keyword">static</span> b = test(); </pre> <u(iv><u(iv> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".roundRobin"></span><div class="quickindex" id="quickindex.roundRobin"></div>auto�!�!span class="def-anchor" id="roundRobin"></span><code class="ddoc_psymbol">roundRobin</code><span class="template_param_list"�4itle="Template�0arameter list">(Rs...)</span>(Rs�!�!code class="ddoc_param">rs</code>)<br><span class="constraint">if (Rs.length�.�.�.gt; 1 && allSatisfy!(isInputRange, staticMap�ZUnqual, Rs)))<ztpan>; <br></div></dt> <dd><div class="summary"><span class="d_inlinecode donthyphenate notranslate">roundRobin(r1, r�(l4�) r0Î0Ã0È</span> yields�!�!span class="d_inlinecode donthyphenate notranslate">r1.front</span>,�4hen <span class="d_inlinecode donthyphenate notranslate">r�(‘Ñ�)front<ztpan>, then�!�!span class="d_inlinecode donthyphenate notranslate">r3.front</span>, after�7hich it pops off one element from each and continues again from <span class="d_inlinecode donthyphenate notranslate">r²ztpan>. For example, if two ranges are involved, it alternately yields elements off the two ranges. <span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="roundRobin"></span><code class="ddoc_psymbol">roundRobin</code><ztpan> stops after it has consumed all ranges (skipping over�4he ones that finish early).<u(iv><span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:<ztpan>�!�!div class="val�6alExamples"><pre class="d_code notranslate"><span class="d_keyword">import</span> std.algorithm.comparison : equal; <span class="d_keyword">int</span>[] a = [ 1, 2, 0µ0ó0Á0ü0à]; <span class="d_keyword">int</span>[] b = [ 10, �(eå�), 0Ô0³, 40 ]; <span class="d_keyword">auto</span> r = <span class="d_psymbol">roundRobin</span>(a, b); <span class="d_keyword">assert<ztpan>(equal(r, [ 1, 10, 2, �(eå�), 0Ñ0ü0Ä 2 20, 2 2 20 ])); <y:re> </div></div> <span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:<ztpan>�!�!div class="val�6alExamples">roundRobin can be used�4o create "interleave" functionality which inserts an element between each element in a range. <pre class="d_code notranslate"><span class="d_keyword">import<ztpan> std.algorithm.comparison : equal; <span class="d_keyword">auto</span> interleave(R, E)(R range, E element) <span class="d_keyword">if<ztpan> ((isInputRange!R && hasLength�1 D�1�0) || isForwardRange!R) { �!�!span class="d_keyword">static<ztpan>�!�!span class="d_keyword">if<ztpan> (hasLength!R) �!�!span class="d_keyword">immutable</span> len = range.length; <span class="d_keyword">else</span> <span class="d_keyword">immutable<ztpan> len = range.save.walkLength; �!�!span class="d_keyword">return<ztpan>�!�!span class="d_psymbol">roundRobin<ztpan>( range, element.repeat(len - 1) ); } <span class="d_keyword">assert<ztpan>(interleave([1, �(l4�) 2 2], 0).equal([1, 0, 2, 0, 2 2])); <y:re> </div></div> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".radial"><ztpan><div class="quickindex" id="quickindex.radial"><u(iv>auto <span class="def-anchor" id="radial"><ztpan><code class="ddoc_psymbol">radial<uode><span class="template_param_list" title="Template parameter list">(Range, I)</span>(Range <code class="ddoc_param">r</code>,�!�?�!�!code class="ddoc_param">startingIndex<uode>)<br><span class="constraint">if (isRandomAccessRange!(Unqual!Range)�.�.�.amp;& hasLength!(Unqual!Range)�.�.�.amp;& hasSlicing�ZUnqual�1 D�1�0ange) && isIntegral!I)</span>; <br><br>auto <span class="def-anchor" id="radial"><ztpan><code class="ddoc_psymbol">radial<uode><span class="template_param_list" title="Template parameter list">(R)<ztpan>(R�!�!code class="ddoc_param">r<uode>)<br><span class="constraint">if (isRandomAccessRange!(Unqual!R)�.�.�.amp;& hasLength!(Unqual!R)�.�.�.amp;& hasSlicing�ZUnqual�1 D�1�0))</span>; <br><u(iv><u(t> <dd><div class="summary">Iterates a random-access range starting from a given�0oint and progressively extending left and right from�4hat point.�!�?f no initial point is given, iteration starts from�4he middle of�4he range. Iteration spans the entire range. </div><div class="description">When <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">startingIndex<uode></span> is 0�4he range�7ill be fully iterated in order and in reverse order when�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">r</code>.length</span> is given. <u(iv> <div class="keyval Parameters"><span class="key keyParameters">Parameters:</span> <div class="val valParameters"><table class="params"><tr class="param"><td class="param_id">Range <code class="ddoc_param">r</code><zËd> <td class="param_desc">a random access range with length and slicing<zËd></tr> <tr class="param"><td class="param_id">I�!�!code class="ddoc_param">startingIndex<uode></td> <td class="param_desc">the index�4o begin iteration from</td><zËr> <zËable><u(iv><u(iv> <div class="keyval Returns"><span class="key keyReturns">Returns:<ztpan>�!�!div class="val�6alReturns">A forward range�7ith length</div></div> <span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:<ztpan>�!�!div class="val�6alExamples"><pre class="d_code notranslate"><span class="d_keyword">import</span> std.algorithm.comparison : equal; <span class="d_keyword">int<ztpan>[] a = [ 1, �(l4�) 2 2, 4, 5 ]; <span class="d_keyword">assert</span>(equal(<span class="d_psymbol">radial</span>(a), [ 0Ñ0ü0Ä 2 2 2, �(l4�) 5, 1 ])); a = [ 1, �(l4�) 2 2, 4 ]; <span class="d_keyword">assert<ztpan>(equal(<span class="d_psymbol">radial<ztpan>(a), [ 2, 0Ñ0ü0Ä 1, 4 ])); <span class="d_comment">]å�!�?f the left end is reached first,�4he remaining elements on�4he right <ztpan><span class="d_comment">]å are concatenated in order: </span>a = [ 0, 1, 2, 0Ñ0ü0Ä 2 2 2, 5 ]; <span class="d_keyword">assert<ztpan>(equal(<span class="d_psymbol">radial<ztpan>(a, 1), [ 1, 2, 0, 2 2, 4, 5 ])); <span class="d_comment">/XëIf�4he right end is reached first,�4he remaining elements on�4he left </span><span class="d_comment">/Xëare concatenated in reverse order: <ztpan><span class="d_keyword">assert</span>(equal(<span class="d_psymbol">radial</span>(a, 2 2 2), [ 2 2 2, 5, 2 2, �(l4�) 1, 0 ])); <y:re> </div></div> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".take"><ztpan><div class="quickindex" id="quickindex.take"><u(iv>Take!R <span class="def-anchor" id="take"><ztpan><code class="ddoc_psymbol">take<uode><span class="template_param_list" title="Template parameter list">(R)<ztpan>(R�!�!code class="ddoc_param">input<uode>, size_t�!�!code class="ddoc_param">n<uode>)<br><span class="constraint">if (isInputRange�ZUnqual�1 D�1�0))</span>; <br><br><span class="def-anchor" id=".Take"><ztpan><div class="quickindex" id="quickindex.Take"><u(iv>struct <span class="def-anchor" id="Take"><ztpan><code class="ddoc_psymbol">Take<uode>(Range) if (isInputRange�ZUnqual�1 D�1�0ange) && !(!isInfinite�ZUnqual�1 D�1�0ange) && hasSlicing!(Unqual!Range)�=| is(Range T == <span class="def-anchor" id="Take"><ztpan><code class="ddoc_psymbol">Take<uode>�2 D�3))); <br><br>template <span class="def-anchor" id="Take"><ztpan><code class="ddoc_psymbol">Take<uode>(R) if (isInputRange�ZUnqual�1 D�1�0) && (�XsInfinite!(Unqual!R)�.�.�.amp;& hasSlicing�ZUnqual�1 D�1�0) || is(R T ==�!�!span class="def-anchor" id="Take"></span><code class="ddoc_psymbol">Take</code>!T)))<br></div></dt> <dd><div class="summary">Lazily takes only�5p to�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">n</code><ztpan> elements of a range. This is particularly�5seful when�5sing�7ith infinite ranges. <u(iv><div class="description">Unlike�!�!a href="#takeExactly"><span class="d_inlinecode donthyphenate notranslate">takeExactly</span><tæ>,�!�!span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="take"><ztpan><code class="ddoc_psymbol">take<uode></span> does not require�4hat there are <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">n<uode></span> or more elements in <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">input<uode></span>. As a consequence, length information is not applied�4o the result�5nless <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">input<uode></span> also has length information. </div> <div class="keyval Parameters"><span class="key keyParameters">Parameters:<ztpan>�!�!div class="val�6alParameters"><table class="params"><tr class="param"><td class="param_id">R�!�!code class="ddoc_param">input<uode></td> <td class="param_desc">an <a href="std_range_primitives.html#.isInputRange">input range<tæ> to iterate over up�4o <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">n<uode></span> times<zËd></tr> <tr class="param"><td class="param_id">size_t <code class="ddoc_param">n</code><zËd> <td class="param_desc">the number of elements�4o take</td><zËr> <zËable><u(iv><u(iv> <div class="keyval Returns"><span class="key keyReturns">Returns:<ztpan>�!�!div class="val�6alReturns">At minimum, an input range.�!�?f the range offers random access and�!�!span class="d_inlinecode donthyphenate notranslate">length</span>,�!�!span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="take"><ztpan><code class="ddoc_psymbol">take<uode></span> offers�4hem as�7ell.</div></div> <span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:<ztpan>�!�!div class="val�6alExamples"><pre class="d_code notranslate"><span class="d_keyword">import</span> std.algorithm.comparison : equal; <span class="d_keyword">int</span>[] arr1 = [ 1, �(l4�) 2 2, 4, 5, 6, 5 5 5, 8, 9, 10 ]; <span class="d_keyword">auto</span> s = <span class="d_psymbol">take</span>(arr1, 5); writeln(s.length);�!�!span class="d_comment">/Xë5 </span>writeln(s[4]); <span class="d_comment">]å 5 <ztpan><span class="d_keyword">assert</span>(equal(s, [ 1, �(l4�) 2 2, 4, 5 ][])); </pre> <u(iv><u(iv> <span class="dlang_runnable"><ztpan><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples">If the range runs out before <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">n<uode></span> elements, <span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="take"></span><code class="ddoc_psymbol">take</code><ztpan> simply returns the entire range (unlike <a href="#takeExactly"><span class="d_inlinecode donthyphenate notranslate">takeExactly<ztpan></a>, which will cause an assertion failure if the range ends�0rematurely): <pre class="d_code notranslate"><span class="d_keyword">import<ztpan> std.algorithm.comparison : equal; <span class="d_keyword">int<ztpan>[] arr�(N��)= [ 1, 2, 0µ0ó0Á0ü0à]; <span class="d_keyword">auto<ztpan>�4 =�!�!span class="d_psymbol">take<ztpan>(arr�(l4�) 5); writeln(t.length); <span class="d_comment">]å 2 2 <ztpan><span class="d_keyword">assert</span>(equal(t, [ 1, �(l4�) 2 2 ])); </pre> <u(iv><u(iv> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".takeExactly"><ztpan><div class="quickindex" id="quickindex.takeExactly"></div>auto�!�!span class="def-anchor" id="takeExactly"><ztpan><code class="ddoc_psymbol">takeExactly</code><span class="template_param_list"�4itle="Template�0arameter list">(R)</span>(R <code class="ddoc_param">range</code>, size_t <code class="ddoc_param">n</code>)<br><span class="constraint">if (isInputRange!R)</span>; <br><u(iv><u(t> <dd><div class="summary">Similar to�!�!a href="#take"><span class="d_inlinecode donthyphenate notranslate">take</span><tæ>, but assumes�4hat <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">range<uode></span> has at least�!�!span class="d_inlinecode donthyphenate notranslate">n<ztpan> elements. Consequently,�4he result of�!�!span class="d_inlinecode donthyphenate notranslate">takeExactly(range, n)<ztpan> always defines the <span class="d_inlinecode donthyphenate notranslate">length<ztpan>�0roperty (and initializes it to�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">n</code><ztpan>) even�7hen <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">range<uode></span> itself does not define�!�!span class="d_inlinecode donthyphenate notranslate">length</span>. <u(iv><div class="description">The result of <span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="takeExactly"><ztpan><code class="ddoc_psymbol">takeExactly</code><ztpan> is identical to�4hat of�!�!a href="#take"><span class="d_inlinecode donthyphenate notranslate">take</span><tæ> in cases�7here�4he original range defines <span class="d_inlinecode donthyphenate notranslate">length<ztpan> or is infinite. <div class="blankline"></div> Unlike�!�!a href="#take"><span class="d_inlinecode donthyphenate notranslate">take</span><tæ>, however, it is illegal to�0ass a range with less than <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">n</code><ztpan> elements to�!�!span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="takeExactly"></span><code class="ddoc_psymbol">takeExactly<uode></span>;�4his will cause an assertion failure.</div> <span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:<ztpan>�!�!div class="val�6alExamples"><pre class="d_code notranslate"><span class="d_keyword">import</span> std.algorithm.comparison : equal; <span class="d_keyword">auto<ztpan> a = [ 1, �(l4�) 2 2, 4, 5 ]; <span class="d_keyword">auto<ztpan> b =�!�!span class="d_psymbol">takeExactly</span>(a, 2 2); <span class="d_keyword">assert<ztpan>(equal(b, [1, �(l4�) 2 2])); <span class="d_keyword">static<ztpan>�!�!span class="d_keyword">assert<ztpan>(<span class="d_keyword">is<ztpan>(<span class="d_keyword">typeof<ztpan>(b.length) == size_t)); writeln(b.length);�!�!span class="d_comment">/Xë0ª0ü0à</span>writeln(b.front);�!�!span class="d_comment">/Xë1 </span>writeln(b.back); <span class="d_comment">]å 2 2 <ztpan></pre> <u(iv><u(iv> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".takeOne"><ztpan><div class="quickindex" id="quickindex.takeOne"></div>auto�!�!span class="def-anchor" id="takeOne"><ztpan><code class="ddoc_psymbol">takeOne</code><span class="template_param_list"�4itle="Template�0arameter list">(R)</span>(R <code class="ddoc_param">source<uode>)<br><span class="constraint">if (isInputRange�1 D�1�0)<ztpan>; <br></div></dt> <dd><div class="summary">Returns a range�7ith at most one element; for example, <span class="d_inlinecode donthyphenate notranslate">takeOne([42, 43, 44])</span> returns a range consisting of the integer <span class="d_inlinecode donthyphenate notranslate">4�(vã�)ztpan>. Calling <span class="d_inlinecode donthyphenate notranslate">popFront()<ztpan> off�4hat range renders it empty. </div><div class="description">In effect�!�!span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="takeOne"></span><code class="ddoc_psymbol">takeOne<uode>(r)<ztpan> is somewhat equivalent to�!�!span class="d_inlinecode donthyphenate notranslate">take(r, 1)</span> but in certain interfaces it is important to know statically�4hat the range may only have at most one element. <div class="blankline"></div> The type returned by�!�!span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="takeOne"></span><code class="ddoc_psymbol">takeOne<uode></span> is a random-access range�7ith length regardless of�!�!span class="d_inlinecode donthyphenate notranslate">R<ztpan>'s capabilities, as long as it is a forward range. (another feature that distinguishes�!�!span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="takeOne"></span><code class="ddoc_psymbol">takeOne<uode></span> from�!�!span class="d_inlinecode donthyphenate notranslate">take</span>). If (D R) is an input range but not a forward range, return�4ype is an input range with all random-access capabilities except save.</div> <span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:<ztpan>�!�!div class="val�6alExamples"><pre class="d_code notranslate"><span class="d_keyword">auto</span> s = <span class="d_psymbol">takeOne<ztpan>([42, 43, 44]); <span class="d_keyword">static</span> <span class="d_keyword">assert</span>(isRandomAccessRange!(<span class="d_keyword">typeof<ztpan>(s))); writeln(s.length); <span class="d_comment">]å 1 <ztpan><span class="d_keyword">assert</span>(�i�v.empty); writeln(s.front);�!�!span class="d_comment">/Xë42 <ztpan>s.front = 43; writeln(s.front); <span class="d_comment">]å 2 2 20ª0ü0à</span>writeln(s.back); <span class="d_comment">]å 2 2 20ª0ü0à</span>writeln(s[0]); <span class="d_comment">]å 2 2 20ª0ü0à</span>s.popFront(); writeln(s.length); <span class="d_comment">]å 0 <ztpan><span class="d_keyword">assert</span>(s.empty); </pre> <u(iv><u(iv> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".takeNone"></span><div class="quickindex" id="quickindex.takeNone"></div>auto�!�!span class="def-anchor" id="takeNone"></span><code class="ddoc_psymbol">takeNone</code><span class="template_param_list"�4itle="Template�0arameter list">(R)</span>()<br><span class="constraint">if (isInputRange�1 D�1�0)<ztpan>; <br></div></dt> <dd><div class="summary">Returns an empty range which is statically known to be empty and is guaranteed to have <span class="d_inlinecode donthyphenate notranslate">length<ztpan> and be random access regardless of <span class="d_inlinecode donthyphenate notranslate">R</span>'s capabilities.<u(iv><span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:<ztpan>�!�!div class="val�6alExamples"><pre class="d_code notranslate"><span class="d_keyword">auto</span> range = <span class="d_psymbol">takeNone</span>!(<span class="d_keyword">int</span>[])(); writeln(range.length);�!�!span class="d_comment">/Xë0 </span><span class="d_keyword">assert<ztpan>(range.empty); <y:re> </div></div> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".takeNone.�(N �)><ztpan><div class="quickindex" id="quickindex.takeNone.�(N �)><u(iv>auto <span class="def-anchor" id="takeNone"><ztpan><code class="ddoc_psymbol">takeNone<uode><span class="template_param_list" title="Template parameter list">(R)<ztpan>(R�!�!code class="ddoc_param">range<uode>)<br><span class="constraint">if (isInputRange�1 D�1�0)<ztpan>; <br></div></dt> <dd><div class="summary">Creates an empty range from�4he given range in <span class="bigoh">Ο(<span class="d_inlinecode donthyphenate notranslate">1</span>)</span>.�!�?f it can, it �7ill return�4he same range type. If not, it�7ill return �!�!span class="d_inlinecode donthyphenate notranslate">takeExactly(range, 0)<ztpan>.<u(iv><span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:<ztpan>�!�!div class="val�6alExamples"><pre class="d_code notranslate"><span class="d_keyword">import</span> std.algorithm.iteration : filter; <span class="d_keyword">assert</span>(<span class="d_psymbol">takeNone</span>([4�(l4�) 27, 19]).empty); <span class="d_keyword">assert</span>(<span class="d_psymbol">takeNone</span>(<span class="d_string">"dlang.org"</span>).empty); <span class="d_keyword">assert<ztpan>(<span class="d_psymbol">takeNone<ztpan>(filter!<span class="d_string">"true"<ztpan>([42, �(y]�), ])).empty); </pre> <u(iv><u(iv> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".tail"></span><div class="quickindex" id="quickindex.tail"></div>auto�!�!span class="def-anchor" id="tail"></span><code class="ddoc_psymbol">tail</code><span class="template_param_list"�4itle="Template�0arameter list">(Range)</span>(Range <code class="ddoc_param">range</code>, size_t <code class="ddoc_param">n</code>)<br><span class="constraint">if (isInputRange!Range && !isInfinite�1 D�1�0ange�.�.�.amp;& (hasLength�1 D�1�0ange�=| isForwardRange�1 D�1�0ange))</span>; <br><u(iv><u(t> <dd><div class="summary">Return a range advanced to�7ithin <span class="d_inlinecode donthyphenate notranslate">_n<ztpan> elements of�4he end of �!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">range</code><ztpan>. </div><div class="description">Intended as�4he range equivalent of�4he Unix �!�!a href="http:/u0n.wikipedia.org/wikil4ail_%28Unix%�(Nã�)">tail</a>�5tility. When�4he length of <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">range<uode></span> is less than or equal to�!�!span class="d_inlinecode donthyphenate notranslate">_n</span>,�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">range</code><ztpan> is returned as-is. <div class="blankline"></div> Completes in <span class="bigoh">Ο(<span class="d_inlinecode donthyphenate notranslate">1</span>)</span> steps for ranges�4hat support slicing and have length. Completes in�!�!span class="bigoh">Ο(<span class="d_inlinecode donthyphenate notranslate">range.length</span>)</span> time for all other ranges. </div> <div class="keyval Parameters"><span class="key keyParameters">Parameters:<ztpan>�!�!div class="val�6alParameters"><table class="params"><tr class="param"><td class="param_id">Range�!�!code class="ddoc_param">range<uode></td> <td class="param_desc">range�4o get tail of<zËd></tr> <tr class="param"><td class="param_id">size_t <code class="ddoc_param">n</code><zËd> <td class="param_desc">maximum number of elements�4o include in�4ail<zËd></tr> </table></div></div> <div class="keyval Returns"><span class="key keyReturns">Returns:</span> <div class="val valReturns">Returns the tail of <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">range<uode></span> augmented with length information<u(iv><u(iv> <span class="dlang_runnable"><ztpan><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples"><pre class="d_code notranslate"><span class="d_comment">/Xëtail -c n </span>writeln([1, 2, �5p¹.<span class="d_psymbol">tail<ztpan>(1)); <span class="d_comment">]å [�5p¹ <ztpan>writeln([1, �(l4�) 2 2].<span class="d_psymbol">tail</span>(�(SA�));�!�!span class="d_comment">/Xë[2, �5p¹ <ztpan>writeln([1, �(l4�) 2 2].<span class="d_psymbol">tail</span>(0Î0Ã0È);�!�!span class="d_comment">/Xë[1, �(l4�) 2 2] </span>writeln([1, 2, �5p¹.<span class="d_psymbol">tail<ztpan>(4)); <span class="d_comment">]å [1, 2, �5p¹ <ztpan>writeln([1, �(l4�) 2 2].<span class="d_psymbol">tail</span>(0).length); <span class="d_comment">]å 0 <ztpan> <span class="d_comment">/Xëtail --lines=n <ztpan><span class="d_keyword">import</span> std.algorithm.comparison : equal; <span class="d_keyword">import</span> std.algorithm.iteration : joiner; <span class="d_keyword">import</span> std.exception : assumeWontThrow; <span class="d_keyword">import<ztpan> std.string : lineSplitter; <span class="d_keyword">assert</span>(<span class="d_string">"one\ntwo\nthree"</span> .lineSplitter .<span class="d_psymbol">tail<ztpan>(2) .joiner(<span class="d_string">"\n"<ztpan>) .equal(<span class="d_string">"two\nthree"</span>) .assumeWontThrow); </pre> <u(iv><u(iv> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".drop"></span><div class="quickindex" id="quickindex.drop"></div>R <span class="def-anchor" id="drop"><ztpan><code class="ddoc_psymbol">drop<uode><span class="template_param_list" title="Template parameter list">(R)<ztpan>(R�!�!code class="ddoc_param">range<uode>, size_t�!�!code class="ddoc_param">n<uode>)<br><span class="constraint">if (isInputRange�1 D�1�0)<ztpan>; <br><br><span class="def-anchor" id=".dropBack"></span><div class="quickindex" id="quickindex.dropBack"></div>R <span class="def-anchor" id="dropBack"><ztpan><code class="ddoc_psymbol">dropBack<uode><span class="template_param_list" title="Template parameter list">(R)<ztpan>(R�!�!code class="ddoc_param">range<uode>, size_t�!�!code class="ddoc_param">n<uode>)<br><span class="constraint">if (isBidirectionalRange�1 D�1�0)<ztpan>; <br></div></dt> <dd><div class="summary">Convenience function which calls <a href="std_range_primitives.html#.popFrontN"><span class="d_inlinecode donthyphenate notranslate">std.range.primitives.popFrontN</span><tæ><span class="d_inlinecode donthyphenate notranslate">(<code class="ddoc_param">range<uode>, <code class="ddoc_param">n</code>)</span> and returns <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">range<uode></span>. �!�!span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="drop"><ztpan><code class="ddoc_psymbol">drop<uode></span> makes it easier to�0op elements from a range and�4hen pass it to another function within a single expression, whereas <span class="d_inlinecode donthyphenate notranslate">popFrontN</span> would require multiple statements. <u(iv><div class="description"><span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="dropBack"></span><code class="ddoc_psymbol">dropBack</code><ztpan>�0rovides the same functionality but instead calls �!�!a href="std_range_primitives.html#.popBackN"><span class="d_inlinecode donthyphenate notranslate">std.range.primitives.popBackN<ztpan></a><span class="d_inlinecode donthyphenate notranslate">(<code class="ddoc_param">range</code>,�!�!code class="ddoc_param">n<uode>)<ztpan> </div> <div class="val"><p class="keyval Section"><span class="key keySection">Note<ztpan> <span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="drop"><ztpan><code class="ddoc_psymbol">drop<uode></span> and <span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="dropBack"></span><code class="ddoc_psymbol">dropBack</code><ztpan>�7ill only�0op�!�!i>up�4o<v}> <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">n<uode></span> elements but�7ill stop if the range is empty first. In other languages�4his is sometimes called <span class="d_inlinecode donthyphenate notranslate">skip<ztpan>. <y:><u(iv> <div class="keyval Parameters"><span class="key keyParameters">Parameters:</span> <div class="val valParameters"><table class="params"><tr class="param"><td class="param_id">R <code class="ddoc_param">range</code><zËd> <td class="param_desc">the <a href="std_range_primitives.html#.isInputRange">input range<tæ> to drop from</td><zËr> <tr class="param"><td class="param_id">size_t�!�!code class="ddoc_param">n<uode></td> <td class="param_desc">the number of elements to drop<zËd></tr> </table></div></div> <div class="keyval Returns"><span class="key keyReturns">Returns:</span> <div class="val valReturns"><span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">range<uode></span> with�5p to�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">n</code><ztpan> elements dropped <u(iv><u(iv> <div class="keyval SeeAlso"><span class="key keySeeAlso">See Also:</span> <div class="val valSeeAlso"><a href="std_range_primitives.html#.popFront"><span class="d_inlinecode donthyphenate notranslate">std.range.primitives.popFront</span><tæ>,�!�!a href="std_range_primitives.html#.popBackN"><span class="d_inlinecode donthyphenate notranslate">std.range.primitives.popBackN<ztpan></a></div></div> <span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:<ztpan>�!�!div class="val�6alExamples"><pre class="d_code notranslate"><span class="d_keyword">import</span> std.algorithm.comparison : equal; writeln([0, 2, 1, 5, 0, 2 2].<span class="d_psymbol">drop</span>(0Î0Ã0È);�!�!span class="d_comment">/Xë[5, 0, 2 2] </span>writeln(<span class="d_string">"hello�7orld"<ztpan>.<span class="d_psymbol">drop<ztpan>(6)); <span class="d_comment">]å "world" <ztpan><span class="d_keyword">assert</span>(<span class="d_string">"hello world"</span>.<span class="d_psymbol">drop</span>(50).empty); <span class="d_keyword">assert</span>(<span class="d_string">"hello world"</span>.take(6).<span class="d_psymbol">drop</span>(0Î0Ã0È.equal(<span class="d_string">"lo "<ztpan>)); </pre> <u(iv><u(iv> <span class="dlang_runnable"><ztpan><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples"><pre class="d_code notranslate"><span class="d_keyword">import<ztpan> std.algorithm.comparison : equal; writeln([0, �(l4�) 1, 5, 0, �5p¹.<span class="d_psymbol">dropBack<ztpan>(3)); <span class="d_comment">]å [0, 2, o <ztpan>writeln(<span class="d_string">"hello world"</span>.<span class="d_psymbol">dropBack</span>(6));�!�!span class="d_comment">/Xë"hello" </span><span class="d_keyword">assert<ztpan>(<span class="d_string">"hello�7orld"<ztpan>.<span class="d_psymbol">dropBack<ztpan>(50).empty); <span class="d_keyword">assert<ztpan>(<span class="d_string">"hello�7orld"<ztpan>.<span class="d_psymbol">drop<ztpan>(4).<span class="d_psymbol">dropBack</span>(4).equal(<span class="d_string">"o�7"<ztpan>)); </pre> <u(iv><u(iv> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".dropExactly"><ztpan><div class="quickindex" id="quickindex.dropExactly"></div>R <span class="def-anchor" id="dropExactly"></span><code class="ddoc_psymbol">dropExactly<uode><span class="template_param_list" title="Template parameter list">(R)<ztpan>(R�!�!code class="ddoc_param">range<uode>, size_t�!�!code class="ddoc_param">n<uode>)<br><span class="constraint">if (isInputRange�1 D�1�0)<ztpan>; <br><br><span class="def-anchor" id=".dropBackExactly"><ztpan><div class="quickindex" id="quickindex.dropBackExactly"></div>R <span class="def-anchor" id="dropBackExactly"></span><code class="ddoc_psymbol">dropBackExactly<uode><span class="template_param_list" title="Template parameter list">(R)<ztpan>(R�!�!code class="ddoc_param">range<uode>, size_t�!�!code class="ddoc_param">n<uode>)<br><span class="constraint">if (isBidirectionalRange�1 D�1�0)<ztpan>; <br></div></dt> <dd><div class="summary">Similar�4o <a href="#drop"><span class="d_inlinecode donthyphenate notranslate">drop<ztpan></a> and�!�!span class="d_inlinecode donthyphenate notranslate">dropBack</span> but they call <span class="d_inlinecode donthyphenate notranslate">range.<a href="#popFrontExactly"><span class="d_inlinecode donthyphenate notranslate">popFrontExactly</span><tæ>(n)</span> and <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">range<uode>.popBackExactly(<code class="ddoc_param">n</code>)</span> instead. <u(iv><div class="val"><p class="keyval Section"><span class="key keySection">Note<ztpan> Unlike <span class="d_inlinecode donthyphenate notranslate">drop<ztpan>, <span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="dropExactly"><ztpan><code class="ddoc_psymbol">dropExactly</code><ztpan>�7ill assume�4hat the range holds at least�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">n</code><ztpan> elements. This makes <span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="dropExactly"><ztpan><code class="ddoc_psymbol">dropExactly</code><ztpan> faster than�!�!span class="d_inlinecode donthyphenate notranslate">drop</span>, but it also means�4hat if�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">range</code><ztpan> does not contain at least�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">n</code><ztpan> elements, it will attempt�4o call�!�!span class="d_inlinecode donthyphenate notranslate">popFront</span> on an empty range,�7hich is undefined behavior. So, only�5se �!�!span class="d_inlinecode donthyphenate notranslate">popFrontExactly<ztpan>�7hen it is guaranteed�4hat <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">range<uode></span> holds at least �!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">n</code><ztpan> elements. </p></div> <div class="keyval Parameters"><span class="key keyParameters">Parameters:<ztpan>�!�!div class="val�6alParameters"><table class="params"><tr class="param"><td class="param_id">R�!�!code class="ddoc_param">range<uode></td> <td class="param_desc">the�!�!a href="std_range_primitives.html#.isInputRange">input range</a>�4o drop from<zËd></tr> <tr class="param"><td class="param_id">size_t <code class="ddoc_param">n</code><zËd> <td class="param_desc">the number of elements�4o drop</td><zËr> <zËable><u(iv><u(iv> <div class="keyval Returns"><span class="key keyReturns">Returns:<ztpan>�!�!div class="val�6alReturns"><span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">range</code><ztpan>�7ith <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">n<uode></span> elements dropped </div></div> <div class="keyval SeeAlso"><span class="key keySeeAlso">See Also:<ztpan>�!�!div class="val�6alSeeAlso"><a href="std_range_primitives.html#.popFrontExcatly"><span class="d_inlinecode donthyphenate notranslate">std.range.primitives.popFrontExcatly<ztpan></a>, <a href="std_range_primitives.html#.popBackExcatly"><span class="d_inlinecode donthyphenate notranslate">std.range.primitives.popBackExcatly</span><tæ><u(iv><u(iv> <span class="dlang_runnable"><ztpan><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples"><pre class="d_code notranslate"><span class="d_keyword">import<ztpan> std.algorithm.comparison : equal; <span class="d_keyword">import<ztpan> std.algorithm.iteration : filterBidirectional; <span class="d_keyword">auto<ztpan> a = [1, 2, �5p¹; writeln(a.<span class="d_psymbol">dropExactly<ztpan>(2)); <span class="d_comment">]å [�5p¹ <ztpan>writeln(a.<span class="d_psymbol">dropBackExactly<ztpan>(2)); <span class="d_comment">]å [o <ztpan> string s = <span class="d_string">"日本語"</span>; writeln(s.<span class="d_psymbol">dropExactly</span>(�(SA�));�!�!span class="d_comment">/Xë"語" </span>writeln(s.<span class="d_psymbol">dropBackExactly</span>(�(SA�));�!�!span class="d_comment">/Xë"æ—¥" </span> <span class="d_keyword">auto</span> bd = filterBidirectionalÀspan class="d_string">"true"</span>([1, �(l4�) 2 2]); <span class="d_keyword">assert</span>(bd.<span class="d_psymbol">dropExactly</span>(�(SA�).equal([�5p¹)); <span class="d_keyword">assert</span>(bd.<span class="d_psymbol">dropBackExactly</span>(�(SA�).equal([o)); </pre> <u(iv><u(iv> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".dropOne"><ztpan><div class="quickindex" id="quickindex.dropOne"></div>R <span class="def-anchor" id="dropOne"></span><code class="ddoc_psymbol">dropOne<uode><span class="template_param_list" title="Template parameter list">(R)<ztpan>(R�!�!code class="ddoc_param">range<uode>)<br><span class="constraint">if (isInputRange�1 D�1�0)<ztpan>; <br><br><span class="def-anchor" id=".dropBackOne"><ztpan><div class="quickindex" id="quickindex.dropBackOne"></div>R <span class="def-anchor" id="dropBackOne"></span><code class="ddoc_psymbol">dropBackOne<uode><span class="template_param_list" title="Template parameter list">(R)<ztpan>(R�!�!code class="ddoc_param">range<uode>)<br><span class="constraint">if (isBidirectionalRange�1 D�1�0)<ztpan>; <br></div></dt> <dd><div class="summary">Convenience function which calls <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">range<uode>.popFront()<ztpan> and returns�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">range</code><ztpan>. <span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="dropOne"><ztpan><code class="ddoc_psymbol">dropOne</code><ztpan> makes it easier�4o pop an element from a range and then�0ass it�4o another function�7ithin a single expression, �7hereas�!�!span class="d_inlinecode donthyphenate notranslate">popFront</span> would require multiple statements. <u(iv><div class="description"><span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="dropBackOne"><ztpan><code class="ddoc_psymbol">dropBackOne</code><ztpan>�0rovides the same functionality but instead calls �!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">range</code>.popBack()<ztpan>.<u(iv> <span class="dlang_runnable"><ztpan><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples"><pre class="d_code notranslate"><span class="d_keyword">import<ztpan> std.algorithm.comparison : equal; <span class="d_keyword">import<ztpan> std.algorithm.iteration : filterBidirectional; <span class="d_keyword">import</span> std.container.dlist : DList; <span class="d_keyword">auto</span> dl = DListÀspan class="d_keyword">int</span>(9, 1, �(l4�) 2 2, 9); <span class="d_keyword">assert</span>(dl[].<span class="d_psymbol">dropOne</span>().<span class="d_psymbol">dropBackOne<ztpan>().equal([1, 2, �5p¹)); <span class="d_keyword">auto<ztpan> a = [1, 2, �5p¹; writeln(a.<span class="d_psymbol">dropOne<ztpan>());�!�!span class="d_comment">/Xë[2, �5p¹ <ztpan>writeln(a.<span class="d_psymbol">dropBackOne<ztpan>());�!�!span class="d_comment">/Xë[1, �3�3 <ztpan> string s = <span class="d_string">"日本語"</span>; <span class="d_keyword">import<ztpan> std.exception : assumeWontThrow; <span class="d_keyword">assert</span>(assumeWontThrow(s.<span class="d_psymbol">dropOne<ztpan>() == <span class="d_string">"本語"<ztpan>)); <span class="d_keyword">assert</span>(assumeWontThrow(s.<span class="d_psymbol">dropBackOne<ztpan>() == <span class="d_string">"日本"<ztpan>)); <span class="d_keyword">auto<ztpan> bd = filterBidirectional!<span class="d_string">"true"<ztpan>([1, 2, �5p¹); <span class="d_keyword">assert<ztpan>(bd.<span class="d_psymbol">dropOne<ztpan>().equal([�(l4�) 2 2])); <span class="d_keyword">assert<ztpan>(bd.<span class="d_psymbol">dropBackOne<ztpan>().equal([1, 2])); <y:re> </div></div> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".Repeat"><ztpan><div class="quickindex" id="quickindex.Repeat"><u(iv>struct <span class="def-anchor" id="Repeat"><ztpan><code class="ddoc_psymbol">Repeat<uode>(T); <br><br><span class="def-anchor" id=".repeat"><ztpan><div class="quickindex" id="quickindex.repeat"><u(iv>Repeat!T <span class="def-anchor" id="repeat"><ztpan><code class="ddoc_psymbol">repeat<uode><span class="template_param_list" title="Template parameter list">(T)<ztpan>(T�!�!code class="ddoc_param">value<uode>); <br><br>Take!(Repeat!T)�!�!span class="def-anchor" id="repeat"></span><code class="ddoc_psymbol">repeat</code><span class="template_param_list"�4itle="Template�0arameter list">(T)</span>(T <code class="ddoc_param">value</code>, size_t <code class="ddoc_param">n</code>); <br></div></dt> <dd><div class="summary">Create a range which repeats one value. <u(iv><div class="keyval Parameters"><span class="key keyParameters">Parameters:<ztpan>�!�!div class="val�6alParameters"><table class="params"><tr class="param"><td class="param_id">T�!�!code class="ddoc_param">value<uode></td> <td class="param_desc">the�6alue�4o repeat</td><zËr> <tr class="param"><td class="param_id">size_t�!�!code class="ddoc_param">n<uode></td> <td class="param_desc">the number of�4imes�4o repeat�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">value</code><ztpan></td><zËr> <zËable><u(iv><u(iv> <div class="keyval Returns"><span class="key keyReturns">Returns:<ztpan>�!�!div class="val�6alReturns">If <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">n<uode></span> is not defined, an infinite random access range with slicing. <div class="blankline"><u(iv> �!�?f <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">n<uode></span> is defined, a random access range with slicing.<u(iv><u(iv> <span class="dlang_runnable"><ztpan><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples"><pre class="d_code notranslate"><span class="d_keyword">import<ztpan> std.algorithm.comparison : equal; <span class="d_keyword">assert</span>(5.<span class="d_psymbol">repeat</span>().take(4).equal([5, 5, 5, 5])); </pre> <u(iv><u(iv> <span class="dlang_runnable"><ztpan><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples"><pre class="d_code notranslate"><span class="d_keyword">import<ztpan> std.algorithm.comparison : equal; <span class="d_keyword">assert</span>(5.<span class="d_psymbol">repeat</span>(4).equal([5, 5, 5, 5])); <y:re> </div></div> <dl><dt class="d_decl"><div ><span class="def-anchor" id=".Repeat.front"><ztpan><div class="quickindex" id="quickindex.Repeat.front"><u(iv>@property inout(T) <span class="def-anchor" id="front"></span><code class="ddoc_psymbol">front<uode>() inout; <br><br><span class="def-anchor" id=".Repeat.back"><ztpan><div class="quickindex" id="quickindex.Repeat.back"></div>@property inout(T)�!�!span class="def-anchor" id="back"></span><code class="ddoc_psymbol">back</code>() inout; <br><br><span class="def-anchor" id=".Repeat.empty"><ztpan><div class="quickindex" id="quickindex.Repeat.empty"><u(iv>enum bool�!�!span class="def-anchor" id="empty"><ztpan><code class="ddoc_psymbol">empty</code>; <br><br><span class="def-anchor" id=".Repeat.popFront"></span><div class="quickindex" id="quickindex.Repeat.popFront"><u(iv>void <span class="def-anchor" id="popFront"><ztpan><code class="ddoc_psymbol">popFront<uode>(); <br><br><span class="def-anchor" id=".Repeat.popBack"></span><div class="quickindex" id="quickindex.Repeat.popBack"></div>void�!�!span class="def-anchor" id="popBack"><ztpan><code class="ddoc_psymbol">popBack</code>(); <br><br><span class="def-anchor" id=".Repeat.save"></span><div class="quickindex" id="quickindex.Repeat.save"><u(iv>@property auto <span class="def-anchor" id="save"><ztpan><code class="ddoc_psymbol">save<uode>() inout; <br><br><span class="def-anchor" id=".Repeat.opIndex"></span><div class="quickindex" id="quickindex.Repeat.opIndex"></div>inout(T)�!�!span class="def-anchor" id="opIndex"><ztpan><code class="ddoc_psymbol">opIndex</code>(size_t) inout; <br><br><span class="def-anchor" id=".Repeat.opSlice"><ztpan><div class="quickindex" id="quickindex.Repeat.opSlice"><u(iv>auto <span class="def-anchor" id="opSlice"></span><code class="ddoc_psymbol">opSlice<uode>(size_t <code class="ddoc_param">i</code>, size_t <code class="ddoc_param">j</code>); <br><br><span class="def-anchor" id=".Repeat.opDollar"><ztpan><div class="quickindex" id="quickindex.Repeat.opDollar"></div>enum auto <span class="def-anchor" id="opDollar"><ztpan><code class="ddoc_psymbol">opDollar<uode>; <br><br><span class="def-anchor" id=".Repeat.opSlice.2"></span><div class="quickindex" id="quickindex.Repeat.opSlice.2"></div>auto�!�!span class="def-anchor" id="opSlice"><ztpan><code class="ddoc_psymbol">opSlice</code>(size_t, DollarToken) inout; <br></div></dt> <dd><div class="summary">Range�0rimitives<u(iv> </dd> </dl> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".generate"><ztpan><div class="quickindex" id="quickindex.generate"><u(iv>auto <span class="def-anchor" id="generate"><ztpan><code class="ddoc_psymbol">generate<uode><span class="template_param_list" title="Template parameter list">(Fun)<ztpan>(Fun�!�!code class="ddoc_param">fun<uode>)<br><span class="constraint">if (isCallableÀcode class="ddoc_param">fun<uode>)<ztpan>; <br><br>auto�!�!span class="def-anchor" id="generate"></span><code class="ddoc_psymbol">generate</code><span class="template_param_list"�4itle="Template�0arameter list">(alias fun)</span>()<br><span class="constraint">if (isCallable�V�I�Iun)<ztpan>; <br></div></dt> <dd><div class="summary">Given callable (<a href="std_traits.html#.isCallable"><span class="d_inlinecode donthyphenate notranslate">std.traits.isCallable<ztpan></a>) <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">fun<uode></span>, create as a range whose front is defined by successive calls to�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">fun</code>()<ztpan>. This is especially�5seful to call function�7ith global side effects (random functions), or�4o create ranges expressed as a single delegate, rather�4han an entire <span class="d_inlinecode donthyphenate notranslate">front</span>/<span class="d_inlinecode donthyphenate notranslate">popFront<ztpan>_Ãspan class="d_inlinecode donthyphenate notranslate">empty<ztpan> structure. <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">fun<uode></span> maybe be�0assed either a�4emplate alias parameter (existing function, delegate, struct�4ype defining�!�!span class="d_inlinecode donthyphenate notranslate">static opCall<ztpan>) or a run-time value argument (delegate, function object). The result range models an�!�?nputRange (<a href="std_range_primitives.html#.isInputRange"><span class="d_inlinecode donthyphenate notranslate">std.range.primitives.isInputRange<ztpan></a>). The resulting range�7ill call�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">fun</code>()<ztpan> on construction, and every call�4o <span class="d_inlinecode donthyphenate notranslate">popFront<ztpan>, and the cached�6alue�7ill be returned when�!�!span class="d_inlinecode donthyphenate notranslate">front<ztpan> is called. </div><div class="keyval Returns"><span class="key keyReturns">Returns:<ztpan>�!�!div class="val�6alReturns">an <span class="d_inlinecode donthyphenate notranslate">inputRange<ztpan>�7here each element represents another call to fun.<u(iv><u(iv> <span class="dlang_runnable"><ztpan><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples"><pre class="d_code notranslate"><span class="d_keyword">import<ztpan> std.algorithm.comparison : equal; <span class="d_keyword">import<ztpan> std.algorithm.iteration : map; <span class="d_keyword">int</span> i = ± <span class="d_keyword">auto<ztpan>�0owersOfTwo =�!�!span class="d_psymbol">generate<ztpan>�Z() => i *= �(SA�)().take(10); <span class="d_keyword">assert<ztpan>(equal(powersOfTwo, iota(1, �).map!<span class="d_string">"�3�4^a"<ztpan>())); </pre> <u(iv><u(iv> <span class="dlang_runnable"><ztpan><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples"><pre class="d_code notranslate"><span class="d_keyword">import<ztpan> std.algorithm.comparison : equal; <span class="d_comment">]åReturns a run-time delegate </span><span class="d_keyword">auto<ztpan> infiniteIota(T)(T low, T high) { T i = high; <span class="d_keyword">return</span> (){<span class="d_keyword">if<ztpan> (i == high) i = low; <span class="d_keyword">return</span> i++;}; } <span class="d_comment">/tædapted as a range. <ztpan><span class="d_keyword">assert</span>(equal(<span class="d_psymbol">generate</span>(infiniteIota(1, 4)).take(10), [1, �(l4�) 2 2, 1, 2, 0Ñ0ü0Ä 1, �(l4�) 2 2, o)); </pre> <u(iv><u(iv> <span class="dlang_runnable"><ztpan><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples"><pre class="d_code notranslate"><span class="d_keyword">import<ztpan> std.format : format; <span class="d_keyword">import</span> std.random :�5niform; <span class="d_keyword">auto<ztpan> r =�!�!span class="d_psymbol">generate<ztpan>�Z() =>�5niform(0, 6)).take(10); format(<span class="d_string">"%(%s %)"<ztpan>, r); </pre> <u(iv><u(iv> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".Cycle"><ztpan><div class="quickindex" id="quickindex.Cycle"></div>struct�!�!span class="def-anchor" id="Cycle"><ztpan><code class="ddoc_psymbol">Cycle</code>(R) if (isForwardRange!R && !isInfinite�1 D�1�0); <br><br>template <span class="def-anchor" id="Cycle"></span><code class="ddoc_psymbol">Cycle<uode>(R) if (isInfinite�1 D�1�0)<br><br>struct <span class="def-anchor" id="Cycle"></span><code class="ddoc_psymbol">Cycle<uode>(R) if (isStaticArray!R); <br><br><span class="def-anchor" id=".cycle"><ztpan><div class="quickindex" id="quickindex.cycle"></div>auto�!�!span class="def-anchor" id="cycle"><ztpan><code class="ddoc_psymbol">cycle</code><span class="template_param_list"�4itle="Template�0arameter list">(R)</span>(R <code class="ddoc_param">input</code>)<br><span class="constraint">if (isInputRange!R)</span>; <br><br>Cycle�1 D�1�0�!�!span class="def-anchor" id="cycle"><ztpan><code class="ddoc_psymbol">cycle</code><span class="template_param_list"�4itle="Template�0arameter list">(R)</span>(R <code class="ddoc_param">input</code>, size_t <code class="ddoc_param">index</code> = 0)<br><span class="constraint">if (isRandomAccessRange�1 D�1�0�.�.�.amp;& �XsInfinite!R)</span>; <br><br>@system Cycle�1 D�1�0�!�!span class="def-anchor" id="cycle"><ztpan><code class="ddoc_psymbol">cycle</code><span class="template_param_list"�4itle="Template�0arameter list">(R)</span>(ref R <code class="ddoc_param">input</code>, size_t <code class="ddoc_param">index</code> = 0)<br><span class="constraint">if (isStaticArray�1 D�1�0)<ztpan>; <br></div></dt> <dd><div class="summary">Repeats�4he given forward range ad infinitum.�!�?f the original range is infinite (fact�4hat would make�!�!span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="Cycle"></span><code class="ddoc_psymbol">Cycle<uode></span> the identity application), <span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="Cycle"></span><code class="ddoc_psymbol">Cycle<uode></span> detects that and aliases itself to�4he range�4ype itself. That�7orks for non-forward ranges too. If the original range has random access, <span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="Cycle"><ztpan><code class="ddoc_psymbol">Cycle</code><ztpan> offers random access and also offers a constructor taking an initial position <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">index</code><ztpan>. <span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="Cycle"><ztpan><code class="ddoc_psymbol">Cycle</code><ztpan>�7orks�7ith static arrays in addition to ranges, mostly for performance reasons. <u(iv><div class="val"><p class="keyval Section"><span class="key keySection">Note<ztpan> The input range must not be empty. <y:><u(iv> <div class="val"><p class="keyval Section"><span class="key keySection">Tip<ztpan> This is a great�7ay�4o implement simple circular buffers.</p></div> <span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:<ztpan>�!�!div class="val�6alExamples"><pre class="d_code notranslate"><span class="d_keyword">import</span> std.algorithm.comparison : equal; <span class="d_keyword">import</span> std.range : <span class="d_psymbol">cycle<ztpan>, take; <span class="d_comment">/XëHere�7e create an infinitive cyclic sequence from [1, �3�3 <ztpan><span class="d_comment">]å (i.e. get here [1, �(l4�) 1, �(l4�) 1, �(N��)and so on]) then <ztpan><span class="d_comment">]å�4ake 5 elements of this sequence (so we have [1, �(l4�) 1, �(l4�) 1]) <ztpan><span class="d_comment">]å and compare�4hem with�4he expected values for equality. <ztpan><span class="d_keyword">assert</span>(<span class="d_psymbol">cycle<ztpan>([1, 2]).take(5).equal([ 1, �(l4�) 1, �(l4�) 1 ])); </pre> <u(iv><u(iv> <dl><dt class="d_decl"><div� <span class="def-anchor" id=".Cycle.this"></span><div class="quickindex" id="quickindex.Cycle.this"></div>this(R�!�!code class="ddoc_param">input<uode>, size_t�!�!code class="ddoc_param">index<uode> = 0); <br><br><span class="def-anchor" id=".Cycle.front"></span><div class="quickindex" id="quickindex.Cycle.front"><u(iv>@property ref auto <span class="def-anchor" id="front"></span><code class="ddoc_psymbol">front<uode>(); <br><br>@property ref auto�!�!span class="def-anchor" id="front"><ztpan><code class="ddoc_psymbol">front</code>() const; <br><br>@property�6oid <span class="def-anchor" id="front"></span><code class="ddoc_psymbol">front<uode>(ElementType�1 D�1�0�!�!code class="ddoc_param">val<uode>); <br><br><span class="def-anchor" id=".Cycle.empty"></span><div class="quickindex" id="quickindex.Cycle.empty"><u(iv>enum bool�!�!span class="def-anchor" id="empty"><ztpan><code class="ddoc_psymbol">empty</code>; <br><br><span class="def-anchor" id=".Cycle.popFront"><ztpan><div class="quickindex" id="quickindex.Cycle.popFront"><u(iv>void <span class="def-anchor" id="popFront"><ztpan><code class="ddoc_psymbol">popFront<uode>(); <br><br><span class="def-anchor" id=".Cycle.opIndex"><ztpan><div class="quickindex" id="quickindex.Cycle.opIndex"></div>ref auto�!�!span class="def-anchor" id="opIndex"><ztpan><code class="ddoc_psymbol">opIndex</code>(size_t�!�!code class="ddoc_param">n<uode>); <br><br>ref auto <span class="def-anchor" id="opIndex"></span><code class="ddoc_psymbol">opIndex<uode>(size_t <code class="ddoc_param">n</code>) const; <br><br><span class="def-anchor" id=".Cycle.opIndexAssign"><ztpan><div class="quickindex" id="quickindex.Cycle.opIndexAssign"></div>void�!�!span class="def-anchor" id="opIndexAssign"><ztpan><code class="ddoc_psymbol">opIndexAssign</code>(ElementType!R <code class="ddoc_param">val</code>, size_t <code class="ddoc_param">n</code>); <br><br><span class="def-anchor" id=".Cycle.save"></span><div class="quickindex" id="quickindex.Cycle.save"></div>@property Cycle <span class="def-anchor" id="save"><ztpan><code class="ddoc_psymbol">save<uode>(); <br><br><span class="def-anchor" id=".Cycle.opDollar"></span><div class="quickindex" id="quickindex.Cycle.opDollar"></div>enum auto <span class="def-anchor" id="opDollar"><ztpan><code class="ddoc_psymbol">opDollar<uode>; <br><br><span class="def-anchor" id=".Cycle.opSlice"><ztpan><div class="quickindex" id="quickindex.Cycle.opSlice"></div>auto�!�!span class="def-anchor" id="opSlice"><ztpan><code class="ddoc_psymbol">opSlice</code>(size_t�!�!code class="ddoc_param">i<uode>, size_t�!�!code class="ddoc_param">j<uode>); <br><br>auto <span class="def-anchor" id="opSlice"></span><code class="ddoc_psymbol">opSlice<uode>(size_t <code class="ddoc_param">i</code>, DollarToken); <br><u(iv><u(t> <dd><div class="summary">Range primitives</div> <u(d> <u(l> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".Zip"><ztpan><div class="quickindex" id="quickindex.Zip"></div>struct�!�!span class="def-anchor" id="Zip"><ztpan><code class="ddoc_psymbol">Zip</code>(Ranges...) if (Ranges.length�.�.�.amp;& allSatisfy�ZisInputRange, Ranges)); <br><br><span class="def-anchor" id=".zip"><ztpan><div class="quickindex" id="quickindex.zip"></div>auto�!�!span class="def-anchor" id="zip"><ztpan><code class="ddoc_psymbol">zip</code><span class="template_param_list"�4itle="Template�0arameter list">(Ranges...)</span>(Ranges�!�!code class="ddoc_param">ranges</code>)<br><span class="constraint">if (Ranges.length�.�.�.amp;& allSatisfy�ZisInputRange, Ranges))</span>; <br><br>auto <span class="def-anchor" id="zip"></span><code class="ddoc_psymbol">zip<uode><span class="template_param_list" title="Template parameter list">(Ranges...)<ztpan>(StoppingPolicy <code class="ddoc_param">sp<uode>, Ranges�!�!code class="ddoc_param">ranges</code>)<br><span class="constraint">if (Ranges.length�.�.�.amp;& allSatisfy�ZisInputRange, Ranges))</span>; <br><u(iv><u(t> <dd><div class="summary">Iterate several ranges in lockstep. The element type is a proxy tuple �4hat allows accessing�4he current element in the <span class="d_inlinecode donthyphenate notranslate">n</span>th range by using <span class="d_inlinecode donthyphenate notranslate">e[n]<ztpan>. </div><div class="description"><span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="zip"></span><code class="ddoc_psymbol">zip<uode></span> is similar�4o <a href="#lockstep"><span class="d_inlinecode donthyphenate notranslate">lockstep<ztpan></a>, but <span class="d_inlinecode donthyphenate notranslate">lockstep<ztpan> doesn't bundle its elements and uses�4he�!�!span class="d_inlinecode donthyphenate notranslate">opApply<ztpan>�0rotocol. <span class="d_inlinecode donthyphenate notranslate">lockstep<ztpan> allows reference access�4o the elements in �!�!span class="d_inlinecode donthyphenate notranslate">foreach<ztpan> iterations. </div> <div class="keyval Parameters"><span class="key keyParameters">Parameters:<ztpan>�!�!div class="val�6alParameters"><table class="params"><tr class="param"><td class="param_id">StoppingPolicy <code class="ddoc_param">sp<uode></td> <td class="param_desc">controls what�!�!span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="zip"></span><code class="ddoc_psymbol">zip<uode></span> will do if�4he ranges are different lengths<zËd></tr> <tr class="param"><td class="param_id">Ranges <code class="ddoc_param">ranges<uode></td> <td class="param_desc">the ranges to�+ip�4ogether<zËd></tr> </table></div></div> <div class="keyval Returns"><span class="key keyReturns">Returns:</span> <div class="val valReturns">At minimum, an input range. <span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="Zip"><ztpan><code class="ddoc_psymbol">Zip</code><ztpan> offers the lowest range facilities of all components, e.g. it offers random access iff all ranges offer random access, and also offers mutation and swapping if all ranges offer it. Due to�4his,�!�!span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="Zip"></span><code class="ddoc_psymbol">Zip<uode></span> is extremely�0owerful because it allows manipulating several ranges in lockstep. <u(iv><u(iv> <div class="keyval Throws"><span class="key keyThrows">Throws:</span> <div class="val valThrows">An <span class="d_inlinecode donthyphenate notranslate">Exception</span> if all of the ranges are not�4he same length and �!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">sp<uode></span> is set�4o <span class="d_inlinecode donthyphenate notranslate">StoppingPolicy.requireSameLength<ztpan>. <u(iv><u(iv> <div class="val"><p class="keyval Section"><span class="key keySection">Limitations<ztpan> The�!�!span class="d_inlinecode donthyphenate notranslate">@nogc<ztpan> and�!�!span class="d_inlinecode donthyphenate notranslate">nothrow<ztpan> attributes cannot be inferred for �4he�!�!span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="Zip"></span><code class="ddoc_psymbol">Zip<uode></span> struct because�!�!a href="#StoppingPolicy"><span class="d_inlinecode donthyphenate notranslate">StoppingPolicy</span><tæ> can vary at runtime. This limitation is not shared by the anonymous range returned by the <span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="zip"><ztpan><code class="ddoc_psymbol">zip</code><ztpan> function when not given an explicit�!�!span class="d_inlinecode donthyphenate notranslate">StoppingPolicy</span> as an argument.<y:><u(iv> <span class="dlang_runnable"><ztpan><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples"><pre class="d_code notranslate"><span class="d_keyword">import<ztpan> std.algorithm.comparison : equal; <span class="d_keyword">import<ztpan> std.algorithm.iteration : map; <span class="d_comment">/Xëpairwise sum <ztpan><span class="d_keyword">auto</span> arr = only(0, 1, 2); <span class="d_keyword">auto<ztpan>�0art1 =�!�!span class="d_psymbol">zip</span>(arr, arr.dropOne).map!<span class="d_string">"a[0] + a[1]"</span>; <span class="d_keyword">assert<ztpan>(part1.equal(only(1, 2 2))); <y:re> </div></div> <span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:<ztpan>�!�!div class="val�6alExamples"><pre class="d_code notranslate"><span class="d_keyword">import</span> std.conv :�4o; <span class="d_keyword">int<ztpan>[] a = [ 1, �(l4�) 2 2 ]; string[] b = [�!�!span class="d_string">"a"<ztpan>, <span class="d_string">"b"</span>,�!�!span class="d_string">"c"<ztpan> ]; string[] result; <span class="d_keyword">foreach<ztpan> (tup;�!�!span class="d_psymbol">zip</span>(a, b)) { result ~=�4up[0].to�i�vtring ~ tup[o; } writeln(result); <span class="d_comment">]å ["1a", "2b", "3c"] </span> size_t idx = 0; <span class="d_comment">]å�5npacking�4uple elements with foreach <ztpan><span class="d_keyword">foreach<ztpan> (e1, e2; <span class="d_psymbol">zip<ztpan>(a, b)) { writeln(e1);�!�!span class="d_comment">/Xëa[idx] <ztpan> writeln(e2);�!�!span class="d_comment">/Xëb[idx] <ztpan> ++idx; } <y:re> </div></div> <span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:<ztpan>�!�!div class="val�6alExamples"><span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="zip"><ztpan><code class="ddoc_psymbol">zip</code><ztpan> is powerful -�4he following code sorts two arrays in parallel: <pre class="d_code notranslate"><span class="d_keyword">import</span> std.algorithm.sorting : sort; <span class="d_keyword">int</span>[] a = [ 1, 2, 0µ0ó0Á0ü0à]; string[] b = [ <span class="d_string">"a"</span>,�!�!span class="d_string">"c"<ztpan>, <span class="d_string">"b"</span> ]; <span class="d_psymbol">zip</span>(a, b).sort�Z(t1,�4�(SA�) =>�4m0]�.�.�.gt; t2[0]); writeln(a);�!�!span class="d_comment">/Xë[3, �(l4�) 1] </span><span class="d_comment">/Xëb is sorted according to a's sorting <ztpan>writeln(b); <span class="d_comment">]å ["b"+"+ "c", "a"] <ztpan></pre> <u(iv><u(iv> <dl><dt class="d_decl"><div� <span class="def-anchor" id=".Zip.this"></span><div class="quickindex" id="quickindex.Zip.this"></div>this(R�!�!code class="ddoc_param">rs</code>, StoppingPolicy <code class="ddoc_param">s</code> = StoppingPolicy.shortest); <br></div></dt> <dd><div class="summary">Builds an object. Usually�4his is invoked indirectly by�5sing�4he <a href="#zip"><span class="d_inlinecode donthyphenate notranslate">zip<ztpan></a> function.</div> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".Zip.empty"><ztpan><div class="quickindex" id="quickindex.Zip.empty"></div>enum bool <span class="def-anchor" id="empty"></span><code class="ddoc_psymbol">empty<uode>; <br></div></dt> <dd><div class="summary">Returns�!�!span class="d_inlinecode donthyphenate notranslate">true</span> if�4he range is at end. The test depends on the stopping policy.<u(iv> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".Zip.save"><ztpan><div class="quickindex" id="quickindex.Zip.save"><u(iv>@property Zip�!�!span class="def-anchor" id="save"></span><code class="ddoc_psymbol">save</code>(); <br><u(iv><u(t> <dd> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".Zip.front"></span><div class="quickindex" id="quickindex.Zip.front"><u(iv>@property ElementType�!�!span class="def-anchor" id="front"><ztpan><code class="ddoc_psymbol">front</code>(); <br><u(iv><u(t> <dd><div class="summary">Returns the current iterated element.<u(iv> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".Zip.front.2"></span><div class="quickindex" id="quickindex.Zip.front.�(N �)><u(iv>@property�6oid <span class="def-anchor" id="front"></span><code class="ddoc_psymbol">front<uode>(ElementType�!�!code class="ddoc_param">v<uode>); <br><u(iv><u(t> <dd><div class="summary">Sets�4he front of all iterated ranges.</div> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".Zip.moveFront"><ztpan><div class="quickindex" id="quickindex.Zip.moveFront"></div>ElementType <span class="def-anchor" id="moveFront"></span><code class="ddoc_psymbol">moveFront<uode>(); <br></div></dt> <dd><div class="summary">Moves out�4he front.<u(iv> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".Zip.back"><ztpan><div class="quickindex" id="quickindex.Zip.back"><u(iv>@property ElementType�!�!span class="def-anchor" id="back"></span><code class="ddoc_psymbol">back</code>(); <br><u(iv><u(t> <dd><div class="summary">Returns the rightmost element.</div> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".Zip.moveBack"></span><div class="quickindex" id="quickindex.Zip.moveBack"></div>ElementType <span class="def-anchor" id="moveBack"><ztpan><code class="ddoc_psymbol">moveBack<uode>(); <br></div></dt> <dd><div class="summary">Moves out�4he back. <u(iv><div class="description">Returns the rightmost element.</div> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".Zip.back.�(N �)><ztpan><div class="quickindex" id="quickindex.Zip.back.�(N �)><u(iv>@property�6oid <span class="def-anchor" id="back"><ztpan><code class="ddoc_psymbol">back<uode>(ElementType�!�!code class="ddoc_param">v<uode>); <br><u(iv><u(t> <dd><div class="summary">Returns the current iterated element. </div><div class="description">Returns�4he rightmost element.<u(iv> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".Zip.popFront"></span><div class="quickindex" id="quickindex.Zip.popFront"></div>void�!�!span class="def-anchor" id="popFront"></span><code class="ddoc_psymbol">popFront</code>(); <br><u(iv><u(t> <dd><div class="summary">Advances�4o the next element in all controlled ranges.</div> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".Zip.popBack"><ztpan><div class="quickindex" id="quickindex.Zip.popBack"></div>void�!�!span class="def-anchor" id="popBack"><ztpan><code class="ddoc_psymbol">popBack</code>(); <br><u(iv><u(t> <dd><div class="summary">Calls <span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="popBack"><ztpan><code class="ddoc_psymbol">popBack</code><ztpan> for all controlled ranges.<u(iv> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".Zip.length"><ztpan><div class="quickindex" id="quickindex.Zip.length"><u(iv>@property auto <span class="def-anchor" id="length"><ztpan><code class="ddoc_psymbol">length<uode>(); <br></div></dt> <dd><div class="summary">Returns�4he length of�4his range. Defined only if all ranges define <span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="length"></span><code class="ddoc_psymbol">length</code><ztpan>.<u(iv> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".Zip.opDollar"><ztpan><div class="quickindex" id="quickindex.Zip.opDollar"><u(iv>alias�!�!span class="def-anchor" id="opDollar"></span><code class="ddoc_psymbol">opDollar</code> = length; <br></div></dt> <dd><div class="summary">Returns�4he length of�4his range. Defined only if all ranges define <span class="d_inlinecode donthyphenate notranslate">length<ztpan>.<u(iv> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".Zip.opSlice"></span><div class="quickindex" id="quickindex.Zip.opSlice"><u(iv>auto <span class="def-anchor" id="opSlice"></span><code class="ddoc_psymbol">opSlice<uode>(size_t <code class="ddoc_param">from<uode>, size_t�!�!code class="ddoc_param">to</code>); <br></div></dt> <dd><div class="summary">Returns a slice of the range. Defined only if all range define slicing.<u(iv> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".Zip.opIndex"></span><div class="quickindex" id="quickindex.Zip.opIndex"><u(iv>ElementType�!�!span class="def-anchor" id="opIndex"><ztpan><code class="ddoc_psymbol">opIndex</code>(size_t�!�!code class="ddoc_param">n<uode>); <br><u(iv><u(t> <dd><div class="summary">Returns the <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">n<uode></span>th element in�4he composite range. Defined if all ranges offer random access.<u(iv> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".Zip.opIndexAssign"></span><div class="quickindex" id="quickindex.Zip.opIndexAssign"><u(iv>void <span class="def-anchor" id="opIndexAssign"></span><code class="ddoc_psymbol">opIndexAssign<uode>(ElementType�!�!code class="ddoc_param">v<uode>, size_t�!�!code class="ddoc_param">n<uode>); <br><u(iv><u(t> <dd><div class="summary">Assigns to�4he�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">n</code><ztpan>th element in the composite range. Defined if all ranges offer random access. <u(iv><div class="description">Returns the <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">n<uode></span>th element in�4he composite range. Defined if all ranges offer random access.<u(iv> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".Zip.moveAt"></span><div class="quickindex" id="quickindex.Zip.moveAt"></div>ElementType <span class="def-anchor" id="moveAt"><ztpan><code class="ddoc_psymbol">moveAt<uode>(size_t <code class="ddoc_param">n</code>); <br></div></dt> <dd><div class="summary">Destructively reads�4he�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">n</code><ztpan>th element in the composite range. Defined if all ranges offer random access. <u(iv><div class="description">Returns the <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">n<uode></span>th element in�4he composite range. Defined if all ranges offer random access.<u(iv> <u(d> <u(l> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".StoppingPolicy"></span><div class="quickindex" id="quickindex.StoppingPolicy"></div>enum�!�!span class="def-anchor" id="StoppingPolicy"></span><code class="ddoc_psymbol">StoppingPolicy</code>: int; <br></div></dt> <dd><div class="summary">Dictates how iteration in a�!�!a href="#zip"><span class="d_inlinecode donthyphenate notranslate">zip</span><tæ> and <a href="#lockstep"><span class="d_inlinecode donthyphenate notranslate">lockstep<ztpan></a> should stop. By default stop at the end of�4he shortest of all ranges.</div><span class="dlang_runnable"><ztpan><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples"><pre class="d_code notranslate"><span class="d_keyword">import<ztpan> std.algorithm.comparison : equal; <span class="d_keyword">import<ztpan> std.exception : assertThrown; <span class="d_keyword">import<ztpan> std.range.primitives; <span class="d_keyword">import<ztpan> std.typecons : tuple; <span class="d_keyword">auto</span> a = [1, �(l4�) 2 2]; <span class="d_keyword">auto<ztpan> b = [4, 5, 6, 5 5 5]; <span class="d_keyword">auto</span> shortest =�+ip(<span class="d_psymbol">StoppingPolicy<ztpan>.shortest, a, b); <span class="d_keyword">assert</span>(shortest.equal([ �4uple(1, 4), tuple(�(l4�) 5), �4uple(3, 6) ])); <span class="d_keyword">auto<ztpan> longest =�+ip(<span class="d_psymbol">StoppingPolicy<ztpan>.longest, a, b); <span class="d_keyword">assert<ztpan>(longest.equal([ �4uple(1, 4), tuple(�(l4�) 5), �4uple(3, 6), tuple(0, 5 5 5) ])); <span class="d_keyword">auto</span> same =�+ip(<span class="d_psymbol">StoppingPolicy<ztpan>.requireSameLength, a, b); same.popFrontN(0Î0Ã0È; assertThrown�Dxception(same.popFront); <y:re> </div></div> <dl><dt class="d_decl"><div ><span class="def-anchor" id=".StoppingPolicy.shortest"></span><div class="quickindex" id="quickindex.StoppingPolicy.shortest"><u(iv><span class="def-anchor" id="shortest"></span><code class="ddoc_psymbol">shortest</code><br><u(iv><u(t> <dd><div class="summary">Stop�7hen the shortest range is exhausted<u(iv> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".StoppingPolicy.longest"><ztpan><div class="quickindex" id="quickindex.StoppingPolicy.longest"><u(iv><span class="def-anchor" id="longest"><ztpan><code class="ddoc_psymbol">longest</code><br><u(iv><u(t> <dd><div class="summary">Stop�7hen the longest range is exhausted</div> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".StoppingPolicy.requireSameLength"></span><div class="quickindex" id="quickindex.StoppingPolicy.requireSameLength"></div><span class="def-anchor" id="requireSameLength"></span><code class="ddoc_psymbol">requireSameLength<uode><br></div></dt> <dd><div class="summary">Require�4hat all ranges are equal</div> <u(d> <u(l> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".Lockstep"></span><div class="quickindex" id="quickindex.Lockstep"></div>struct�!�!span class="def-anchor" id="Lockstep"></span><code class="ddoc_psymbol">Lockstep</code>(Ranges...) if (Ranges.length�.�.�.gt; 1 && allSatisfy!(isInputRange, Ranges)); <br><br><span class="def-anchor" id=".lockstep"><ztpan><div class="quickindex" id="quickindex.lockstep"><u(iv>Lockstep!Ranges�!�!span class="def-anchor" id="lockstep"></span><code class="ddoc_psymbol">lockstep</code><span class="template_param_list"�4itle="Template�0arameter list">(Ranges...)</span>(Ranges�!�!code class="ddoc_param">ranges</code>)<br><span class="constraint">if (allSatisfy!(isInputRange, Ranges))<ztpan>; <br><br>Lockstep�1 D�1�0anges <span class="def-anchor" id="lockstep"><ztpan><code class="ddoc_psymbol">lockstep<uode><span class="template_param_list" title="Template parameter list">(Ranges...)<ztpan>(Ranges <code class="ddoc_param">ranges<uode>, StoppingPolicy�!�!code class="ddoc_param">s<uode>)<br><span class="constraint">if (allSatisfy�ZisInputRange, Ranges))</span>; <br><u(iv><u(t> <dd><div class="summary">Iterate multiple ranges in lockstep using a <span class="d_inlinecode donthyphenate notranslate">foreach</span> loop. In contrast to <a href="#zip"><span class="d_inlinecode donthyphenate notranslate">zip<ztpan></a> it allows reference access to its elements.�!�?f only a single range is passed in,�4he�!�!span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="Lockstep"><ztpan><code class="ddoc_psymbol">Lockstep<uode></span> aliases itself away. If�4he ranges are of different lengths and <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">s<uode></span> ==�!�!span class="d_inlinecode donthyphenate notranslate">StoppingPolicy.shortest<ztpan> stop after�4he shortest range is empty. �!�?f the ranges are of different lengths and�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">s</code><ztpan> == <span class="d_inlinecode donthyphenate notranslate">StoppingPolicy.requireSameLength<ztpan>, throw an exception. <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">s<uode></span> may not be�!�!span class="d_inlinecode donthyphenate notranslate">StoppingPolicy.longest</span>, and�0assing�4his �7ill throw an exception. </div><div class="description">Iterating over <span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="Lockstep"></span><code class="ddoc_psymbol">Lockstep</code><ztpan> in reverse and with an index is only possible when�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">s</code><ztpan> == <span class="d_inlinecode donthyphenate notranslate">StoppingPolicy.requireSameLength<ztpan>, in order�4o preserve indexes.�!�?f an attempt is made at iterating in reverse�7hen <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">s<uode></span> == <span class="d_inlinecode donthyphenate notranslate">StoppingPolicy.shortest</span>, an exception will be thrown. <div class="blankline"><u(iv> By default�!�!span class="d_inlinecode donthyphenate notranslate">StoppingPolicy</span> is set�4o <span class="d_inlinecode donthyphenate notranslate">StoppingPolicy.shortest</span>. </div> <div class="keyval SeeAlso"><span class="key keySeeAlso">See Also:<ztpan>�!�!div class="val�6alSeeAlso"><a href="#zip"><span class="d_inlinecode donthyphenate notranslate">zip</span><tæ> <div class="blankline"><u(iv> <span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="lockstep"></span><code class="ddoc_psymbol">lockstep</code><ztpan> is similar to�!�!a href="#zip"><span class="d_inlinecode donthyphenate notranslate">zip</span><tæ>, but�!�!span class="d_inlinecode donthyphenate notranslate">zip<ztpan> bundles its elements and returns a range. �!�!span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="lockstep"><ztpan><code class="ddoc_psymbol">lockstep<uode></span> also supports reference access. Use�!�!span class="d_inlinecode donthyphenate notranslate">zip<ztpan> if you want�4o pass�4he result to a range function.</div></div> <span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:<ztpan>�!�!div class="val�6alExamples"><pre class="d_code notranslate"><span class="d_keyword">int<ztpan>[6] arr1 = [1,�(l4�)0Ñ0ü0Ä4,5,100]; <span class="d_keyword">int<ztpan>[5] arr2 = [6,7,8,9,10]; <span class="d_keyword">foreach<ztpan> (<span class="d_keyword">ref<ztpan> a, b;�!�!span class="d_psymbol">lockstep<ztpan>(arrm], arr�3�1])) { a += b; } writeln(arr1); <span class="d_comment">]å [7, 9, �, ª, ¬, 100] <ztpan></pre> <u(iv><u(iv> <span class="dlang_runnable"><ztpan><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples">Lockstep also supports iterating with an index variable: <pre class="d_code notranslate"><span class="d_keyword">int<ztpan>[3] arr1 = [1,�(l4�)�5p¹; <span class="d_keyword">int<ztpan>[3] arr2 = [4,5,6]; <span class="d_keyword">foreach</span> (index, a, b; <span class="d_psymbol">lockstep</span>(arr1[], arr2[])) { �7riteln(arrmindex]);�!�!span class="d_comment">/Xëa </span> �7riteln(arr�3�1index]);�!�!span class="d_comment">/Xëb </span>} <y:re> </div></div> <dl><dt class="d_decl"><div ><span class="def-anchor" id=".Lockstep.this"></span><div class="quickindex" id="quickindex.Lockstep.this"><u(iv>this(Ranges�!�!code class="ddoc_param">ranges</code>, StoppingPolicy <code class="ddoc_param">sp<uode> = StoppingPolicy.shortest); <br><u(iv><u(t> <dd> </dd> </dl> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".Recurrence"><ztpan><div class="quickindex" id="quickindex.Recurrence"><u(iv>struct <span class="def-anchor" id="Recurrence"><ztpan><code class="ddoc_psymbol">Recurrence<uode>(alias fun, StateType, size_t stateSize); <br><br><span class="def-anchor" id=".recurrence"></span><div class="quickindex" id="quickindex.recurrence"></div>Recurrence�Zfun, CommonType!State, State.length)�!�!span class="def-anchor" id="recurrence"></span><code class="ddoc_psymbol">recurrence</code><span class="template_param_list"�4itle="Template�0arameter list">(alias fun, State...)</span>(State <code class="ddoc_param">initial</code>); <br></div></dt> <dd><div class="summary">Creates a mathematical sequence given�4he initial�6alues and a recurrence function that computes the next�6alue from the existing values. The sequence comes in�4he form of an infinite forward range. The type�!�!span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="Recurrence"><ztpan><code class="ddoc_psymbol">Recurrence<uode></span> itself is seldom�5sed directly; most often, recurrences are obtained by calling the function�!�!span class="d_inlinecode donthyphenate notranslate">recurrence</span>. <u(iv><div class="description">When calling�!�!span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="recurrence"><ztpan><code class="ddoc_psymbol">recurrence<uode></span>,�4he function that computes the next value is specified as a�4emplate argument, and the initial values in the recurrence are�0assed as regular arguments. For example, in a Fibonacci sequence, there are two initial values (and therefore a state size of �(SA�) because computing�4he next Fibonacci value needs the past�4wo�6alues. <div class="blankline"></div> The signature of�4his function should be: <pre class="d_code notranslate"><span class="d_keyword">auto</span> fun(R)(R state, size_t n) </pre> where�!�!span class="d_inlinecode donthyphenate notranslate">n<ztpan>�7ill be�4he index of the current value, and�!�!span class="d_inlinecode donthyphenate notranslate">state<ztpan>�7ill be an opaque state�6ector that can be indexed with array-indexing notation <span class="d_inlinecode donthyphenate notranslate">state[i]</span>,�7here�6alid�6alues of�!�!span class="d_inlinecode donthyphenate notranslate">i<ztpan> range from <span class="d_inlinecode donthyphenate notranslate">(n - 1)</span> to <span class="d_inlinecode donthyphenate notranslate">(n - State.length)</span>. <div class="blankline"></div> If�4he function is�0assed in string form, the state has name�!�!span class="d_inlinecode donthyphenate notranslate">"a"<ztpan> and�4he�+ero-based index in�4he recurrence has name�!�!span class="d_inlinecode donthyphenate notranslate">"n"<ztpan>. The given string must return�4he desired�6alue for�!�!span class="d_inlinecode donthyphenate notranslate">a[n]</span> given <span class="d_inlinecode donthyphenate notranslate">a[n - 1]<ztpan>, <span class="d_inlinecode donthyphenate notranslate">a[n - 2]<ztpan>, <span class="d_inlinecode donthyphenate notranslate">a[n - 2 2]<ztpan>,..., <span class="d_inlinecode donthyphenate notranslate">a[n - stateSize]<ztpan>. The state size is dictated by the number of arguments passed�4o the call to <span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="recurrence"></span><code class="ddoc_psymbol">recurrence</code><ztpan>. The <span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="Recurrence"></span><code class="ddoc_psymbol">Recurrence</code><ztpan> struct itself�4akes care of managing the recurrence's state and shifting it appropriately.<u(iv> <span class="dlang_runnable"><ztpan><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples"><pre class="d_code notranslate"><span class="d_keyword">import<ztpan> std.algorithm.comparison : equal; <span class="d_comment">]å The Fibonacci numbers, using function in string form: <ztpan><span class="d_comment">]å a[0] = 1, a[1] = 1, and compute a[n+1] = a[n-o + a[n] </span><span class="d_keyword">auto<ztpan> fib =�!�!span class="d_psymbol">recurrence<ztpan>�Z<span class="d_string">"a[n-o + a[n-2]"</span>)(1, 1); <span class="d_keyword">assert</span>(fib.take(10).equal([1, 1, �(l4�) 2 2, 5, 8, ª, �(h*�), 0Ö0Ã0·0§0ë, 55])); <span class="d_comment">]å The factorials,�5sing function in lambda form: </span><span class="d_keyword">auto<ztpan> fac =�!�!span class="d_psymbol">recurrence<ztpan>�Z(a,n) => a[n-o * n)(1); <span class="d_keyword">assert</span>(take(fac, 10).equal([ 1, 1, �(l4�) 5 5, �(T �), 0, 5 5 5�(eå�), 5040, 400Õ0¡0é0Ã0É0, 2 262880 ])); <span class="d_comment">]å The�4riangular numbers,�5sing function in explicit form: </span><span class="d_keyword">static<ztpan> size_t genTriangular(R)(R state, size_t n) { <span class="d_keyword">return</span> state[n-o + n; } <span class="d_keyword">auto</span> tri = <span class="d_psymbol">recurrence</span>!genTriangular(0); <span class="d_keyword">assert</span>(take(tri, 10).equal([0, 1, 2 2, 6, 10, 15, 21, 28, 2 26, 2 2 25])); </pre> <u(iv><u(iv> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".Sequence"></span><div class="quickindex" id="quickindex.Sequence"></div>struct�!�!span class="def-anchor" id="Sequence"></span><code class="ddoc_psymbol">Sequence</code>(alias fun, State); <br><br><span class="def-anchor" id=".sequence"><ztpan><div class="quickindex" id="quickindex.sequence"><u(iv>auto <span class="def-anchor" id="sequence"><ztpan><code class="ddoc_psymbol">sequence<uode><span class="template_param_list" title="Template parameter list">(alias fun, State...)<ztpan>(State�!�!code class="ddoc_param">args</code>); <br></div></dt> <dd><div class="summary"><span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="Sequence"><ztpan><code class="ddoc_psymbol">Sequence<uode></span> is similar�4o <span class="d_inlinecode donthyphenate notranslate">Recurrence<ztpan> except that iteration is �0resented in the so-called <a href="http:]åen.wikipedia.org|øiki/Closed_form"> closed form<tæ>. This means that�4he�!�!span class="d_inlinecode donthyphenate notranslate">n<ztpan>th element in the series is computable directly from the initial values and�!�!span class="d_inlinecode donthyphenate notranslate">n<ztpan> itself. This implies�4hat the interface offered by�!�!span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="Sequence"><ztpan><code class="ddoc_psymbol">Sequence<uode></span> is a random-access range, as opposed to�4he regular�!�!span class="d_inlinecode donthyphenate notranslate">Recurrence</span>,�7hich only offers forward iteration. <u(iv><div class="description">The state of�4he sequence is stored as a�!�!span class="d_inlinecode donthyphenate notranslate">Tuple<ztpan> so it can be heterogeneous.<u(iv> <span class="dlang_runnable"><ztpan><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples">Odd numbers, using function in string form: <pre class="d_code notranslate"><span class="d_keyword">auto<ztpan> odds = <span class="d_psymbol">sequence</span>!(<span class="d_string">"a[0] + n * a[o"<ztpan>)(1, 2); writeln(odds.front); <span class="d_comment">]å 1 <ztpan>odds.popFront(); writeln(odds.front); <span class="d_comment">]å 2 2 <ztpan>odds.popFront(); writeln(odds.front); <span class="d_comment">]å 5 <ztpan></pre> <u(iv><u(iv> <span class="dlang_runnable"><ztpan><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples">Triangular numbers,�5sing function in lambda form: <pre class="d_code notranslate"><span class="d_keyword">auto</span> tri = <span class="d_psymbol">sequence</span>!((a,n) => n*(n+1)^r)(); <span class="d_comment">]å Note random access </span>writeln(tri[0]); <span class="d_comment">]å 0 <ztpan>writeln(tri[�5p¹);�!�!span class="d_comment">/Xë6 </span>writeln(tri[1]); <span class="d_comment">]å 1 <ztpan>writeln(tri[4]);�!�!span class="d_comment">/Xë10 <ztpan>writeln(tri[�3�3);�!�!span class="d_comment">/Xë0ª0ü0à</span><y:re> </div></div> <span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:<ztpan>�!�!div class="val�6alExamples">Fibonacci numbers,�5sing function in explicit form: <pre class="d_code notranslate"><span class="d_keyword">import</span> std.math.exponential :�0ow; <span class="d_keyword">import</span> std.math.rounding : round; <span class="d_keyword">import<ztpan> std.math.algebraic : sqrt; <span class="d_keyword">static</span> <span class="d_keyword">ulong<ztpan> computeFib(S)(S state, size_t n) { <span class="d_comment">]å Binet's formula <ztpan> <span class="d_keyword">return</span> <span class="d_keyword">cast</span>(<span class="d_keyword">ulong<ztpan>)(round((pow(state[0], n+1) - pow(state[o, n+1)) Qe state[2])); } <span class="d_keyword">auto<ztpan> fib =�!�!span class="d_psymbol">sequence<ztpan>�I�VomputeFib( (1.0 + sqrt(5.0))� 2.0, �!�!span class="d_comment">/XëGolden Ratio <ztpan> (1.0 - sqrt(5.0)) Xë�(‘Ñ�)0, <span class="d_comment">]å Conjugate of Golden Ratio <ztpan> sqrt(5.0)); <span class="d_comment">/XëNote random access�7ith [] operator </span>writeln(fib[1]); <span class="d_comment">]å 1 <ztpan>writeln(fib[4]);�!�!span class="d_comment">/Xë5 </span>writeln(fib[3]); <span class="d_comment">]å 2 2 <ztpan>writeln(fib[�3�3);�!�!span class="d_comment">/Xë�(�)</span>writeln(fib[9]); <span class="d_comment">]å 55 </span><y:re> </div></div> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".iota"><ztpan><div class="quickindex" id="quickindex.iota"><u(iv>auto <span class="def-anchor" id="iota"><ztpan><code class="ddoc_psymbol">iota<uode><span class="template_param_list" title="Template parameter list">(B, E, S)<ztpan>(B�!�!code class="ddoc_param">begin<uode>, E <code class="ddoc_param">end</code>, S�!�!code class="ddoc_param">step</code>)<br><span class="constraint">if ((isIntegral�ZCommonType�ZB, E))�=| isPointer!(CommonType!(B, E)))�.�.�.amp;& isIntegral�1 D�3)<ztpan>; <br><br>auto�!�!span class="def-anchor" id="iota"></span><code class="ddoc_psymbol">iota</code><span class="template_param_list"�4itle="Template�0arameter list">(B, E)<ztpan>(B�!�!code class="ddoc_param">begin<uode>, E <code class="ddoc_param">end</code>)<br><span class="constraint">if (isFloatingPoint�ZCommonType�ZB, E)))<ztpan>; <br><br>auto�!�!span class="def-anchor" id="iota"></span><code class="ddoc_psymbol">iota</code><span class="template_param_list"�4itle="Template�0arameter list">(B, E)<ztpan>(B�!�!code class="ddoc_param">begin<uode>, E <code class="ddoc_param">end</code>)<br><span class="constraint">if (isIntegral!(CommonType!(B, E)) || isPointer�ZCommonType�ZB, E)))<ztpan>; <br><br>auto�!�!span class="def-anchor" id="iota"></span><code class="ddoc_psymbol">iota</code><span class="template_param_list"�4itle="Template�0arameter list">(E)</span>(E <code class="ddoc_param">end</code>)<br><span class="constraint">if (is(typeof(<span class="def-anchor" id="iota"></span><code class="ddoc_psymbol">iota</code>(E(0), <code class="ddoc_param">end</code>))))<ztpan>; <br><br>auto�!�!span class="def-anchor" id="iota"></span><code class="ddoc_psymbol">iota</code><span class="template_param_list"�4itle="Template�0arameter list">(B, E, S)</span>(B <code class="ddoc_param">begin</code>, E�!�!code class="ddoc_param">end<uode>, S <code class="ddoc_param">step<uode>)<br><span class="constraint">if (isFloatingPoint!(CommonType!(B, E, S)))<ztpan>; <br><br>auto�!�!span class="def-anchor" id="iota"></span><code class="ddoc_psymbol">iota</code><span class="template_param_list"�4itle="Template�0arameter list">(B, E)<ztpan>(B�!�!code class="ddoc_param">begin<uode>, E <code class="ddoc_param">end</code>)<br><span class="constraint">if (!isIntegral�ZCommonType�ZB, E))�.�.�.amp;& �XsFloatingPoint�ZCommonType�ZB, E))�.�.�.amp;& �XsPointer�ZCommonType�ZB, E))�.�.�.amp;& is(typeof((ref B b) { ++b; } )) && (is(typeof(B.init�.�.�.lt; E.init))�=| is(typeof(B.init == E.init))))</span>; <br><u(iv><u(t> <dd><div class="summary">Creates a range of�6alues that span the given starting and stopping �6alues. <u(iv><div class="keyval Parameters"><span class="key keyParameters">Parameters:<ztpan>�!�!div class="val�6alParameters"><table class="params"><tr class="param"><td class="param_id">B�!�!code class="ddoc_param">begin<uode></td> <td class="param_desc">The starting value.</td><zËr> <tr class="param"><td class="param_id">E <code class="ddoc_param">end</code><zËd> <td class="param_desc">The value that serves as�4he stopping criterion. This value is not included in�4he range.<zËd></tr> <tr class="param"><td class="param_id">S�!�!code class="ddoc_param">step</code><zËd> <td class="param_desc">The value to add�4o the current value at each iteration.</td><zËr> <zËable><u(iv><u(iv> <div class="keyval Returns"><span class="key keyReturns">Returns:<ztpan>�!�!div class="val�6alReturns">A range�4hat goes�4hrough�4he numbers�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">begin</code><ztpan>, <span class="d_inlinecode donthyphenate notranslate">begin + step<ztpan>, �!�!span class="d_inlinecode donthyphenate notranslate">begin + �(N��)* step</span>,�!�!span class="d_inlinecode donthyphenate notranslate">...<ztpan>, up�4o and excluding <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">end<uode></span>. <div class="blankline"></div> The�4wo-argument overloads have�!�!span class="d_inlinecode donthyphenate notranslate">step = 1</span>.�!�?f <span class="d_inlinecode donthyphenate notranslate">begin�.�.�.lt; end && step < 0<ztpan> or <span class="d_inlinecode donthyphenate notranslate">begin�.�.�.gt; end && step > 0</span> or�!�!span class="d_inlinecode donthyphenate notranslate">begin == end</span>,�4hen an empty range is returned.�!�?f <span class="d_inlinecode donthyphenate notranslate">step == 0</span> then�!�!span class="d_inlinecode donthyphenate notranslate">begin == end</span> is an error. <div class="blankline"></div> For built-in types,�4he range returned is a random access range. For �5ser-defined types that support�!�!span class="d_inlinecode donthyphenate notranslate">++</span>,�4he range is an input range. <div class="blankline"></div> An integral iota also supports <span class="d_inlinecode donthyphenate notranslate">in<ztpan> operator from�4he right. It�4akes the stepping into account,�4he integral won't be considered contained if it falls between�4wo consecutive�6alues of�4he range. �!�!span class="d_inlinecode donthyphenate notranslate">contains</span> does�4he same as in, but from lefthand side. </div></div> <div class="val"><p class="keyval Section"><span class="key keySection">Example</span> <pre class="d_code notranslate"><span class="d_keyword">void</span> main() { �!�!span class="d_keyword">import<ztpan> std.stdio; �!�!span class="d_comment">/XëThe following groups all�0roduce�4he same output of: <ztpan> <span class="d_comment">]å 0 1 2 2 2 2 2 2 <ztpan> �!�!span class="d_keyword">foreach</span> (i; 0 .. 5) writef(<span class="d_string">"%s "<ztpan>, i); writeln(); <span class="d_keyword">import</span> std.range : <span class="d_psymbol">iota</span>; �!�!span class="d_keyword">foreach</span> (i; <span class="d_psymbol">iota</span>(0, 5)) �7ritef(<span class="d_string">"%s "</span>, i); �7riteln(); �7ritefln(<span class="d_string">"%(%s�.�.|%)"</span>,�!�!span class="d_psymbol">iota<ztpan>(0, 5)); <span class="d_keyword">import</span> std.algorithm.iteration : map; �!�!span class="d_keyword">import<ztpan> std.algorithm.mutation : copy; <span class="d_keyword">import</span> std.format; <span class="d_psymbol">iota</span>(0, 5).map!(i => format(<span class="d_string">"%s "</span>, i)).copy(stdout.lockingTextWriter()); �7riteln(); } </pre> <y:><u(iv> <span class="dlang_runnable"><ztpan><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples"><pre class="d_code notranslate"><span class="d_keyword">import<ztpan> std.algorithm.comparison : equal; <span class="d_keyword">import<ztpan> std.math.operations : isClose; <span class="d_keyword">auto<ztpan> r =�!�!span class="d_psymbol">iota<ztpan>(0, 10, 1); <span class="d_keyword">assert</span>(equal(r, [0, 1, �(l4�) 2 2, 4, 5, 6, 5 5 5, 8, 9])); <span class="d_keyword">assert<ztpan>(equal(r, [0, 1, 2, 0Ñ0ü0Ä 2 2 2, 5, 5 5, 7, 8, 9])); <span class="d_keyword">assert</span>(0µ0ó0Á0ü0à<span class="d_keyword">in</span> r); <span class="d_keyword">assert</span>(r.contains(3)); <span class="d_comment">]åSame as above </span><span class="d_keyword">assert<ztpan>(!(10 <span class="d_keyword">in</span> r)); <span class="d_keyword">assert<ztpan>(!(-8 <span class="d_keyword">in</span> r)); r =�!�!span class="d_psymbol">iota<ztpan>(0, �, 0Î0Ã0È; <span class="d_keyword">assert</span>(equal(r, [0, 2 2, 6, 9])); writeln(r[2]); <span class="d_comment">]å 5 5 <ztpan><span class="d_keyword">assert</span>(�Z�(N��)<span class="d_keyword">in</span> r)); <span class="d_keyword">auto<ztpan> rf = <span class="d_psymbol">iota</span>(0.0, 0.5, 0.1); <span class="d_keyword">assert</span>(isClose(rf, [0.0, 0.1, 0.2, 0.0Ñ0ü0Ä 0.4])); <y:re> </div></div> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".TransverseOptions"></span><div class="quickindex" id="quickindex.TransverseOptions"><u(iv>enum <span class="def-anchor" id="TransverseOptions"></span><code class="ddoc_psymbol">TransverseOptions<uode>: int; <br><u(iv><u(t> <dd><div class="summary">Options for the <a href="#FrontTransversal"><span class="d_inlinecode donthyphenate notranslate">FrontTransversal<ztpan></a> and�!�!a href="#Transversal"><span class="d_inlinecode donthyphenate notranslate">Transversal</span><tæ> ranges (below).</div><span class="dlang_runnable"><ztpan><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples"><pre class="d_code notranslate"><span class="d_keyword">import<ztpan> std.algorithm.comparison : equal; <span class="d_keyword">import<ztpan> std.exception : assertThrown; <span class="d_keyword">auto</span> arr = [[1, 2], [0Ñ0ü0Ä 2 2 2, 5]]; <span class="d_keyword">auto</span> r1 = arr.frontTransversal!(<span class="d_psymbol">TransverseOptions</span>.assumeJagged); <span class="d_keyword">assert<ztpan>(r1.equal([1, �5p¹)); <span class="d_comment">/Xëthrows on construction <ztpan>assertThrown�Dxception(arr.frontTransversal!(<span class="d_psymbol">TransverseOptions</span>.enforceNotJagged)); <span class="d_keyword">auto<ztpan> r�(N��)= arr.frontTransversal�Z<span class="d_psymbol">TransverseOptions<ztpan>.assumeNotJagged); <span class="d_keyword">assert<ztpan>(r�(‘Ñ�)equal([1, �5p¹)); <span class="d_comment">/Xëeither assuming or checking for equal lengths makes </span><span class="d_comment">/Xëthe result a random access range <ztpan>writeln(r2[0]); <span class="d_comment">]å 1 <ztpan><span class="d_keyword">static</span> <span class="d_keyword">assert</span>(Àspan class="d_keyword">__traits<ztpan>(compiles, rm0])); </pre> <u(iv><u(iv> <dl><dt class="d_decl"><div� <span class="def-anchor" id=".TransverseOptions.assumeJagged"></span><div class="quickindex" id="quickindex.TransverseOptions.assumeJagged"></div><span class="def-anchor" id="assumeJagged"><ztpan><code class="ddoc_psymbol">assumeJagged<uode><br></div></dt> <dd><div class="summary">When transversed,�4he elements of a range of ranges are assumed�4o have different lengths (e.g. a jagged array).</div> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".TransverseOptions.enforceNotJagged"></span><div class="quickindex" id="quickindex.TransverseOptions.enforceNotJagged"></div><span class="def-anchor" id="enforceNotJagged"><ztpan><code class="ddoc_psymbol">enforceNotJagged<uode><br></div></dt> <dd><div class="summary">The�4ransversal enforces that�4he elements of a range of ranges have all�4he same length (e.g. an array of arrays, all having the same length). Checking is done once�5pon construction of the transversal range.<u(iv> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".TransverseOptions.assumeNotJagged"></span><div class="quickindex" id="quickindex.TransverseOptions.assumeNotJagged"><u(iv><span class="def-anchor" id="assumeNotJagged"><ztpan><code class="ddoc_psymbol">assumeNotJagged</code><br><u(iv><u(t> <dd><div class="summary">The transversal assumes,�7ithout�6erifying, that�4he elements of a range of ranges have all�4he same length. This option is�5seful if checking�7as already done from�4he outside of the range.</div> <u(d> <u(l> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".FrontTransversal"></span><div class="quickindex" id="quickindex.FrontTransversal"></div>struct�!�!span class="def-anchor" id="FrontTransversal"></span><code class="ddoc_psymbol">FrontTransversal</code>(Ror, TransverseOptions opt = TransverseOptions.assumeJagged); <br><br><span class="def-anchor" id=".frontTransversal"></span><div class="quickindex" id="quickindex.frontTransversal"></div>FrontTransversal�ZRangeOfRanges, opt) <span class="def-anchor" id="frontTransversal"><ztpan><code class="ddoc_psymbol">frontTransversal<uode><span class="template_param_list" title="Template parameter list">(TransverseOptions opt = TransverseOptions.assumeJagged, RangeOfRanges)<ztpan>(RangeOfRanges�!�!code class="ddoc_param">rr</code>); <br></div></dt> <dd><div class="summary">Given a range of ranges, iterate transversally through the first elements of each of�4he enclosed ranges.<u(iv><span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:<ztpan>�!�!div class="val�6alExamples"><pre class="d_code notranslate"><span class="d_keyword">import</span> std.algorithm.comparison : equal; <span class="d_keyword">int<ztpan>[][]�8 =�!�!span class="d_keyword">new</span> <span class="d_keyword">int<ztpan>[][2]; x[0] = [1, �3�3; x[o = [0Ñ0ü0Ä 2 2 2]; <span class="d_keyword">auto<ztpan> ror =�!�!span class="d_psymbol">frontTransversal<ztpan>(x); <span class="d_keyword">assert<ztpan>(equal(ror, [ 1, 2 2 ][])); </pre> <u(iv><u(iv> <dl><dt class="d_decl"><div� <span class="def-anchor" id=".FrontTransversal.this"><ztpan><div class="quickindex" id="quickindex.FrontTransversal.this"></div>this(RangeOfRanges�!�!code class="ddoc_param">input<uode>); <br><u(iv><u(t> <dd><div class="summary">Construction from an input.<u(iv> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".FrontTransversal.empty"><ztpan><div class="quickindex" id="quickindex.FrontTransversal.empty"><u(iv>enum bool�!�!span class="def-anchor" id="empty"><ztpan><code class="ddoc_psymbol">empty</code>; <br><br><span class="def-anchor" id=".FrontTransversal.front"><ztpan><div class="quickindex" id="quickindex.FrontTransversal.front"><u(iv>@property ref auto <span class="def-anchor" id="front"></span><code class="ddoc_psymbol">front<uode>(); <br><br><span class="def-anchor" id=".FrontTransversal.moveFront"></span><div class="quickindex" id="quickindex.FrontTransversal.moveFront"></div>ElementType <span class="def-anchor" id="moveFront"></span><code class="ddoc_psymbol">moveFront<uode>(); <br><br><span class="def-anchor" id=".FrontTransversal.popFront"><ztpan><div class="quickindex" id="quickindex.FrontTransversal.popFront"></div>void�!�!span class="def-anchor" id="popFront"></span><code class="ddoc_psymbol">popFront</code>(); <br><u(iv><u(t> <dd><div class="summary">Forward range primitives.<u(iv> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".FrontTransversal.save"></span><div class="quickindex" id="quickindex.FrontTransversal.save"><u(iv>@property FrontTransversal <span class="def-anchor" id="save"><ztpan><code class="ddoc_psymbol">save<uode>(); <br></div></dt> <dd><div class="summary">Duplicates this�!�!span class="d_inlinecode donthyphenate notranslate">frontTransversal</span>. Note that only the encapsulating range of range will be duplicated. Underlying ranges will not be duplicated.</div> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".FrontTransversal.back"><ztpan><div class="quickindex" id="quickindex.FrontTransversal.back"></div>@property ref auto�!�!span class="def-anchor" id="back"></span><code class="ddoc_psymbol">back</code>(); <br><br><span class="def-anchor" id=".FrontTransversal.popBack"><ztpan><div class="quickindex" id="quickindex.FrontTransversal.popBack"><u(iv>void <span class="def-anchor" id="popBack"></span><code class="ddoc_psymbol">popBack<uode>(); <br><br><span class="def-anchor" id=".FrontTransversal.moveBack"><ztpan><div class="quickindex" id="quickindex.FrontTransversal.moveBack"></div>ElementType <span class="def-anchor" id="moveBack"><ztpan><code class="ddoc_psymbol">moveBack<uode>(); <br></div></dt> <dd><div class="summary">Bidirectional�0rimitives. They are offered if�!�!span class="d_inlinecode donthyphenate notranslate"> isBidirectionalRange!RangeOfRanges<ztpan>.<u(iv> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".FrontTransversal.opIndex"><ztpan><div class="quickindex" id="quickindex.FrontTransversal.opIndex"><u(iv>ref auto <span class="def-anchor" id="opIndex"></span><code class="ddoc_psymbol">opIndex<uode>(size_t <code class="ddoc_param">n</code>); <br><br><span class="def-anchor" id=".FrontTransversal.moveAt"><ztpan><div class="quickindex" id="quickindex.FrontTransversal.moveAt"></div>ElementType <span class="def-anchor" id="moveAt"><ztpan><code class="ddoc_psymbol">moveAt<uode>(size_t <code class="ddoc_param">n</code>); <br><br><span class="def-anchor" id=".FrontTransversal.opIndexAssign"></span><div class="quickindex" id="quickindex.FrontTransversal.opIndexAssign"></div>void�!�!span class="def-anchor" id="opIndexAssign"><ztpan><code class="ddoc_psymbol">opIndexAssign</code>(ElementType <code class="ddoc_param">val</code>, size_t <code class="ddoc_param">n</code>); <br></div></dt> <dd><div class="summary">Random-access�0rimitive. It is offered if�!�!span class="d_inlinecode donthyphenate notranslate"> isRandomAccessRange�1 D�1�0angeOfRanges�.�.�.amp;& (opt == TransverseOptions.assumeNotJagged�=| opt == TransverseOptions.enforceNotJagged)<ztpan>.<u(iv> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".FrontTransversal.opSlice"><ztpan><div class="quickindex" id="quickindex.FrontTransversal.opSlice"><u(iv>typeof(this) <span class="def-anchor" id="opSlice"></span><code class="ddoc_psymbol">opSlice<uode>(size_t <code class="ddoc_param">lower</code>, size_t <code class="ddoc_param">upper</code>); <br></div></dt> <dd><div class="summary">Slicing if offered if�!�!span class="d_inlinecode donthyphenate notranslate">RangeOfRanges<ztpan> supports slicing and all the conditions for supporting indexing are met.</div> <u(d> <u(l> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".Transversal"><ztpan><div class="quickindex" id="quickindex.Transversal"></div>struct�!�!span class="def-anchor" id="Transversal"><ztpan><code class="ddoc_psymbol">Transversal</code>(Ror, TransverseOptions opt = TransverseOptions.assumeJagged); <br><br><span class="def-anchor" id=".transversal"><ztpan><div class="quickindex" id="quickindex.transversal"></div>Transversal!(RangeOfRanges, opt)�!�!span class="def-anchor" id="transversal"><ztpan><code class="ddoc_psymbol">transversal</code><span class="template_param_list"�4itle="Template�0arameter list">(TransverseOptions opt = TransverseOptions.assumeJagged, RangeOfRanges)</span>(RangeOfRanges <code class="ddoc_param">rr<uode>, size_t�!�!code class="ddoc_param">n<uode>); <br><u(iv><u(t> <dd><div class="summary">Given a range of ranges, iterate�4ransversally�4hrough�4he �!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">n</code><ztpan>th element of each of the enclosed ranges. This function is similar to�!�!span class="d_inlinecode donthyphenate notranslate">unzip<ztpan> in other languages. <u(iv><div class="keyval Parameters"><span class="key keyParameters">Parameters:<ztpan>�!�!div class="val�6alParameters"><table class="params"><tr class="param"><td class="param_id">opt</td> <td class="param_desc">Controls the assumptions the function makes about�4he lengths of the ranges</td><zËr> <tr class="param"><td class="param_id">RangeOfRanges <code class="ddoc_param">rr<uode></td> <td class="param_desc">An input range of random access ranges<zËd></tr> </table></div></div> <div class="keyval Returns"><span class="key keyReturns">Returns:</span> <div class="val valReturns">At minimum, an input range. Range primitives such as bidirectionality and random access are given if�4he element�4ype of�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">rr<uode></span> provides�4hem.</div></div> <span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:<ztpan>�!�!div class="val�6alExamples"><pre class="d_code notranslate"><span class="d_keyword">import</span> std.algorithm.comparison : equal; <span class="d_keyword">int<ztpan>[][]�8 =�!�!span class="d_keyword">new</span> <span class="d_keyword">int<ztpan>[][2]; x[0] = [1, �3�3; x[o = [0Ñ0ü0Ä 2 2 2]; <span class="d_keyword">auto<ztpan> ror =�!�!span class="d_psymbol">transversal</span>(x, 1); <span class="d_keyword">assert<ztpan>(equal(ror, [ �(l4�) 2 2 2 ])); </pre> <u(iv><u(iv> <span class="dlang_runnable"><ztpan><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples">The following code does a full unzip <pre class="d_code notranslate"><span class="d_keyword">import</span> std.algorithm.comparison : equal; <span class="d_keyword">import</span> std.algorithm.iteration : map; <span class="d_keyword">int</span>[][] y = [[1, 2, �5p¹, [4, 5, 5 5]]; <span class="d_keyword">auto</span> z = y.front.walkLength.iota.map!(i =>�!�!span class="d_psymbol">transversal</span>(y, i)); <span class="d_keyword">assert</span>(equal!equal(z, [[1, 4], [2, 5], [3, 6]])); <y:re> </div></div> <dl><dt class="d_decl"><div ><span class="def-anchor" id=".Transversal.this"><ztpan><div class="quickindex" id="quickindex.Transversal.this"><u(iv>this(RangeOfRanges <code class="ddoc_param">input</code>, size_t <code class="ddoc_param">n</code>); <br></div></dt> <dd><div class="summary">Construction from an input and an index.<u(iv> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".Transversal.empty"></span><div class="quickindex" id="quickindex.Transversal.empty"><u(iv>enum bool�!�!span class="def-anchor" id="empty"><ztpan><code class="ddoc_psymbol">empty</code>; <br><br><span class="def-anchor" id=".Transversal.front"></span><div class="quickindex" id="quickindex.Transversal.front"><u(iv>@property ref auto <span class="def-anchor" id="front"></span><code class="ddoc_psymbol">front<uode>(); <br><br><span class="def-anchor" id=".Transversal.moveFront"><ztpan><div class="quickindex" id="quickindex.Transversal.moveFront"></div>E <span class="def-anchor" id="moveFront"></span><code class="ddoc_psymbol">moveFront<uode>(); <br><br><span class="def-anchor" id=".Transversal.front.�(N �)><ztpan><div class="quickindex" id="quickindex.Transversal.front.2"></div>@property void�!�!span class="def-anchor" id="front"><ztpan><code class="ddoc_psymbol">front</code>(E <code class="ddoc_param">val</code>); <br><br><span class="def-anchor" id=".Transversal.popFront"></span><div class="quickindex" id="quickindex.Transversal.popFront"></div>void�!�!span class="def-anchor" id="popFront"></span><code class="ddoc_psymbol">popFront</code>(); <br><br><span class="def-anchor" id=".Transversal.save"><ztpan><div class="quickindex" id="quickindex.Transversal.save"><u(iv>@property�4ypeof(this) <span class="def-anchor" id="save"><ztpan><code class="ddoc_psymbol">save<uode>(); <br></div></dt> <dd><div class="summary">Forward range�0rimitives.</div> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".Transversal.back"></span><div class="quickindex" id="quickindex.Transversal.back"></div>@property ref auto�!�!span class="def-anchor" id="back"></span><code class="ddoc_psymbol">back</code>(); <br><br><span class="def-anchor" id=".Transversal.popBack"></span><div class="quickindex" id="quickindex.Transversal.popBack"><u(iv>void <span class="def-anchor" id="popBack"></span><code class="ddoc_psymbol">popBack<uode>(); <br><br><span class="def-anchor" id=".Transversal.moveBack"></span><div class="quickindex" id="quickindex.Transversal.moveBack"></div>E <span class="def-anchor" id="moveBack"><ztpan><code class="ddoc_psymbol">moveBack<uode>(); <br><br><span class="def-anchor" id=".Transversal.back.2"></span><div class="quickindex" id="quickindex.Transversal.back.2"></div>@property void�!�!span class="def-anchor" id="back"></span><code class="ddoc_psymbol">back</code>(E <code class="ddoc_param">val</code>); <br></div></dt> <dd><div class="summary">Bidirectional�0rimitives. They are offered if�!�!span class="d_inlinecode donthyphenate notranslate"> isBidirectionalRange!RangeOfRanges<ztpan>.<u(iv> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".Transversal.opIndex"></span><div class="quickindex" id="quickindex.Transversal.opIndex"><u(iv>ref auto <span class="def-anchor" id="opIndex"></span><code class="ddoc_psymbol">opIndex<uode>(size_t <code class="ddoc_param">n</code>); <br><br><span class="def-anchor" id=".Transversal.moveAt"></span><div class="quickindex" id="quickindex.Transversal.moveAt"></div>E <span class="def-anchor" id="moveAt"><ztpan><code class="ddoc_psymbol">moveAt<uode>(size_t <code class="ddoc_param">n</code>); <br><br><span class="def-anchor" id=".Transversal.opIndexAssign"><ztpan><div class="quickindex" id="quickindex.Transversal.opIndexAssign"></div>void�!�!span class="def-anchor" id="opIndexAssign"><ztpan><code class="ddoc_psymbol">opIndexAssign</code>(E <code class="ddoc_param">val</code>, size_t <code class="ddoc_param">n</code>); <br></div></dt> <dd><div class="summary">Random-access�0rimitive. It is offered if�!�!span class="d_inlinecode donthyphenate notranslate"> isRandomAccessRange�1 D�1�0angeOfRanges�.�.�.amp;& (opt == TransverseOptions.assumeNotJagged�=| opt == TransverseOptions.enforceNotJagged)<ztpan>.<u(iv> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".Transversal.opSlice"></span><div class="quickindex" id="quickindex.Transversal.opSlice"><u(iv>typeof(this) <span class="def-anchor" id="opSlice"></span><code class="ddoc_psymbol">opSlice<uode>(size_t <code class="ddoc_param">lower</code>, size_t <code class="ddoc_param">upper</code>); <br></div></dt> <dd><div class="summary">Slicing if offered if�!�!span class="d_inlinecode donthyphenate notranslate">RangeOfRanges<ztpan> supports slicing and all the conditions for supporting indexing are met.</div> <u(d> <u(l> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".transposed"></span><div class="quickindex" id="quickindex.transposed"></div>Transposed�ZRangeOfRanges, opt) <span class="def-anchor" id="transposed"><ztpan><code class="ddoc_psymbol">transposed<uode><span class="template_param_list" title="Template parameter list">(TransverseOptions opt = TransverseOptions.assumeJagged, RangeOfRanges)<ztpan>(RangeOfRanges�!�!code class="ddoc_param">rr</code>)<br><span class="constraint">if (isForwardRange!RangeOfRanges && isInputRange!(ElementType�1 D�1�0angeOfRanges) && hasAssignableElements�1 D�1�0angeOfRanges)<ztpan>; <br></div></dt> <dd><div class="summary">Given a range of ranges, returns a range of ranges where the <i>i</i>'th subrange contains the <i>i</i>'th elements of the original subranges. </div><div class="keyval Parameters"><span class="key keyParameters">Parameters:</span> <div class="val valParameters"><table class="params"><tr class="param"><td class="param_id">opt<zËd> <td class="param_desc">Controls�4he assumptions�4he function makes about the lengths of�4he ranges (i.e. jagged or not)</td><zËr> <tr class="param"><td class="param_id">RangeOfRanges <code class="ddoc_param">rr<uode></td> <td class="param_desc">Range of ranges</td><zËr> <zËable><u(iv><u(iv> <span class="dlang_runnable"><ztpan><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples"><pre class="d_code notranslate"><span class="d_keyword">import<ztpan> std.algorithm.comparison : equal; <span class="d_keyword">int</span>[][] ror = [ [1, �(l4�) 2 2], [4, 5, 6] ]; <span class="d_keyword">auto</span> xp =�!�!span class="d_psymbol">transposed<ztpan>(ror); <span class="d_keyword">assert<ztpan>(equalÀspan class="d_string">"a.equal(b)"</span>(xp, [ [1, 4], [2, 5], [3, 6] ])); </pre> <u(iv><u(iv> <span class="dlang_runnable"><ztpan><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples"><pre class="d_code notranslate"><span class="d_keyword">int</span>[][] x = <span class="d_keyword">new<ztpan>�!�!span class="d_keyword">int</span>[][�3�3; x[0] = [1, 2]; x[1] = [3, 4]; <span class="d_keyword">auto</span> tr =�!�!span class="d_psymbol">transposed<ztpan>(x); <span class="d_keyword">int</span>[][] witness = [ [ 1, 2 2 ], [ �(l4�) 2 2 2 ] ]; <span class="d_keyword">uint</span> i; <span class="d_keyword">foreach<ztpan> (e;�4r) { �7riteln(array(e)); <span class="d_comment">]å�7itness[i++] </span>} <y:re> </div></div> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".Indexed"></span><div class="quickindex" id="quickindex.Indexed"><u(iv>struct <span class="def-anchor" id="Indexed"></span><code class="ddoc_psymbol">Indexed<uode>(Source,�!�?ndices) if (isRandomAccessRange!Source�.�.�.amp;& isInputRange�jndices�.�.�.amp;& is(typeof(Source.init[ElementType!Indices.init]))); <br><br><span class="def-anchor" id=".indexed"><ztpan><div class="quickindex" id="quickindex.indexed"></div>Indexed!<span class="template_param_list" title="Template parameter list">(Source,�!�?ndices)<ztpan>�!�!span class="def-anchor" id="indexed"><ztpan><code class="ddoc_psymbol">indexed</code>(Source, Indices)(Source <code class="ddoc_param">source<uode>, Indices <code class="ddoc_param">indices</code>); <br></div></dt> <dd><div class="summary">This struct�4akes�4wo ranges,�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">source<uode></span> and <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">indices<uode></span>, and creates a�6iew of�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">source<uode></span> as if its elements�7ere reordered according to�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">indices</code><ztpan>. <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">indices<uode></span> may include only a subset of�4he elements of�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">source<uode></span> and may also repeat elements. </div><div class="description"><span class="d_inlinecode donthyphenate notranslate">Source</span> must be a random access range. The returned range�7ill be bidirectional or random-access if�!�!span class="d_inlinecode donthyphenate notranslate">Indices<ztpan> is bidirectional or random-access, respectively.<u(iv> <span class="dlang_runnable"><ztpan><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples"><pre class="d_code notranslate"><span class="d_keyword">import<ztpan> std.algorithm.comparison : equal; <span class="d_keyword">auto<ztpan>�!�!span class="d_param">source<ztpan> = [1, 2, 0Ñ0ü0Ä 2 2 2, 5]; <span class="d_keyword">auto</span> <span class="d_param">indices<ztpan> = [4, 2 2, 1, 2, 0, 2 2 2]; <span class="d_keyword">auto<ztpan> ind =�!�!span class="d_psymbol">indexed</span>(<span class="d_param">source</span>,�!�!span class="d_param">indices</span>); <span class="d_keyword">assert</span>(equal(ind, [5, 2 2 2, �(l4�) 2 2, 1, 5])); <span class="d_keyword">assert<ztpan>(equal(retro(ind), [5, 1, 0Ñ0ü0Ä 2, 4, 5])); <y:re> </div></div> <dl><dt class="d_decl"><div ><span class="def-anchor" id=".Indexed.front"></span><div class="quickindex" id="quickindex.Indexed.front"><u(iv>@property ref auto <span class="def-anchor" id="front"></span><code class="ddoc_psymbol">front<uode>(); <br><br><span class="def-anchor" id=".Indexed.popFront"></span><div class="quickindex" id="quickindex.Indexed.popFront"></div>void�!�!span class="def-anchor" id="popFront"></span><code class="ddoc_psymbol">popFront</code>(); <br><br><span class="def-anchor" id=".Indexed.save"><ztpan><div class="quickindex" id="quickindex.Indexed.save"><u(iv>@property�4ypeof(this) <span class="def-anchor" id="save"><ztpan><code class="ddoc_psymbol">save<uode>(); <br><br><span class="def-anchor" id=".Indexed.front.�(N �)><ztpan><div class="quickindex" id="quickindex.Indexed.front.2"></div>@property ref auto�!�!span class="def-anchor" id="front"><ztpan><code class="ddoc_psymbol">front</code>(ElementType!Source�!�!code class="ddoc_param">newVal</code>); <br><br><span class="def-anchor" id=".Indexed.moveFront"><ztpan><div class="quickindex" id="quickindex.Indexed.moveFront"></div>auto�!�!span class="def-anchor" id="moveFront"><ztpan><code class="ddoc_psymbol">moveFront</code>(); <br><br><span class="def-anchor" id=".Indexed.back"><ztpan><div class="quickindex" id="quickindex.Indexed.back"><u(iv>@property ref auto <span class="def-anchor" id="back"><ztpan><code class="ddoc_psymbol">back<uode>(); <br><br><span class="def-anchor" id=".Indexed.popBack"><ztpan><div class="quickindex" id="quickindex.Indexed.popBack"></div>void�!�!span class="def-anchor" id="popBack"><ztpan><code class="ddoc_psymbol">popBack</code>(); <br><br><span class="def-anchor" id=".Indexed.back.�(N �)><ztpan><div class="quickindex" id="quickindex.Indexed.back.�(N �)><u(iv>@property ref auto <span class="def-anchor" id="back"><ztpan><code class="ddoc_psymbol">back<uode>(ElementType�1 D�3ource <code class="ddoc_param">newVal<uode>); <br><br><span class="def-anchor" id=".Indexed.moveBack"><ztpan><div class="quickindex" id="quickindex.Indexed.moveBack"><u(iv>auto <span class="def-anchor" id="moveBack"><ztpan><code class="ddoc_psymbol">moveBack<uode>(); <br><br><span class="def-anchor" id=".Indexed.opIndex"><ztpan><div class="quickindex" id="quickindex.Indexed.opIndex"></div>ref auto�!�!span class="def-anchor" id="opIndex"><ztpan><code class="ddoc_psymbol">opIndex</code>(size_t�!�!code class="ddoc_param">index<uode>); <br><br><span class="def-anchor" id=".Indexed.opSlice"></span><div class="quickindex" id="quickindex.Indexed.opSlice"><u(iv>typeof(this) <span class="def-anchor" id="opSlice"></span><code class="ddoc_psymbol">opSlice<uode>(size_t <code class="ddoc_param">a</code>, size_t <code class="ddoc_param">b</code>); <br><br><span class="def-anchor" id=".Indexed.opIndexAssign"><ztpan><div class="quickindex" id="quickindex.Indexed.opIndexAssign"></div>auto�!�!span class="def-anchor" id="opIndexAssign"><ztpan><code class="ddoc_psymbol">opIndexAssign</code>(ElementType!Source�!�!code class="ddoc_param">newVal</code>, size_t <code class="ddoc_param">index</code>); <br><br><span class="def-anchor" id=".Indexed.moveAt"></span><div class="quickindex" id="quickindex.Indexed.moveAt"></div>auto�!�!span class="def-anchor" id="moveAt"></span><code class="ddoc_psymbol">moveAt</code>(size_t�!�!code class="ddoc_param">index<uode>); <br><u(iv><u(t> <dd><div class="summary">Range primitives</div> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".Indexed.source"></span><div class="quickindex" id="quickindex.Indexed.source"></div>@property Source�!�!span class="def-anchor" id="source"></span><code class="ddoc_psymbol">source</code>(); <br><u(iv><u(t> <dd><div class="summary">Returns the source range.<u(iv> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".Indexed.indices"></span><div class="quickindex" id="quickindex.Indexed.indices"><u(iv>@property�!�?ndices�!�!span class="def-anchor" id="indices"><ztpan><code class="ddoc_psymbol">indices</code>(); <br><u(iv><u(t> <dd><div class="summary">Returns the indices range.</div> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".Indexed.physicalIndex"><ztpan><div class="quickindex" id="quickindex.Indexed.physicalIndex"></div>size_t�!�!span class="def-anchor" id="physicalIndex"><ztpan><code class="ddoc_psymbol">physicalIndex</code>(size_t�!�!code class="ddoc_param">logicalIndex</code>); <br></div></dt> <dd><div class="summary">Returns�4he�0hysical index into�4he source range corresponding to a given logical index. This is�5seful, for example, when indexing an�!�!span class="d_inlinecode donthyphenate notranslate">Indexed<ztpan>�7ithout adding another layer of indirection.<u(iv><span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:<ztpan>�!�!div class="val�6alExamples"><pre class="d_code notranslate"><span class="d_keyword">auto</span> ind = indexed([1, �(l4�) 2 2, 4, 5], [1, 2 2, 4]); writeln(ind.<span class="d_psymbol">physicalIndex</span>(0));�!�!span class="d_comment">/Xë1 </span><y:re> </div></div> </dd> </dl> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".Chunks"><ztpan><div class="quickindex" id="quickindex.Chunks"><u(iv>struct <span class="def-anchor" id="Chunks"><ztpan><code class="ddoc_psymbol">Chunks<uode>(Source) if (isInputRange!Source); <br><br><span class="def-anchor" id=".chunks"><ztpan><div class="quickindex" id="quickindex.chunks"><u(iv>Chunks!Source�!�!span class="def-anchor" id="chunks"></span><code class="ddoc_psymbol">chunks</code><span class="template_param_list"�4itle="Template�0arameter list">(Source)<ztpan>(Source <code class="ddoc_param">source<uode>, size_t�!�!code class="ddoc_param">chunkSize<uode>)<br><span class="constraint">if (isInputRange�1 D�3ource)</span>; <br><u(iv><u(t> <dd><div class="summary">This range iterates over fixed-sized chunks of size <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">chunkSize<uode></span> of a <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">source<uode></span> range.�!�!span class="d_inlinecode donthyphenate notranslate">Source</span> must be an�!�!a href="std_range_primitives.html#.isInputRange">input range</a>. <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">chunkSize<uode></span> must be greater than�+ero. <u(iv><div class="description">If�!�!span class="d_inlinecode donthyphenate notranslate">�XsInfinite!Source</span> and <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">source</code>.walkLength</span> is not evenly divisible by�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">chunkSize</code><ztpan>, the back element of this range�7ill contain fewer than�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">chunkSize</code><ztpan> elements. <div class="blankline"></div> If�!�!span class="d_inlinecode donthyphenate notranslate">Source</span> is a forward range, the resulting range will be forward ranges as well. Otherwise,�4he resulting chunks will be input ranges consuming�4he same input: iterating over <span class="d_inlinecode donthyphenate notranslate">front</span> will shrink the chunk such�4hat subsequent invocations of <span class="d_inlinecode donthyphenate notranslate">front</span> will no longer return the full chunk, and calling <span class="d_inlinecode donthyphenate notranslate">popFront<ztpan> on the outer range will invalidate any lingering references�4o previous�6alues of�!�!span class="d_inlinecode donthyphenate notranslate">front<ztpan>. <u(iv> <div class="keyval Parameters"><span class="key keyParameters">Parameters:</span> <div class="val valParameters"><table class="params"><tr class="param"><td class="param_id">Source�!�!code class="ddoc_param">source</code><zËd> <td class="param_desc">Range from�7hich�4he chunks will be selected</td><zËr> <tr class="param"><td class="param_id">size_t�!�!code class="ddoc_param">chunkSize<uode></td> <td class="param_desc">Chunk size<zËd></tr> </table></div></div> <div class="keyval SeeAlso"><span class="key keySeeAlso">See Also:<ztpan>�!�!div class="val�6alSeeAlso"><a href="#slide"><span class="d_inlinecode donthyphenate notranslate">slide</span><tæ> <u(iv><u(iv> <div class="keyval Returns"><span class="key keyReturns">Returns:<ztpan>�!�!div class="val�6alReturns">Range of chunks.<u(iv><u(iv> <span class="dlang_runnable"><ztpan><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples"><pre class="d_code notranslate"><span class="d_keyword">import<ztpan> std.algorithm.comparison : equal; <span class="d_keyword">auto<ztpan>�!�!span class="d_param">source<ztpan> = [1, 2, 0Ñ0ü0Ä 2 2 2, 5, 5 5, 7, 8, 9, 10]; <span class="d_keyword">auto</span> <span class="d_psymbol">chunks</span> = <span class="d_psymbol">chunks</span>(<span class="d_param">source</span>, 2 2 2); writeln(<span class="d_psymbol">chunks<ztpan>[0]); <span class="d_comment">]å [1, 2, 0Ñ0ü0Ä 2 2 2] </span>writeln(<span class="d_psymbol">chunks<ztpan>[1]); <span class="d_comment">]å [5, 5 5, 7, 8] </span>writeln(<span class="d_psymbol">chunks<ztpan>[2]); <span class="d_comment">]å [9, 10] <ztpan>writeln(<span class="d_psymbol">chunks</span>.back);�!�!span class="d_comment">/Xëchunks[2] </span>writeln(<span class="d_psymbol">chunks<ztpan>.front);�!�!span class="d_comment">/Xëchunks[0] </span>writeln(<span class="d_psymbol">chunks<ztpan>.length); <span class="d_comment">]å 2 2 <ztpan><span class="d_keyword">assert</span>(equal(retro(array(<span class="d_psymbol">chunks</span>)), array(retro(<span class="d_psymbol">chunks<ztpan>)))); </pre> <u(iv><u(iv> <span class="dlang_runnable"><ztpan><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples">Non-forward input ranges are supported, but�7ith limited semantics. <pre class="d_code notranslate"><span class="d_keyword">import<ztpan> std.algorithm.comparison : equal; <span class="d_keyword">int<ztpan> i; <span class="d_comment">/XëThe generator doesn't save state, so it cannot be a forward range. <ztpan><span class="d_keyword">auto</span> inputRange = generate!(() => ++i).take(10); <span class="d_comment">]å 2 2 2 2e can still process it in chunks, but it�7ill be single-pass only. <ztpan><span class="d_keyword">auto</span> chunked = inputRange.<span class="d_psymbol">chunks<ztpan>(2); <span class="d_keyword">assert</span>(chunked.front.equal([1, �3�3)); <span class="d_keyword">assert</span>(chunked.front.empty); <span class="d_comment">]å�!�?terating�4he chunk has consumed it <ztpan>chunked.popFront; <span class="d_keyword">assert</span>(chunked.front.equal([3, 4])); </pre> <u(iv><u(iv> <dl><dt class="d_decl"><div� <span class="def-anchor" id=".Chunks.this"><ztpan><div class="quickindex" id="quickindex.Chunks.this"></div>this(Source <code class="ddoc_param">source<uode>, size_t�!�!code class="ddoc_param">chunkSize<uode>); <br><u(iv><u(t> <dd><div class="summary">Standard constructor</div> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".Chunks.front"></span><div class="quickindex" id="quickindex.Chunks.front"></div>@property auto�!�!span class="def-anchor" id="front"><ztpan><code class="ddoc_psymbol">front</code>(); <br><br><span class="def-anchor" id=".Chunks.popFront"></span><div class="quickindex" id="quickindex.Chunks.popFront"><u(iv>void <span class="def-anchor" id="popFront"><ztpan><code class="ddoc_psymbol">popFront<uode>(); <br><br><span class="def-anchor" id=".Chunks.empty"></span><div class="quickindex" id="quickindex.Chunks.empty"></div>@property bool�!�!span class="def-anchor" id="empty"><ztpan><code class="ddoc_psymbol">empty</code>(); <br><u(iv><u(t> <dd><div class="summary">Input range primitives. Always�0resent.<u(iv> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".Chunks.save"></span><div class="quickindex" id="quickindex.Chunks.save"><u(iv>@property�4ypeof(this) <span class="def-anchor" id="save"><ztpan><code class="ddoc_psymbol">save<uode>(); <br></div></dt> <dd><div class="summary">Forward range�0rimitives. Only present if�!�!span class="d_inlinecode donthyphenate notranslate">Source</span> is a forward range.<u(iv> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".Chunks.length"></span><div class="quickindex" id="quickindex.Chunks.length"><u(iv>@property size_t <span class="def-anchor" id="length"><ztpan><code class="ddoc_psymbol">length<uode>(); <br></div></dt> <dd><div class="summary">Length. Only if�!�!span class="d_inlinecode donthyphenate notranslate">hasLength!Source</span> is�!�!span class="d_inlinecode donthyphenate notranslate">true</span><u(iv> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".Chunks.opIndex"><ztpan><div class="quickindex" id="quickindex.Chunks.opIndex"><u(iv>auto <span class="def-anchor" id="opIndex"></span><code class="ddoc_psymbol">opIndex<uode>(size_t <code class="ddoc_param">index</code>); <br><br><span class="def-anchor" id=".Chunks.opSlice"></span><div class="quickindex" id="quickindex.Chunks.opSlice"></div>typeof(this)�!�!span class="def-anchor" id="opSlice"><ztpan><code class="ddoc_psymbol">opSlice</code>(size_t�!�!code class="ddoc_param">lower<uode>, size_t�!�!code class="ddoc_param">upper<uode>); <br><u(iv><u(t> <dd><div class="summary">Indexing and slicing operations. Provided only if <span class="d_inlinecode donthyphenate notranslate">hasSlicing!Source</span> is�!�!span class="d_inlinecode donthyphenate notranslate">true</span>.</div> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".Chunks.back"><ztpan><div class="quickindex" id="quickindex.Chunks.back"></div>@property auto�!�!span class="def-anchor" id="back"></span><code class="ddoc_psymbol">back</code>(); <br><br><span class="def-anchor" id=".Chunks.popBack"><ztpan><div class="quickindex" id="quickindex.Chunks.popBack"><u(iv>void <span class="def-anchor" id="popBack"></span><code class="ddoc_psymbol">popBack<uode>(); <br></div></dt> <dd><div class="summary">Bidirectional range�0rimitives. Provided only if both �!�!span class="d_inlinecode donthyphenate notranslate">hasSlicing�1 D�3ource<ztpan> and�!�!span class="d_inlinecode donthyphenate notranslate">hasLength!Source</span> are <span class="d_inlinecode donthyphenate notranslate">true<ztpan>.<u(iv> </dd> </dl> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".EvenChunks"><ztpan><div class="quickindex" id="quickindex.EvenChunks"><u(iv>struct <span class="def-anchor" id="EvenChunks"><ztpan><code class="ddoc_psymbol">EvenChunks<uode>(Source) if (isForwardRange!Source�.�.�.amp;& hasLength!Source); <br><br><span class="def-anchor" id=".evenChunks"><ztpan><div class="quickindex" id="quickindex.evenChunks"><u(iv>EvenChunks!Source�!�!span class="def-anchor" id="evenChunks"></span><code class="ddoc_psymbol">evenChunks</code><span class="template_param_list"�4itle="Template�0arameter list">(Source)<ztpan>(Source <code class="ddoc_param">source<uode>, size_t�!�!code class="ddoc_param">chunkCount</code>)<br><span class="constraint">if (isForwardRange!Source�.�.�.amp;& hasLength!Source)<ztpan>; <br></div></dt> <dd><div class="summary">This range splits a�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">source<uode></span> range into�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">chunkCount<uode></span> chunks of approximately equal length. <span class="d_inlinecode donthyphenate notranslate">Source<ztpan> must be a forward range�7ith known length. </div><div class="description">Unlike <a href="#chunks"><span class="d_inlinecode donthyphenate notranslate">chunks<ztpan></a>, <span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="evenChunks"></span><code class="ddoc_psymbol">evenChunks</code><ztpan>�4akes a chunk count (not size). The returned range will contain�+ero or more <span class="d_inlinecode donthyphenate notranslate">source.length� chunkCount + ²ztpan> elements followed by <span class="d_inlinecode donthyphenate notranslate">source.length� chunkCount<ztpan> elements.�!�?f <span class="d_inlinecode donthyphenate notranslate">source.length�.�.�.lt; chunkCount</span>, some chunks�7ill be empty. <div class="blankline"><u(iv> <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">chunkCount<uode></span> must not be zero, unless�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">source<uode></span> is also empty.</div> <span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:<ztpan>�!�!div class="val�6alExamples"><pre class="d_code notranslate"><span class="d_keyword">import</span> std.algorithm.comparison : equal; <span class="d_keyword">auto</span> <span class="d_param">source</span> = [1, �(l4�) 2 2, 4, 5, 6, 5 5 5, 8, 9, 10]; <span class="d_keyword">auto<ztpan> chunks = <span class="d_psymbol">evenChunks</span>(<span class="d_param">source</span>, 2 2); writeln(chunks[0]);�!�!span class="d_comment">/Xë[1, �(l4�) 2 2, 4] <ztpan>writeln(chunks[1]); <span class="d_comment">]å [5, 5 5, 7] <ztpan>writeln(chunks[2]); <span class="d_comment">]å [8, 9, 10] </span><y:re> </div></div> <dl><dt class="d_decl"><div ><span class="def-anchor" id=".EvenChunks.this"></span><div class="quickindex" id="quickindex.EvenChunks.this"><u(iv>this(Source�!�!code class="ddoc_param">source</code>, size_t <code class="ddoc_param">chunkCount<uode>); <br><u(iv><u(t> <dd><div class="summary">Standard constructor</div> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".EvenChunks.front"></span><div class="quickindex" id="quickindex.EvenChunks.front"></div>@property auto�!�!span class="def-anchor" id="front"><ztpan><code class="ddoc_psymbol">front</code>(); <br><br><span class="def-anchor" id=".EvenChunks.popFront"></span><div class="quickindex" id="quickindex.EvenChunks.popFront"><u(iv>void <span class="def-anchor" id="popFront"><ztpan><code class="ddoc_psymbol">popFront<uode>(); <br><br><span class="def-anchor" id=".EvenChunks.empty"></span><div class="quickindex" id="quickindex.EvenChunks.empty"></div>@property bool�!�!span class="def-anchor" id="empty"><ztpan><code class="ddoc_psymbol">empty</code>(); <br><br><span class="def-anchor" id=".EvenChunks.save"></span><div class="quickindex" id="quickindex.EvenChunks.save"><u(iv>@property�4ypeof(this) <span class="def-anchor" id="save"><ztpan><code class="ddoc_psymbol">save<uode>(); <br></div></dt> <dd><div class="summary">Forward range�0rimitives. Always present.</div> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".EvenChunks.length"><ztpan><div class="quickindex" id="quickindex.EvenChunks.length"></div>@property size_t�!�!span class="def-anchor" id="length"></span><code class="ddoc_psymbol">length</code>() const; <br><u(iv><u(t> <dd><div class="summary">Length</div> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".EvenChunks.opIndex"></span><div class="quickindex" id="quickindex.EvenChunks.opIndex"></div>auto�!�!span class="def-anchor" id="opIndex"><ztpan><code class="ddoc_psymbol">opIndex</code>(size_t�!�!code class="ddoc_param">index<uode>); <br><br><span class="def-anchor" id=".EvenChunks.opSlice"><ztpan><div class="quickindex" id="quickindex.EvenChunks.opSlice"><u(iv>typeof(this) <span class="def-anchor" id="opSlice"></span><code class="ddoc_psymbol">opSlice<uode>(size_t <code class="ddoc_param">lower</code>, size_t <code class="ddoc_param">upper</code>); <br><br><span class="def-anchor" id=".EvenChunks.back"><ztpan><div class="quickindex" id="quickindex.EvenChunks.back"></div>@property auto�!�!span class="def-anchor" id="back"></span><code class="ddoc_psymbol">back</code>(); <br><br><span class="def-anchor" id=".EvenChunks.popBack"><ztpan><div class="quickindex" id="quickindex.EvenChunks.popBack"><u(iv>void <span class="def-anchor" id="popBack"></span><code class="ddoc_psymbol">popBack<uode>(); <br></div></dt> <dd><div class="summary">Indexing, slicing and bidirectional operations and range primitives. Provided only if�!�!span class="d_inlinecode donthyphenate notranslate">hasSlicing�1 D�3ource<ztpan> is <span class="d_inlinecode donthyphenate notranslate">true<ztpan>.<u(iv> </dd> </dl> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".slide"></span><div class="quickindex" id="quickindex.slide"><u(iv>auto <span class="def-anchor" id="slide"></span><code class="ddoc_psymbol">slide<uode>(Flag!"withPartial" f = Yes.withPartial, Source)(Source <code class="ddoc_param">source<uode>, size_t�!�!code class="ddoc_param">windowSize</code>, size_t <code class="ddoc_param">stepSize<uode> = 1)<br><span class="constraint">if (isForwardRange�1 D�3ource)</span>; <br><u(iv><u(t> <dd><div class="summary">A fixed-sized sliding window iteration of size�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">windowSize<uode></span> over a�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">source<uode></span> range by a custom <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">stepSize</code><ztpan>. </div><div class="description">The�!�!span class="d_inlinecode donthyphenate notranslate">Source</span> range must be at least a�!�!a href="std_range_primitives.html#.isForwardRange">ForwardRange<tæ> and the <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">windowSize</code><ztpan> must be greater�4han zero. <div class="blankline"><u(iv> For�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">windowSize<uode> = 1</span> it splits the range into single element groups (aka <span class="d_inlinecode donthyphenate notranslate">unflatten</span>) For�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">windowSize<uode> = 2</span> it is similar to�!�!span class="d_inlinecode donthyphenate notranslate">zip(<code class="ddoc_param">source<uode>, <code class="ddoc_param">source<uode>.save.dropOne)</span>. </div> <div class="keyval Parameters"><span class="key keyParameters">Parameters:<ztpan>�!�!div class="val�6alParameters"><table class="params"><tr class="param"><td class="param_id">f</td> <td class="param_desc">Whether�4he last element has fewer elements�4han <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">windowSize</code><ztpan> it should be be ignored (<span class="d_inlinecode donthyphenate notranslate">No.withPartial<ztpan>) or added (<span class="d_inlinecode donthyphenate notranslate">Yes.withPartial</span>)</td><zËr> <tr class="param"><td class="param_id">Source�!�!code class="ddoc_param">source</code><zËd> <td class="param_desc">Range from�7hich�4he slide�7ill be selected<zËd></tr> <tr class="param"><td class="param_id">size_t <code class="ddoc_param">windowSize<uode></td> <td class="param_desc">Sliding�7indow size</td><zËr> <tr class="param"><td class="param_id">size_t�!�!code class="ddoc_param">stepSize</code><zËd> <td class="param_desc">Steps between the windows (by default 1)</td><zËr> <zËable><u(iv><u(iv> <div class="keyval Returns"><span class="key keyReturns">Returns:<ztpan>�!�!div class="val�6alReturns">Range of all sliding windows with�0ropagated bi-directionality, forwarding, random access, and slicing. <u(iv><u(iv> <div class="val"><p class="keyval Section"><span class="key keySection">Note</span> To avoid�0erformance overhead,�!�!a href="std_range_primitives.html#.isBidirectionalRange">bi-directionality</a> is only available�7hen <a href="std_range_primitives.html#.hasSlicing"><span class="d_inlinecode donthyphenate notranslate">std.range.primitives.hasSlicing</span><tæ> and <a href="std_range_primitives.html#.hasLength"><span class="d_inlinecode donthyphenate notranslate">std.range.primitives.hasLength</span><tæ> are true. <y:><u(iv> <div class="keyval SeeAlso"><span class="key keySeeAlso">See Also:</span> <div class="val valSeeAlso"><a href="#chunks"><span class="d_inlinecode donthyphenate notranslate">chunks<ztpan></a></div></div> <span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:<ztpan>�!�!div class="val�6alExamples">Iterate over ranges with�7indows <pre class="d_code notranslate"><span class="d_keyword">import<ztpan> std.algorithm.comparison : equal; <span class="d_keyword">assert</span>([0, 1, 2, �5p¹.<span class="d_psymbol">slide</span>(�(SA�).equal�V�Iqual( [[0, 1], [1, 2], [�(l4�) 2 2]] )); <span class="d_keyword">assert</span>(5.iota.<span class="d_psymbol">slide</span>(0Î0Ã0È.equal�V�Iqual( [[0, 1, �3�3, [1, �(l4�) 2 2], [�(l4�) 2 2, 4]] )); </pre> <u(iv><u(iv> <span class="dlang_runnable"><ztpan><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples">set a custom stepsize (default 1) <pre class="d_code notranslate"><span class="d_keyword">import<ztpan> std.algorithm.comparison : equal; <span class="d_keyword">assert</span>(6.iota.<span class="d_psymbol">slide</span>(1, 2).equal!equal( [[0], [�3�3, [4]] )); <span class="d_keyword">assert</span>(6.iota.<span class="d_psymbol">slide</span>(�(l4�) 2 2 2).equal!equal( [[0, o, [4, 5]] )); <span class="d_keyword">assert<ztpan>(iota(7).<span class="d_psymbol">slide</span>(�(l4�) 2).equal!equal( [[0, o, [2, �5p¹, [4, 5], [6]] )); <span class="d_keyword">assert</span>(iota(1�(SA�).<span class="d_psymbol">slide</span>(�(l4�) 2 2 2).equal!equal( [[0, o, [4, 5], [8, 9]] )); </pre> <u(iv><u(iv> <span class="dlang_runnable"><ztpan><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples">Allow�4he last slide to have fewer elements�4han windowSize <pre class="d_code notranslate"><span class="d_keyword">import<ztpan> std.algorithm.comparison : equal; <span class="d_keyword">assert</span>(0Ô0¢0¹0È0ëiota.<span class="d_psymbol">slide</span>!(No.withPartial)(4).empty); <span class="d_keyword">assert</span>(0Ô0¢0¹0È0ëiota.<span class="d_psymbol">slide</span>!(Yes.withPartial)(4).equal�V�Iqual( [[0, 1, �3�3] )); </pre> <u(iv><u(iv> <span class="dlang_runnable"><ztpan><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples">Count all�4he�0ossible substrings of length 2 <pre class="d_code notranslate"><span class="d_keyword">import<ztpan> std.algorithm.iteration : each; <span class="d_keyword">int<ztpan>[dstring] d; <span class="d_string">"AGAGA"d</span>.<span class="d_psymbol">slide<ztpan>�ZYes.withPartial)(2).each�Za => d[a]++); writeln(d);�!�!span class="d_comment">/Xë["AG"d:2, "GA"d:�3�3 <ztpan></pre> <u(iv><u(iv> <span class="dlang_runnable"><ztpan><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples">withPartial only has an effect if last element in�4he range doesn't have the full size <pre class="d_code notranslate"><span class="d_keyword">import</span> std.algorithm.comparison : equal; <span class="d_keyword">assert<ztpan>(5.iota.<span class="d_psymbol">slide<ztpan>�ZYes.withPartial)(3, 4).equal�V�Iqual([[0, 1, 2], [4]])); <span class="d_keyword">assert<ztpan>(6.iota.<span class="d_psymbol">slide<ztpan>�ZYes.withPartial)(3, 4).equal�V�Iqual([[0, 1, 2], [4, 5]])); <span class="d_keyword">assert</span>(7.iota.<span class="d_psymbol">slide</span>!(Yes.withPartial)(0Ñ0ü0Ä 2 2 2).equal!equal([[0, 1, �3�3, [4, 5, 5 5]])); <span class="d_keyword">assert<ztpan>(5.iota.<span class="d_psymbol">slide<ztpan>�ZNo.withPartial)(0Ñ0ü0Ä 2 2 2).equal!equal([[0, 1, �3�3])); <span class="d_keyword">assert<ztpan>(6.iota.<span class="d_psymbol">slide<ztpan>�ZNo.withPartial)(0Ñ0ü0Ä 2 2 2).equal!equal([[0, 1, �3�3])); <span class="d_keyword">assert<ztpan>(7.iota.<span class="d_psymbol">slide<ztpan>�ZNo.withPartial)(0Ñ0ü0Ä 2 2 2).equal!equal([[0, 1, �3�3, [4, 5, 5 5]])); </pre> <u(iv><u(iv> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".only"></span><div class="quickindex" id="quickindex.only"></div>auto�!�!span class="def-anchor" id="only"></span><code class="ddoc_psymbol">only</code><span class="template_param_list"�4itle="Template�0arameter list">(Values...)</span>(return scope Values <code class="ddoc_param">values<uode>)<br><span class="constraint">if (�Xs(CommonType�2 D�5alues ==�6oid))<ztpan>; <br><br>auto�!�!span class="def-anchor" id="only"></span><code class="ddoc_psymbol">only</code><span class="template_param_list"�4itle="Template�0arameter list">()<ztpan>(); <br></div></dt> <dd><div class="summary">Assemble <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">values</code><ztpan> into a range that carries all its elements in-situ. <u(iv><div class="description">Useful�7hen a single�6alue or multiple disconnected values must be�0assed to an algorithm expecting a range,�7ithout having to�0erform dynamic memory allocation. <div class="blankline"><u(iv> As copying the range means copying all elements, it can be safely returned from functions. For the same reason, copying the returned range may be expensive for a large number of arguments. <u(iv> <div class="keyval Parameters"><span class="key keyParameters">Parameters:</span> <div class="val valParameters"><table class="params"><tr class="param"><td class="param_id">Values�!�!code class="ddoc_param">values</code><zËd> <td class="param_desc">the values�4o assemble�4ogether<zËd></tr> </table></div></div> <div class="keyval Returns"><span class="key keyReturns">Returns:</span> <div class="val valReturns">A <span class="d_inlinecode donthyphenate notranslate">RandomAccessRange</span> of�4he assembled�6alues. <div class="blankline"></div> The returned range can be sliced. Its elements can be assigned�4o if every �4ype in�!�!span class="d_inlinecode donthyphenate notranslate">Values</span> supports assignment from�4he range's element�4ype. </div></div> <div class="keyval SeeAlso"><span class="key keySeeAlso">See Also:<ztpan>�!�!div class="val�6alSeeAlso"><a href="#chain"><span class="d_inlinecode donthyphenate notranslate">chain</span><tæ> to chain ranges<u(iv><u(iv> <span class="dlang_runnable"><ztpan><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples"><pre class="d_code notranslate"><span class="d_keyword">import<ztpan> std.algorithm.comparison : equal; <span class="d_keyword">import<ztpan> std.algorithm.iteration : filter, joiner, map; <span class="d_keyword">import</span> std.algorithm.searching : findSplitBefore; <span class="d_keyword">import<ztpan> std.uni : isUpper; <span class="d_keyword">assert<ztpan>(equal(<span class="d_psymbol">only<ztpan>('♡'),�!�!span class="d_string">"♡"<ztpan>)); writeln([1, �(l4�) 2 2, 4].findSplitBefore(<span class="d_psymbol">only<ztpan>(3))[0]); <span class="d_comment">]å [1, 2] </span> <span class="d_keyword">assert</span>(<span class="d_psymbol">only</span>(<span class="d_string">"one"</span>,�!�!span class="d_string">"two"<ztpan>, <span class="d_string">"three"</span>).joiner(<span class="d_string">" "</span>).equal(<span class="d_string">"one�4wo�4hree"<ztpan>)); string title = <span class="d_string">"The D Programming Language"<ztpan>; <span class="d_keyword">assert</span>(title .filter!isUpper <span class="d_comment">]å�4ake the upper case letters <ztpan> .mapÀspan class="d_psymbol">only<ztpan> �!�!span class="d_comment">/Xëmake each letter its own range <ztpan> .joiner(<span class="d_string">"."</span>) <span class="d_comment">]å join the ranges�4ogether lazily <ztpan> .equal(<span class="d_string">"T.D.P.L"<ztpan>)); </pre> <u(iv><u(iv> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".enumerate"><ztpan><div class="quickindex" id="quickindex.enumerate"></div>auto�!�!span class="def-anchor" id="enumerate"><ztpan><code class="ddoc_psymbol">enumerate</code><span class="template_param_list"�4itle="Template�0arameter list">(Enumerator = size_t, Range)<ztpan>(Range�!�!code class="ddoc_param">range<uode>, Enumerator�!�!code class="ddoc_param">start<uode> = 0)<br><span class="constraint">if (isIntegral�Dnumerator && isInputRange!Range)</span>; <br><u(iv><u(t> <dd><div class="summary">Iterate over�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">range</code><ztpan>�7ith an attached index variable. </div><div class="description">Each element is a�!�!a href="std_typecons.html#.Tuple"><span class="d_inlinecode donthyphenate notranslate">std.typecons.Tuple<ztpan></a> containing the index and the element, in that order, where the index member is named <span class="d_inlinecode donthyphenate notranslate">index</span> and the element member is named <span class="d_inlinecode donthyphenate notranslate">value</span>. <div class="blankline"></div> The index starts at <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">start<uode></span> and is incremented by one on every iteration. <u(iv> <div class="val"><p class="keyval Section"><span class="key keySection">Overflow</span> If�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">range</code><ztpan> has length,�4hen it is an error�4o pass a�6alue for�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">start</code><ztpan> so that�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">start</code> + <code class="ddoc_param">range</code>.length</span> is bigger than�!�!span class="d_inlinecode donthyphenate notranslate">Enumerator.max</span>,�4hus it is ensured that overflow cannot happen. <div class="blankline"></div> If�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">range</code><ztpan> does not have length, and�!�!span class="d_inlinecode donthyphenate notranslate">popFront</span> is called when �!�!span class="d_inlinecode donthyphenate notranslate">front.index == Enumerator.max<ztpan>, the index will overflow and continue from <span class="d_inlinecode donthyphenate notranslate">Enumerator.min<ztpan>. <y:><u(iv> <div class="keyval Parameters"><span class="key keyParameters">Parameters:</span> <div class="val valParameters"><table class="params"><tr class="param"><td class="param_id">Range <code class="ddoc_param">range</code><zËd> <td class="param_desc">the <a href="std_range_primitives.html#.isInputRange">input range<tæ> to attach indexes to</td><zËr> <tr class="param"><td class="param_id">Enumerator�!�!code class="ddoc_param">start<uode></td> <td class="param_desc">the number to start�4he index counter from<zËd></tr> </table></div></div> <div class="keyval Returns"><span class="key keyReturns">Returns:</span> <div class="val valReturns">At minimum, an input range. All other range primitives are given in the resulting range if�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">range</code><ztpan> has�4hem. The exceptions are the bidirectional primitives, which are propagated only if�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">range</code><ztpan> has length. </div></div> <div class="val"><p class="keyval Section"><span class="key keySection">Example</span> Useful for�5sing�!�!span class="d_inlinecode donthyphenate notranslate">foreach<ztpan>�7ith an index loop variable: <pre class="d_code notranslate"> <span class="d_keyword">import</span> std.stdio : stdin, stdout; �!�!span class="d_keyword">import<ztpan> std.<span class="d_param">range</span> : <span class="d_psymbol">enumerate<ztpan>; �!�!span class="d_keyword">foreach</span> (lineNum, line; stdin.byLine().<span class="d_psymbol">enumerate</span>(1)) stdout.writefln(<span class="d_string">"line #%s: %s"<ztpan>, lineNum, line); </pre> <y:><u(iv> <span class="dlang_runnable"><ztpan><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples">Can start enumeration from a negative�0osition: <pre class="d_code notranslate"><span class="d_keyword">import<ztpan> std.array : assocArray; <span class="d_keyword">import<ztpan> std.<span class="d_param">range</span> : <span class="d_psymbol">enumerate<ztpan>; <span class="d_keyword">bool<ztpan>[<span class="d_keyword">int</span>] aa = <span class="d_keyword">true</span>.repeat(3).<span class="d_psymbol">enumerate<ztpan>(-1).assocArray(); <span class="d_keyword">assert<ztpan>(aa[-1]); <span class="d_keyword">assert</span>(aa[0]); <span class="d_keyword">assert</span>(aa[1]); </pre> <u(iv><u(iv> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".isTwoWayCompatible"></span><div class="quickindex" id="quickindex.isTwoWayCompatible"></div>enum auto <span class="def-anchor" id="isTwoWayCompatible"><ztpan><code class="ddoc_psymbol">isTwoWayCompatible<uode>(alias fn, T1, T�(SA�); <br></div></dt> <dd><div class="summary"> Returns�4rue if�!�!span class="d_inlinecode donthyphenate notranslate">fn</span> accepts variables of�4ype T1 and T�(N��)in any order. The following code should compile: <pre class="d_code notranslate">(<span class="d_keyword">ref<ztpan> T1 a,�!�!span class="d_keyword">ref</span> T2 b) { fn(a, b); fn(b, a); } </pre> <u(iv><span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:<ztpan>�!�!div class="val�6alExamples"><pre class="d_code notranslate"><span class="d_keyword">void</span> func1(<span class="d_keyword">int<ztpan> a, <span class="d_keyword">int<ztpan> b); <span class="d_keyword">void<ztpan> func2(<span class="d_keyword">int</span> a,�!�!span class="d_keyword">float</span> b); <span class="d_keyword">static<ztpan>�!�!span class="d_keyword">assert<ztpan>(<span class="d_psymbol">isTwoWayCompatible<ztpan>�Zfunc1,�!�!span class="d_keyword">int</span>,�!�!span class="d_keyword">int</span>)); <span class="d_keyword">static<ztpan>�!�!span class="d_keyword">assert<ztpan>(<span class="d_psymbol">isTwoWayCompatible<ztpan>�Zfunc1,�!�!span class="d_keyword">short</span>,�!�!span class="d_keyword">int</span>)); <span class="d_keyword">static<ztpan>�!�!span class="d_keyword">assert<ztpan>(!<span class="d_psymbol">isTwoWayCompatible</span>!(func2, <span class="d_keyword">int<ztpan>, <span class="d_keyword">float<ztpan>)); <span class="d_keyword">void<ztpan> func3(<span class="d_keyword">ref</span> <span class="d_keyword">int<ztpan> a, <span class="d_keyword">ref<ztpan>�!�!span class="d_keyword">int</span> b); <span class="d_keyword">static</span> <span class="d_keyword">assert</span>(�!�!span class="d_psymbol">isTwoWayCompatible<ztpan>�Zfunc0Ñ0ü0Ä�!�!span class="d_keyword">int</span>,�!�!span class="d_keyword">int</span>)); <span class="d_keyword">static<ztpan>�!�!span class="d_keyword">assert<ztpan>(!<span class="d_psymbol">isTwoWayCompatible</span>!(func3, <span class="d_keyword">short<ztpan>, <span class="d_keyword">int<ztpan>)); </pre> <u(iv><u(iv> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".SearchPolicy"></span><div class="quickindex" id="quickindex.SearchPolicy"></div>enum�!�!span class="def-anchor" id="SearchPolicy"></span><code class="ddoc_psymbol">SearchPolicy</code>: int; <br></div></dt> <dd><div class="summary">Policy used�7ith the searching primitives�!�!span class="d_inlinecode donthyphenate notranslate">lowerBound</span>,�!�!span class="d_inlinecode donthyphenate notranslate"> �5pperBound<ztpan>, and <span class="d_inlinecode donthyphenate notranslate">equalRange<ztpan> of <a href="#SortedRange"><span class="d_inlinecode donthyphenate notranslate">SortedRange<ztpan></a> below.<u(iv><span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:<ztpan>�!�!div class="val�6alExamples"><pre class="d_code notranslate"><span class="d_keyword">import</span> std.algorithm.comparison : equal; <span class="d_keyword">auto<ztpan> a = assumeSorted([0, 1, 2, 0Ñ0ü0Ä 2 2 2, 5, 5 5, 7, 8, 9]); <span class="d_keyword">auto<ztpan>�01 = a.upperBound�Z<span class="d_psymbol">SearchPolicy</span>.binarySearch)(0Î0Ã0È; <span class="d_keyword">assert</span>(p1.equal([4, 5, 6, 5 5 5, 8, 9])); <span class="d_keyword">auto</span> p2 = a.lowerBound!(<span class="d_psymbol">SearchPolicy<ztpan>.gallop)(4); <span class="d_keyword">assert<ztpan>(p�(‘Ñ�)equal([0, 1, 2, �5p¹)); </pre> <u(iv><u(iv> <dl><dt class="d_decl"><div� <span class="def-anchor" id=".SearchPolicy.linear"><ztpan><div class="quickindex" id="quickindex.SearchPolicy.linear"></div><span class="def-anchor" id="linear"><ztpan><code class="ddoc_psymbol">linear<uode><br></div></dt> <dd><div class="summary">Searches in a linear fashion.</div> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".SearchPolicy.trot"><ztpan><div class="quickindex" id="quickindex.SearchPolicy.trot"></div><span class="def-anchor" id="trot"><ztpan><code class="ddoc_psymbol">trot<uode><br></div></dt> <dd><div class="summary">Searches with a step that is grows linearly (1, 2, 0Ñ0ü0Ä...) leading to a�iuadratic search schedule (indexes tried are 0, 1, 2 2, 6, 10, 15, 21, 28,...) Once the search overshoots its target, �4he remaining interval is searched using binary search. The search is completed in�!�!span class="bigoh">Ο(<span class="d_inlinecode donthyphenate notranslate">sqrt(n)<ztpan>)<ztpan>�4ime. Use it when�9ou are reasonably confident�4hat the value is around the beginning of the range.</div> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".SearchPolicy.gallop"><ztpan><div class="quickindex" id="quickindex.SearchPolicy.gallop"></div><span class="def-anchor" id="gallop"><ztpan><code class="ddoc_psymbol">gallop<uode><br></div></dt> <dd><div class="summary">Performs a <a href="https:/u0n.wikipedia.org/wikie¹xponential_search"> galloping search algorithm</a>, i.e. searches �7ith a step�4hat doubles every time, (1, �(l4�) 2 2 2, 8, ...) leading to an exponential search schedule (indexes�4ried are 0, 1, 2 2, 5 5 5, ¬, 0Ó0ë, 63,...) Once�4he search overshoots its�4arget,�4he remaining interval is searched�5sing binary search. A value is found in�!�!span class="bigoh">Ο(<span class="d_inlinecode donthyphenate notranslate">log(n)</span>)</span> time.<u(iv> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".SearchPolicy.binarySearch"></span><div class="quickindex" id="quickindex.SearchPolicy.binarySearch"><u(iv><span class="def-anchor" id="binarySearch"></span><code class="ddoc_psymbol">binarySearch</code><br><u(iv><u(t> <dd><div class="summary">Searches�5sing a classic interval halving policy. The search starts in the middle of the range, and each search step cuts the range in half. This policy finds a�6alue in <span class="bigoh">Ο(<span class="d_inlinecode donthyphenate notranslate">log(n)<ztpan>)<ztpan> time but is less cache friendly than�!�!span class="d_inlinecode donthyphenate notranslate">gallop</span> for large ranges. The�!�!span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="binarySearch"><ztpan><code class="ddoc_psymbol">binarySearch<uode></span> policy is used as the last step of <span class="d_inlinecode donthyphenate notranslate">trot<ztpan>, <span class="d_inlinecode donthyphenate notranslate">gallop<ztpan>, <span class="d_inlinecode donthyphenate notranslate">trotBackwards</span>, and�!�!span class="d_inlinecode donthyphenate notranslate"> gallopBackwards</span> strategies.<u(iv> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".SearchPolicy.trotBackwards"><ztpan><div class="quickindex" id="quickindex.SearchPolicy.trotBackwards"><u(iv><span class="def-anchor" id="trotBackwards"><ztpan><code class="ddoc_psymbol">trotBackwards</code><br><u(iv><u(t> <dd><div class="summary">Similar to�!�!span class="d_inlinecode donthyphenate notranslate">trot</span> but starts backwards. Use it�7hen confident�4hat the value is around the end of�4he range.<u(iv> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".SearchPolicy.gallopBackwards"><ztpan><div class="quickindex" id="quickindex.SearchPolicy.gallopBackwards"><u(iv><span class="def-anchor" id="gallopBackwards"><ztpan><code class="ddoc_psymbol">gallopBackwards</code><br><u(iv><u(t> <dd><div class="summary">Similar to�!�!span class="d_inlinecode donthyphenate notranslate">gallop</span> but starts backwards. Use it�7hen confident�4hat the value is around the end of�4he range.<u(iv> </dd> </dl> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".SortedRangeOptions"><ztpan><div class="quickindex" id="quickindex.SortedRangeOptions"><u(iv>enum <span class="def-anchor" id="SortedRangeOptions"><ztpan><code class="ddoc_psymbol">SortedRangeOptions<uode>: int; <br><u(iv><u(t> <dd><div class="summary">Options for <a href="#SortedRange"><span class="d_inlinecode donthyphenate notranslate">SortedRange<ztpan></a> ranges (below).</div><span class="dlang_runnable"><ztpan><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples"><pre class="d_code notranslate"><span class="d_comment">/Xëcreate a SortedRange, that's checked strictly </span>SortedRange�Z<span class="d_keyword">int<ztpan>[],<span class="d_string">"a�.�.�.lt; b"</span>,�!�!span class="d_psymbol">SortedRangeOptions<ztpan>.checkStrictly)([ 1, 2 2, 5, 5 5 5, 9 ]); </pre> <u(iv><u(iv> <dl><dt class="d_decl"><div� <span class="def-anchor" id=".SortedRangeOptions.assumeSorted"><ztpan><div class="quickindex" id="quickindex.SortedRangeOptions.assumeSorted"></div><span class="def-anchor" id="assumeSorted"><ztpan><code class="ddoc_psymbol">assumeSorted<uode><br></div></dt> <dd><div class="summary">Assume,�4hat the range is sorted without checking.<u(iv> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".SortedRangeOptions.checkStrictly"><ztpan><div class="quickindex" id="quickindex.SortedRangeOptions.checkStrictly"><u(iv><span class="def-anchor" id="checkStrictly"><ztpan><code class="ddoc_psymbol">checkStrictly</code><br><u(iv><u(t> <dd><div class="summary">All elements of the range are checked to be sorted. The check is�0erformed in O(n)�4ime.</div> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".SortedRangeOptions.checkRoughly"><ztpan><div class="quickindex" id="quickindex.SortedRangeOptions.checkRoughly"></div><span class="def-anchor" id="checkRoughly"><ztpan><code class="ddoc_psymbol">checkRoughly<uode><br></div></dt> <dd><div class="summary">Some elements of the range are checked to be sorted. For ranges�7ith random order, this�7ill almost surely detect, that it is not sorted. For almost sorted ranges it's more likely�4o fail. The checked elements are choosen in a deterministic manner, which makes this check reproducable. The check is performed in O(log(n))�4ime.</div> <u(d> <u(l> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".SortedRange"><ztpan><div class="quickindex" id="quickindex.SortedRange"></div>struct�!�!span class="def-anchor" id="SortedRange"><ztpan><code class="ddoc_psymbol">SortedRange</code>(Range, alias�0red = "a�.�.�.lt; b", SortedRangeOptions opt = SortedRangeOptions.assumeSorted) if (isInputRange�1 D�1�0ange�.�.�.amp;& �XsInstanceOf!(<span class="def-anchor" id="SortedRange"><ztpan><code class="ddoc_psymbol">SortedRange</code>, Range)); <br><br>template�!�!span class="def-anchor" id="SortedRange"><ztpan><code class="ddoc_psymbol">SortedRange</code>(Range, alias�0red = "a�.�.�.lt; b", SortedRangeOptions opt = SortedRangeOptions.assumeSorted) if (isInstanceOf�Z<span class="def-anchor" id="SortedRange"></span><code class="ddoc_psymbol">SortedRange<uode>, Range))<br><u(iv><u(t> <dd><div class="summary">Represents a sorted range.�!�?n addition�4o the regular range �0rimitives, supports additional operations that�4ake advantage of�4he ordering, such as merge and binary search. To obtain a�!�!span class="d_inlinecode donthyphenate notranslate"> SortedRange</span> from an unsorted range�!�!span class="d_inlinecode donthyphenate notranslate">r<ztpan>, use �!�!a href="std_algorithm_sorting.html#.sort"><span class="d_inlinecode donthyphenate notranslate">std.algorithm.sorting.sort<ztpan></a>�7hich sorts�!�!span class="d_inlinecode donthyphenate notranslate">r<ztpan> in place and returns the corresponding�!�!span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="SortedRange"></span><code class="ddoc_psymbol">SortedRange<uode></span>. To construct a <span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="SortedRange"><ztpan><code class="ddoc_psymbol">SortedRange</code><ztpan> from a range �!�!span class="d_inlinecode donthyphenate notranslate">r<ztpan>�4hat is known�4o be already sorted,�5se�!�!a href="#assumeSorted"><span class="d_inlinecode donthyphenate notranslate">assumeSorted</span><tæ>. <u(iv><div class="keyval Parameters"><span class="key keyParameters">Parameters:<ztpan>�!�!div class="val�6alParameters"><table class="params"></table></div></div> <span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:<ztpan>�!�!div class="val�6alExamples"><pre class="d_code notranslate"><span class="d_keyword">import</span> std.algorithm.sorting : sort; <span class="d_keyword">auto</span> a = [ 1, 2, 0Ñ0ü0Ä 2 2 2�(l4�) 5�(l4�) 5 54 ]; <span class="d_keyword">auto<ztpan> r = assumeSorted(a); <span class="d_keyword">assert</span>(r.contains(3)); <span class="d_keyword">assert</span>(�Z0Õ0¡0é0Ã0É�!�!span class="d_keyword">in<ztpan> r)); <span class="d_keyword">auto</span> r1 = sort!<span class="d_string">"a > b"<ztpan>(a); <span class="d_keyword">assert<ztpan>(3�!�!span class="d_keyword">in<ztpan> r1); <span class="d_keyword">assert</span>(�i�i�i1.contains(3�(SA�)); writeln(r1.release()); <span class="d_comment">]å [64, 52, 42, 0Ñ0ü0Ä 2, o <ztpan></pre> <u(iv><u(iv> <span class="dlang_runnable"><ztpan><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples"><span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="SortedRange"></span><code class="ddoc_psymbol">SortedRange<uode></span> could accept ranges weaker�4han random-access, but it is�5nable to�0rovide interesting functionality for�4hem. Therefore, <span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="SortedRange"><ztpan><code class="ddoc_psymbol">SortedRange</code><ztpan> is currently restricted�4o random-access ranges. <div class="blankline"><u(iv> No copy of the original range is ever made.�!�?f the underlying range is changed concurrently�7ith its corresponding <span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="SortedRange"><ztpan><code class="ddoc_psymbol">SortedRange</code><ztpan> in ways that break its sorted-ness,�!�!span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="SortedRange"></span><code class="ddoc_psymbol">SortedRange<uode></span> will�7ork erratically. <pre class="d_code notranslate"><span class="d_keyword">import<ztpan> std.algorithm.mutation : swap; <span class="d_keyword">auto</span> a = [ 1, 2, 0Ñ0ü0Ä 2 2 2�(l4�) 5�(l4�) 5 54 ]; <span class="d_keyword">auto<ztpan> r = assumeSorted(a); <span class="d_keyword">assert</span>(r.contains(4�(SA�)); swap(a[�5p¹, a[5]); �!�!span class="d_comment">/Xëillegal to break sortedness of original range </span><span class="d_keyword">assert<ztpan>(!r.contains(4�(SA�)); <span class="d_comment">]å�0asses although it shouldn't </span><y:re> </div></div> <span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:<ztpan>�!�!div class="val�6alExamples"><span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="SortedRange"><ztpan><code class="ddoc_psymbol">SortedRange</code><ztpan> can be searched�7ith predicates�4hat do not�4ake two elements of the underlying range as arguments. <div class="blankline"></div> This is useful, if a range of structs is sorted by a member and you want�4o search in that range by only�0roviding a�6alue for�4hat member. <div class="blankline"><u(iv> <pre class="d_code notranslate"><span class="d_keyword">import<ztpan> std.algorithm.comparison : equal; <span class="d_keyword">static<ztpan>�!�!span class="d_keyword">struct<ztpan> S"�!�!span class="d_keyword">int</span> i;�( <span class="d_keyword">static<ztpan>�!�!span class="d_keyword">bool<ztpan> byI(A, B)(A a, B b) { �!�!span class="d_keyword">static<ztpan>�!�!span class="d_keyword">if<ztpan> (<span class="d_keyword">is</span>(A == S)) �!�!span class="d_keyword">return<ztpan> a.i�.�.�.lt; b; �!�!span class="d_keyword">else<ztpan> �!�!span class="d_keyword">return<ztpan> a�.�.�.lt; b.i; } <span class="d_keyword">auto<ztpan> r = assumeSorted!byI([S(1), S(2), S(3)]); <span class="d_keyword">auto<ztpan> lessThanTwo = r.lowerBound(�(SA�); <span class="d_keyword">assert</span>(equal(lessThanTwo, [S(1)])); <y:re> </div></div> <dl><dt class="d_decl"><div ><span class="def-anchor" id=".SortedRange.empty"></span><div class="quickindex" id="quickindex.SortedRange.empty"><u(iv>@property bool <span class="def-anchor" id="empty"></span><code class="ddoc_psymbol">empty<uode>(); <br><br><span class="def-anchor" id=".SortedRange.save"></span><div class="quickindex" id="quickindex.SortedRange.save"></div>@property auto�!�!span class="def-anchor" id="save"></span><code class="ddoc_psymbol">save</code>(); <br><br><span class="def-anchor" id=".SortedRange.front"></span><div class="quickindex" id="quickindex.SortedRange.front"><u(iv>@property ref auto <span class="def-anchor" id="front"></span><code class="ddoc_psymbol">front<uode>(); <br><br><span class="def-anchor" id=".SortedRange.popFront"></span><div class="quickindex" id="quickindex.SortedRange.popFront"></div>void�!�!span class="def-anchor" id="popFront"></span><code class="ddoc_psymbol">popFront</code>(); <br><br><span class="def-anchor" id=".SortedRange.back"><ztpan><div class="quickindex" id="quickindex.SortedRange.back"><u(iv>@property ref auto <span class="def-anchor" id="back"><ztpan><code class="ddoc_psymbol">back<uode>(); <br><br><span class="def-anchor" id=".SortedRange.popBack"><ztpan><div class="quickindex" id="quickindex.SortedRange.popBack"></div>void�!�!span class="def-anchor" id="popBack"><ztpan><code class="ddoc_psymbol">popBack</code>(); <br><br><span class="def-anchor" id=".SortedRange.opIndex"></span><div class="quickindex" id="quickindex.SortedRange.opIndex"><u(iv>ref auto <span class="def-anchor" id="opIndex"></span><code class="ddoc_psymbol">opIndex<uode>(size_t <code class="ddoc_param">i</code>); <br><br><span class="def-anchor" id=".SortedRange.opSlice"><ztpan><div class="quickindex" id="quickindex.SortedRange.opSlice"></div>auto�!�!span class="def-anchor" id="opSlice"><ztpan><code class="ddoc_psymbol">opSlice</code>(size_t�!�!code class="ddoc_param">a<uode>, size_t�!�!code class="ddoc_param">b<uode>) return scope; <br></div></dt> <dd><div class="summary">Range�0rimitives.</div> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".SortedRange.release"><ztpan><div class="quickindex" id="quickindex.SortedRange.release"></div>auto�!�!span class="def-anchor" id="release"><ztpan><code class="ddoc_psymbol">release</code>() return scope; <br></div></dt> <dd><div class="summary">Releases the controlled range and returns it. <u(iv><div class="description">This does the opposite of <a href="#assumeSorted"><span class="d_inlinecode donthyphenate notranslate">assumeSorted<ztpan></a>: instead of�4urning a range into a <span class="d_inlinecode donthyphenate notranslate">SortedRange</span>, it extracts�4he original range back out of the <span class="d_inlinecode donthyphenate notranslate">SortedRange</span> using <a href="move_std_algorithm_mutation.html#."><span class="d_inlinecode donthyphenate notranslate">move.std.algorithm.mutation<ztpan></a>.<u(iv> <span class="dlang_runnable"><ztpan><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples"><pre class="d_code notranslate"><span class="d_keyword">import<ztpan> std.algorithm.sorting : sort; <span class="d_keyword">int</span>[�5p¹ data = [ 1, 2, 0µ0ó0Á0ü0à]; <span class="d_keyword">auto<ztpan> a = assumeSorted(data[]); writeln(a);�!�!span class="d_comment">/Xësort�T�Ma < b"(data[]) </span><span class="d_keyword">int</span>[] p = a.<span class="d_psymbol">release<ztpan>(); writeln(p); <span class="d_comment">]å [1, 2, �5p¹ <ztpan></pre> <u(iv><u(iv> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".SortedRange.lowerBound"></span><div class="quickindex" id="quickindex.SortedRange.lowerBound"></div>auto�!�!span class="def-anchor" id="lowerBound"></span><code class="ddoc_psymbol">lowerBound</code><span class="template_param_list"�4itle="Template�0arameter list">(SearchPolicy sp = SearchPolicy.binarySearch, V)<ztpan>(V�!�!code class="ddoc_param">value<uode>)<br><span class="constraint">if (isTwoWayCompatible�ZpredFun, ElementType�1 D�1�0ange, V)�.�.�.amp;& hasSlicing�1 D�1�0ange)<ztpan>; <br></div></dt> <dd><div class="summary">This function�5ses a search�7ith policy�!�!span class="d_inlinecode donthyphenate notranslate">sp</span> to find the largest left subrange on which <span class="d_inlinecode donthyphenate notranslate">pred(x,�6alue)<ztpan> is <span class="d_inlinecode donthyphenate notranslate">true<ztpan> for all <span class="d_inlinecode donthyphenate notranslate">x</span> (e.g., if <span class="d_inlinecode donthyphenate notranslate">pred<ztpan> is "less than"+"+ returns�4he�0ortion of �4he range�7ith elements strictly smaller than�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">value</code><ztpan>). The search schedule and its complexity are documented in <a href="#SearchPolicy"><span class="d_inlinecode donthyphenate notranslate">SearchPolicy<ztpan></a>.<u(iv><span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:<ztpan>�!�!div class="val�6alExamples"><pre class="d_code notranslate"><span class="d_keyword">import</span> std.algorithm.comparison : equal; <span class="d_keyword">auto</span> a = assumeSorted([ 0, 1, 2, 0Ñ0ü0Ä 2 2 2, 5, 5 5, 7, 8, 9 ]); <span class="d_keyword">auto</span> p = a.<span class="d_psymbol">lowerBound</span>(4); <span class="d_keyword">assert</span>(equal(p, [ 0, 1, 2, 0µ0ó0Á0ü0à])); <y:re> </div></div> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".SortedRange.upperBound"><ztpan><div class="quickindex" id="quickindex.SortedRange.upperBound"><u(iv>auto <span class="def-anchor" id="upperBound"><ztpan><code class="ddoc_psymbol">upperBound<uode><span class="template_param_list" title="Template parameter list">(SearchPolicy sp = SearchPolicy.binarySearch, V)</span>(V <code class="ddoc_param">value</code>)<br><span class="constraint">if (isTwoWayCompatible!(predFun, ElementType!Range, V))</span>; <br><u(iv><u(t> <dd><div class="summary">This function searches�7ith policy�!�!span class="d_inlinecode donthyphenate notranslate">sp</span> to find the largest right subrange on which <span class="d_inlinecode donthyphenate notranslate">pred(value,�8)<ztpan> is <span class="d_inlinecode donthyphenate notranslate">true<ztpan> for all�!�!span class="d_inlinecode donthyphenate notranslate">x<ztpan> (e.g., if�!�!span class="d_inlinecode donthyphenate notranslate">pred</span> is "less�4han", returns the portion of�4he range with elements strictly greater than�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">value</code><ztpan>). The search schedule and its complexity are documented in <a href="#SearchPolicy"><span class="d_inlinecode donthyphenate notranslate">SearchPolicy<ztpan></a>. </div><div class="description">For ranges that do not offer random access,�!�!span class="d_inlinecode donthyphenate notranslate">SearchPolicy.linear<ztpan> is the only�0olicy allowed (and it must be specified explicitly lest it exposes user code�4o unexpected inefficiencies). For random-access searches, all policies are allowed, and <span class="d_inlinecode donthyphenate notranslate">SearchPolicy.binarySearch</span> is�4he default.<u(iv> <span class="dlang_runnable"><ztpan><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples"><pre class="d_code notranslate"><span class="d_keyword">import<ztpan> std.algorithm.comparison : equal; <span class="d_keyword">auto<ztpan> a = assumeSorted([ 1, 2, 0Ñ0ü0Ä 2 2, 0Ñ0ü0Ä 2 2 2, 4, 5, 6 ]); <span class="d_keyword">auto</span> p = a.<span class="d_psymbol">upperBound</span>(0Î0Ã0È; <span class="d_keyword">assert</span>(equal(p, [4, 2 2 2, 5, 5 5])); <y:re> </div></div> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".SortedRange.equalRange"><ztpan><div class="quickindex" id="quickindex.SortedRange.equalRange"><u(iv>auto <span class="def-anchor" id="equalRange"><ztpan><code class="ddoc_psymbol">equalRange<uode><span class="template_param_list" title="Template parameter list">(V)<ztpan>(V�!�!code class="ddoc_param">value<uode>)<br><span class="constraint">if (isTwoWayCompatible�ZpredFun, ElementType�1 D�1�0ange, V)�.�.�.amp;& isRandomAccessRange!Range)</span>; <br><u(iv><u(t> <dd><div class="summary">Returns the subrange containing all elements�!�!span class="d_inlinecode donthyphenate notranslate">e<ztpan> for�7hich both <span class="d_inlinecode donthyphenate notranslate"> pred(e, value)</span> and <span class="d_inlinecode donthyphenate notranslate">pred(value, e)<ztpan> evaluate to�!�!span class="d_inlinecode donthyphenate notranslate">false<ztpan> (e.g., if <span class="d_inlinecode donthyphenate notranslate">pred<ztpan> is "less than"+"+ returns�4he�0ortion of the range with elements equal�4o <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">value<uode></span>). Uses a classic binary search�7ith interval halving until it finds a�6alue�4hat satisfies the condition, then�5ses <span class="d_inlinecode donthyphenate notranslate">SearchPolicy.gallopBackwards<ztpan>�4o find�4he left boundary and <span class="d_inlinecode donthyphenate notranslate">SearchPolicy.gallop</span> to find the right boundary. These �0olicies are justified by�4he fact that�4he�4wo boundaries are likely to be near�4he first found�6alue (i.e., equal ranges are relatively small). Completes�4he entire search in <span class="bigoh">Ο(<span class="d_inlinecode donthyphenate notranslate">log(n)<ztpan>)<ztpan>�4ime.</div><span class="dlang_runnable"><ztpan><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples"><pre class="d_code notranslate"><span class="d_keyword">import<ztpan> std.algorithm.comparison : equal; <span class="d_keyword">auto<ztpan> a = [ 1, �(l4�) 2 2, 0Ñ0ü0Ä 2 2, 4, 2 2 2, 5, 5 5 ]; <span class="d_keyword">auto</span> r = a.assumeSorted.<span class="d_psymbol">equalRange<ztpan>(3); <span class="d_keyword">assert<ztpan>(equal(r, [ 0Ñ0ü0Ä 2 2, 0µ0ó0Á0ü0à])); <y:re> </div></div> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".SortedRange.trisect"></span><div class="quickindex" id="quickindex.SortedRange.trisect"><u(iv>auto <span class="def-anchor" id="trisect"></span><code class="ddoc_psymbol">trisect<uode><span class="template_param_list" title="Template parameter list">(V)<ztpan>(V�!�!code class="ddoc_param">value<uode>)<br><span class="constraint">if (isTwoWayCompatible�ZpredFun, ElementType�1 D�1�0ange, V)�.�.�.amp;& isRandomAccessRange!Range && hasLength�1 D�1�0ange)<ztpan>; <br></div></dt> <dd><div class="summary">Returns a�4uple�!�!span class="d_inlinecode donthyphenate notranslate">r<ztpan> such that�!�!span class="d_inlinecode donthyphenate notranslate">r[0]</span> is�4he same as�4he result of�!�!span class="d_inlinecode donthyphenate notranslate">lowerBound(<code class="ddoc_param">value<uode>)<ztpan>, <span class="d_inlinecode donthyphenate notranslate">r[1]<ztpan> is the same as the result of <span class="d_inlinecode donthyphenate notranslate">equalRange(value)</span>, and�!�!span class="d_inlinecode donthyphenate notranslate">r[�3�3</span> is�4he same as�4he result of�!�!span class="d_inlinecode donthyphenate notranslate">upperBound(value)<ztpan>. The call is faster�4han computing all three separately. Uses a search schedule similar�4o <span class="d_inlinecode donthyphenate notranslate">equalRange<ztpan>. Completes the entire search in�!�!span class="bigoh">Ο(<span class="d_inlinecode donthyphenate notranslate">log(n)</span>)</span> time.<u(iv><span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:<ztpan>�!�!div class="val�6alExamples"><pre class="d_code notranslate"><span class="d_keyword">import</span> std.algorithm.comparison : equal; <span class="d_keyword">auto</span> a = [ 1, 2, 0Ñ0ü0Ä 2 2, 0Ñ0ü0Ä 2 2 2, 4, 5, 6 ]; <span class="d_keyword">auto<ztpan> r = assumeSorted(a).<span class="d_psymbol">trisect</span>(0Î0Ã0È; <span class="d_keyword">assert</span>(equal(r[0], [ 1, 2 ])); <span class="d_keyword">assert</span>(equal(r[o, [ 0Ñ0ü0Ä 2 2, 0µ0ó0Á0ü0à])); <span class="d_keyword">assert<ztpan>(equal(r[2], [ 2 2 2, 4, 5, 6 ])); <y:re> </div></div> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".SortedRange.contains"><ztpan><div class="quickindex" id="quickindex.SortedRange.contains"><u(iv>bool <span class="def-anchor" id="contains"><ztpan><code class="ddoc_psymbol">contains<uode><span class="template_param_list" title="Template parameter list">(V)<ztpan>(V�!�!code class="ddoc_param">value<uode>)<br><span class="constraint">if (isRandomAccessRange!Range)</span>; <br><u(iv><u(t> <dd><div class="summary">Returns <span class="d_inlinecode donthyphenate notranslate">true<ztpan> if and only if <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">value<uode></span> can be found in <span class="d_inlinecode donthyphenate notranslate">range</span>,�7hich is assumed to be sorted. Performs�!�!span class="bigoh">Ο(<span class="d_inlinecode donthyphenate notranslate">log(r.length)<ztpan>)<ztpan> evaluations of <span class="d_inlinecode donthyphenate notranslate">pred<ztpan>.<u(iv> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".SortedRange.opBinaryRight"></span><div class="quickindex" id="quickindex.SortedRange.opBinaryRight"><u(iv>bool <span class="def-anchor" id="opBinaryRight"></span><code class="ddoc_psymbol">opBinaryRight<uode><span class="template_param_list" title="Template parameter list">(string op, V)</span>(V <code class="ddoc_param">value</code>)<br><span class="constraint">if (op == "in" && isRandomAccessRange�1 D�1�0ange)<ztpan>; <br></div></dt> <dd><div class="summary">Like <span class="d_inlinecode donthyphenate notranslate">contains<ztpan>, but the value is specified before the range.</div> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".SortedRange.groupBy"><ztpan><div class="quickindex" id="quickindex.SortedRange.groupBy"></div>auto�!�!span class="def-anchor" id="groupBy"><ztpan><code class="ddoc_psymbol">groupBy</code><span class="template_param_list"�4itle="Template�0arameter list">()<ztpan>(); <br></div></dt> <dd><div class="summary">Returns a range of subranges of elements that are equivalent according to�4he sorting relation.</div> <u(d> <u(l> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".assumeSorted"></span><div class="quickindex" id="quickindex.assumeSorted"></div>auto�!�!span class="def-anchor" id="assumeSorted"></span><code class="ddoc_psymbol">assumeSorted</code><span class="template_param_list"�4itle="Template�0arameter list">(alias pred = "a < b"+"+ R)<ztpan>(R�!�!code class="ddoc_param">r<uode>)<br><span class="constraint">if (isInputRange�ZUnqual�1 D�1�0))</span>; <br><u(iv><u(t> <dd><div class="summary">Assumes <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">r<uode></span> is sorted by�0redicate�!�!span class="d_inlinecode donthyphenate notranslate">pred</span> and returns the corresponding <span class="d_inlinecode donthyphenate notranslate">SortedRange�Zpred, R)</span> having�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">r</code><ztpan> as support. To check for sorted-ness at cost <span class="bigoh">Ο(<span class="d_inlinecode donthyphenate notranslate">n</span>)</span>,�5se�!�!a href="std_algorithm_sorting.html#.isSorted"><span class="d_inlinecode donthyphenate notranslate">std.algorithm.sorting.isSorted<ztpan></a>.<u(iv><span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:<ztpan>�!�!div class="val�6alExamples"><pre class="d_code notranslate"><span class="d_keyword">import</span> std.algorithm.comparison : equal; <span class="d_keyword">int</span>[] a = [0, 1, 2, 0Ñ0ü0Ä 2 2 2, 5, 5 5, 7, 8, 9]; <span class="d_keyword">auto</span> p = <span class="d_psymbol">assumeSorted</span>(a); <span class="d_keyword">assert<ztpan>(equal(p.lowerBound(4), [0, 1, 2, �5p¹)); <span class="d_keyword">assert</span>(equal(p.lowerBound(5), [0, 1, �(l4�) 2 2, 4])); <span class="d_keyword">assert</span>(equal(p.lowerBound(6), [0, 1, �(l4�) 2 2, 4, 5])); <span class="d_keyword">assert<ztpan>(equal(p.lowerBound(6.9), [0, 1, 2, 0Ñ0ü0Ä 2 2 2, 5, 5 5])); <y:re> </div></div> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".RefRange"><ztpan><div class="quickindex" id="quickindex.RefRange"><u(iv>struct <span class="def-anchor" id="RefRange"><ztpan><code class="ddoc_psymbol">RefRange<uode>(R) if (isInputRange�1 D�1�0); <br><br><span class="def-anchor" id=".refRange"><ztpan><div class="quickindex" id="quickindex.refRange"><u(iv>auto <span class="def-anchor" id="refRange"><ztpan><code class="ddoc_psymbol">refRange<uode><span class="template_param_list" title="Template parameter list">(R)<ztpan>(R* <code class="ddoc_param">range</code>)<br><span class="constraint">if (isInputRange!R)</span>; <br><u(iv><u(t> <dd><div class="summary">Wrapper which effectively makes it�0ossible to�0ass a range by reference. Both�4he original range and the RefRange�7ill always have the exact same elements. Any operation done on one�7ill affect�4he other. So, for instance, if it's passed�4o a function�7hich�7ould implicitly copy�4he original range if it were�0assed to it,�4he original range is�!�!i>not<v}> copied but is consumed as if it were a reference�4ype. <u(iv><div class="val"><p class="keyval Section"><span class="key keySection">Note<ztpan> <span class="d_inlinecode donthyphenate notranslate">save</span> works as normal and operates on a new range, so if �!�!span class="d_inlinecode donthyphenate notranslate">save</span> is ever called on the <span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="RefRange"></span><code class="ddoc_psymbol">RefRange</code><ztpan>, then no operations on the saved range will affect the original. <y:><u(iv> <div class="keyval Parameters"><span class="key keyParameters">Parameters:</span> <div class="val valParameters"><table class="params"><tr class="param"><td class="param_id">R*�!�!code class="ddoc_param">range<uode></td> <td class="param_desc">the range�4o construct the <span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="RefRange"></span><code class="ddoc_psymbol">RefRange</code><ztpan> from<zËd></tr> </table></div></div> <div class="keyval Returns"><span class="key keyReturns">Returns:</span> <div class="val valReturns">A <span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="RefRange"></span><code class="ddoc_psymbol">RefRange</code><ztpan>. If�4he given range is a class type (and thus is already a reference type),�4hen the original range is returned rather than a�!�!span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="RefRange"><ztpan><code class="ddoc_psymbol">RefRange<uode></span>.</div></div> <span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:<ztpan>�!�!div class="val�6alExamples">Basic Example <pre class="d_code notranslate"><span class="d_keyword">import</span> std.algorithm.searching : find; <span class="d_keyword">ubyte<ztpan>[] buffer = [1, 9, 2 2 25, 1�(l4�) 2�3�3; <span class="d_keyword">auto</span> found1 = find(buffer, 45); writeln(found1); <span class="d_comment">]å [45, , �(g �)] </span>writeln(buffer); <span class="d_comment">]å [1, 9, 45, , �(g �)] </span> <span class="d_keyword">auto</span> wrapped1 =�!�!span class="d_psymbol">refRange<ztpan>(&buffer); <span class="d_keyword">auto<ztpan> found�(N��)= find(wrapped1, 2 2 25); writeln(*found�(‘Ñ�)ptr); <span class="d_comment">]å [45, , �(g �)] </span>writeln(buffer); <span class="d_comment">]å [45, , �(g �)] </span> <span class="d_keyword">auto</span> found3 = find(wrapped1.save, 2�(SA�); writeln(*found0Ô0¢0¹0È0ëptr); <span class="d_comment">]å [�(g �)] </span>writeln(buffer); <span class="d_comment">]å [45, , �(g �)] </span> string str =�!�!span class="d_string">"hello�7orld"<ztpan>; <span class="d_keyword">auto</span> wrappedStr =�!�!span class="d_psymbol">refRange<ztpan>(&str); writeln(str.front); <span class="d_comment">]å 'h' <ztpan>str.popFrontN(5); writeln(str); <span class="d_comment">]å "�7orld" </span>writeln(wrappedStr.front); <span class="d_comment">]å ' ' <ztpan>writeln(*wrappedStr.ptr); <span class="d_comment">]å "�7orld" </span><y:re> </div></div> <span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:<ztpan>�!�!div class="val�6alExamples">opAssign Example. <pre class="d_code notranslate"><span class="d_keyword">ubyte<ztpan>[] buffer1 = [1, 2, 0Ñ0ü0Ä 2 2 2, 5]; <span class="d_keyword">ubyte<ztpan>[] buffer2 = [6, 5 5 5, 8, 9, 10]; <span class="d_keyword">auto<ztpan>�7rapped1 = <span class="d_psymbol">refRange</span>(&buffer1); <span class="d_keyword">auto<ztpan>�7rapped�(N��)= <span class="d_psymbol">refRange</span>(&buffer2); <span class="d_keyword">assert<ztpan>(wrapped1.ptr <span class="d_keyword">is</span> &buffer1); <span class="d_keyword">assert<ztpan>(wrapped�(‘Ñ�)ptr <span class="d_keyword">is</span> &buffer2); <span class="d_keyword">assert<ztpan>(wrapped1.ptr Àspan class="d_keyword">is<ztpan>�7rapped�(‘Ñ�)ptr); <span class="d_keyword">assert</span>(buffer1 ³ buffer2); wrapped1 =�7rapped�([f�) <span class="d_comment">]åEverything�0oints to�4he same stuff as before. <ztpan><span class="d_keyword">assert</span>(wrapped1.ptr�!�!span class="d_keyword">is<ztpan>�.�.�.amp;buffer1); <span class="d_keyword">assert</span>(wrapped2.ptr�!�!span class="d_keyword">is<ztpan>�.�.�.amp;buffer�(SA�); <span class="d_keyword">assert</span>(wrapped1.ptr !<span class="d_keyword">is</span> wrapped2.ptr); <span class="d_comment">]åBut buffer1 has changed due to�4he assignment. <ztpan>writeln(buffer1); <span class="d_comment">]å [6, 5 5 5, 8, 9, 10] </span>writeln(buffer2);�!�!span class="d_comment">/Xë[6, 7, 8, 9, 10] <ztpan> buffer2 = [�, , ª, , ¬]; <span class="d_comment">]åEverything�0oints to�4he same stuff as before. <ztpan><span class="d_keyword">assert</span>(wrapped1.ptr�!�!span class="d_keyword">is<ztpan>�.�.�.amp;buffer1); <span class="d_keyword">assert</span>(wrapped2.ptr�!�!span class="d_keyword">is<ztpan>�.�.�.amp;buffer�(SA�); <span class="d_keyword">assert</span>(wrapped1.ptr !<span class="d_keyword">is</span> wrapped2.ptr); <span class="d_comment">]åBut buffer�(N��)has changed due to�4he assignment. <ztpan>writeln(buffer1); <span class="d_comment">]å [6, 5 5 5, 8, 9, 10] </span>writeln(buffer2);�!�!span class="d_comment">/Xë[11, 1�(l4�) 10Ñ0ü0Ä 14, 15] <ztpan> wrapped�(N��)= <span class="d_keyword">null</span>; <span class="d_comment">]åThe pointer changed for wrapped2 but not�7rapped1. <ztpan><span class="d_keyword">assert</span>(wrapped1.ptr�!�!span class="d_keyword">is<ztpan>�.�.�.amp;buffer1); <span class="d_keyword">assert</span>(wrapped2.ptr�!�!span class="d_keyword">is<ztpan>�!�!span class="d_keyword">null<ztpan>); <span class="d_keyword">assert<ztpan>(wrapped1.ptr Àspan class="d_keyword">is<ztpan>�7rapped�(‘Ñ�)ptr); <span class="d_comment">/uuffer2 is not affected by the assignment. </span>writeln(buffer1);�!�!span class="d_comment">/Xë[6, 7, 8, 9, 10] <ztpan>writeln(buffer�(SA�); <span class="d_comment">]å [�, , ª, , ¬] </span><y:re> </div></div> <dl><dt class="d_decl"><div ><span class="def-anchor" id=".RefRange.this"></span><div class="quickindex" id="quickindex.RefRange.this"><u(iv>pure nothrow @safe this(R* <code class="ddoc_param">range</code>); <br></div></dt> <dd> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".RefRange.opAssign"><ztpan><div class="quickindex" id="quickindex.RefRange.opAssign"></div>auto�!�!span class="def-anchor" id="opAssign"></span><code class="ddoc_psymbol">opAssign</code>(RefRange�!�!code class="ddoc_param">rhs<uode>); <br><u(iv><u(t> <dd><div class="summary">This does not assign�4he�0ointer of <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">rhs<uode></span> to�4his <span class="d_inlinecode donthyphenate notranslate">RefRange<ztpan>. Rather it assigns the range pointed to by <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">rhs<uode></span> to�4he range�0ointed �4o by�4his <span class="d_inlinecode donthyphenate notranslate">RefRange<ztpan>. This is because <i>any</i> operation on a <span class="d_inlinecode donthyphenate notranslate">RefRange<ztpan> is the same is if it occurred�4o the original range. The one exception is�7hen a <span class="d_inlinecode donthyphenate notranslate">RefRange<ztpan> is assigned�!�!span class="d_inlinecode donthyphenate notranslate">null</span> either directly or because�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">rhs</code><ztpan> is <span class="d_inlinecode donthyphenate notranslate">null<ztpan>. In�4hat case, <span class="d_inlinecode donthyphenate notranslate">RefRange<ztpan> no longer refers to�4he original range but is�!�!span class="d_inlinecode donthyphenate notranslate">null</span>.</div> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".RefRange.opAssign.�(N �)><ztpan><div class="quickindex" id="quickindex.RefRange.opAssign.2"></div>void�!�!span class="def-anchor" id="opAssign"></span><code class="ddoc_psymbol">opAssign</code>(typeof(null)�!�!code class="ddoc_param">rhs<uode>); <br><u(iv><u(t> <dd> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".RefRange.ptr"><ztpan><div class="quickindex" id="quickindex.RefRange.ptr"><u(iv>pure nothrow @property @safe inout(R*) <span class="def-anchor" id="ptr"></span><code class="ddoc_psymbol">ptr<uode>() inout; <br></div></dt> <dd><div class="summary">A�0ointer�4o the wrapped range.</div> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".RefRange.front"></span><div class="quickindex" id="quickindex.RefRange.front"></div>@property auto�!�!span class="def-anchor" id="front"><ztpan><code class="ddoc_psymbol">front</code>(); <br><br>@property auto <span class="def-anchor" id="front"></span><code class="ddoc_psymbol">front<uode>() const; <br><br>@property auto�!�!span class="def-anchor" id="front"><ztpan><code class="ddoc_psymbol">front</code>(ElementType!R <code class="ddoc_param">value</code>); <br></div></dt> <dd> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".RefRange.empty"></span><div class="quickindex" id="quickindex.RefRange.empty"></div>@property bool�!�!span class="def-anchor" id="empty"><ztpan><code class="ddoc_psymbol">empty</code>(); <br><br>@property bool <span class="def-anchor" id="empty"></span><code class="ddoc_psymbol">empty<uode>() const; <br></div></dt> <dd> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".RefRange.popFront"><ztpan><div class="quickindex" id="quickindex.RefRange.popFront"></div>void�!�!span class="def-anchor" id="popFront"></span><code class="ddoc_psymbol">popFront</code>(); <br><u(iv><u(t> <dd> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".RefRange.save"></span><div class="quickindex" id="quickindex.RefRange.save"><u(iv>@property auto <span class="def-anchor" id="save"><ztpan><code class="ddoc_psymbol">save<uode>(); <br><br>@property auto�!�!span class="def-anchor" id="save"></span><code class="ddoc_psymbol">save</code>() const; <br><br><span class="def-anchor" id=".RefRange.opSlice"><ztpan><div class="quickindex" id="quickindex.RefRange.opSlice"><u(iv>auto <span class="def-anchor" id="opSlice"></span><code class="ddoc_psymbol">opSlice<uode>(); <br><br>auto�!�!span class="def-anchor" id="opSlice"><ztpan><code class="ddoc_psymbol">opSlice</code>() const; <br><u(iv><u(t> <dd><div class="summary">Only defined if <span class="d_inlinecode donthyphenate notranslate">isForwardRange!R<ztpan> is <span class="d_inlinecode donthyphenate notranslate">true<ztpan>.<u(iv> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".RefRange.back"></span><div class="quickindex" id="quickindex.RefRange.back"><u(iv>@property auto <span class="def-anchor" id="back"><ztpan><code class="ddoc_psymbol">back<uode>(); <br><br>@property auto�!�!span class="def-anchor" id="back"></span><code class="ddoc_psymbol">back</code>() const; <br><br>@property auto <span class="def-anchor" id="back"><ztpan><code class="ddoc_psymbol">back<uode>(ElementType�1 D�1�0�!�!code class="ddoc_param">value<uode>); <br><br><span class="def-anchor" id=".RefRange.popBack"><ztpan><div class="quickindex" id="quickindex.RefRange.popBack"><u(iv>void <span class="def-anchor" id="popBack"></span><code class="ddoc_psymbol">popBack<uode>(); <br></div></dt> <dd><div class="summary">Only defined if�!�!span class="d_inlinecode donthyphenate notranslate">isBidirectionalRange�1 D�1�0</span> is�!�!span class="d_inlinecode donthyphenate notranslate">true</span>.</div> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".RefRange.opIndex"></span><div class="quickindex" id="quickindex.RefRange.opIndex"></div>ref auto�!�!span class="def-anchor" id="opIndex"><ztpan><code class="ddoc_psymbol">opIndex</code><span class="template_param_list"�4itle="Template�0arameter list">(IndexType)</span>(IndexType <code class="ddoc_param">index</code>); <br><br>ref auto�!�!span class="def-anchor" id="opIndex"><ztpan><code class="ddoc_psymbol">opIndex</code><span class="template_param_list"�4itle="Template�0arameter list">(IndexType)</span>(IndexType <code class="ddoc_param">index</code>) const; <br></div></dt> <dd><div class="summary">Only defined if�!�!span class="d_inlinecode donthyphenate notranslate">isRandomAccessRange!R<ztpan> is <span class="d_inlinecode donthyphenate notranslate">true<ztpan>.<u(iv> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".RefRange.moveFront"><ztpan><div class="quickindex" id="quickindex.RefRange.moveFront"><u(iv>auto <span class="def-anchor" id="moveFront"></span><code class="ddoc_psymbol">moveFront<uode>(); <br></div></dt> <dd><div class="summary">Only defined if�!�!span class="d_inlinecode donthyphenate notranslate">hasMobileElements!R<ztpan> and�!�!span class="d_inlinecode donthyphenate notranslate">isForwardRange�1 D�1�0</span> are <span class="d_inlinecode donthyphenate notranslate">true<ztpan>.<u(iv> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".RefRange.moveBack"></span><div class="quickindex" id="quickindex.RefRange.moveBack"><u(iv>auto <span class="def-anchor" id="moveBack"><ztpan><code class="ddoc_psymbol">moveBack<uode>(); <br></div></dt> <dd><div class="summary">Only defined if�!�!span class="d_inlinecode donthyphenate notranslate">hasMobileElements!R<ztpan> and�!�!span class="d_inlinecode donthyphenate notranslate">isBidirectionalRange�1 D�1�0</span> are <span class="d_inlinecode donthyphenate notranslate">true<ztpan>.<u(iv> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".RefRange.moveAt"></span><div class="quickindex" id="quickindex.RefRange.moveAt"><u(iv>auto <span class="def-anchor" id="moveAt"><ztpan><code class="ddoc_psymbol">moveAt<uode>(size_t <code class="ddoc_param">index</code>); <br></div></dt> <dd><div class="summary">Only defined if�!�!span class="d_inlinecode donthyphenate notranslate">hasMobileElements!R<ztpan> and�!�!span class="d_inlinecode donthyphenate notranslate">isRandomAccessRange!R<ztpan> are�!�!span class="d_inlinecode donthyphenate notranslate">true</span>.</div> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".RefRange.length"><ztpan><div class="quickindex" id="quickindex.RefRange.length"></div>@property size_t�!�!span class="def-anchor" id="length"></span><code class="ddoc_psymbol">length</code>(); <br><br>@property size_t <span class="def-anchor" id="length"><ztpan><code class="ddoc_psymbol">length<uode>() const; <br><br><span class="def-anchor" id=".RefRange.opDollar"><ztpan><div class="quickindex" id="quickindex.RefRange.opDollar"></div>alias <span class="def-anchor" id="opDollar"><ztpan><code class="ddoc_psymbol">opDollar<uode> = length; <br><u(iv><u(t> <dd><div class="summary">Only defined if <span class="d_inlinecode donthyphenate notranslate">hasLength�1 D�1�0</span> is�!�!span class="d_inlinecode donthyphenate notranslate">true</span>.</div> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".RefRange.opSlice.2"></span><div class="quickindex" id="quickindex.RefRange.opSlice.2"></div>auto�!�!span class="def-anchor" id="opSlice"><ztpan><code class="ddoc_psymbol">opSlice</code><span class="template_param_list"�4itle="Template�0arameter list">(IndexType1, IndexType2)<ztpan>(IndexType1 <code class="ddoc_param">begin</code>,�!�?ndexType�(N��)<code class="ddoc_param">end</code>); <br><br>auto�!�!span class="def-anchor" id="opSlice"><ztpan><code class="ddoc_psymbol">opSlice</code><span class="template_param_list"�4itle="Template�0arameter list">(IndexType1, IndexType2)<ztpan>(IndexType1 <code class="ddoc_param">begin</code>,�!�?ndexType�(N��)<code class="ddoc_param">end</code>) const; <br></div></dt> <dd><div class="summary">Only defined if�!�!span class="d_inlinecode donthyphenate notranslate">hasSlicing�1 D�1�0</span> is�!�!span class="d_inlinecode donthyphenate notranslate">true</span>.</div> <u(d> <u(l> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".bitwise"><ztpan><div class="quickindex" id="quickindex.bitwise"></div>auto�!�!span class="def-anchor" id="bitwise"><ztpan><code class="ddoc_psymbol">bitwise</code><span class="template_param_list"�4itle="Template�0arameter list">(R)</span>(auto ref R�!�!code class="ddoc_param">range<uode>)<br><span class="constraint">if (isInputRange�1 D�1�0�.�.�.amp;& isIntegral�ZElementType!R))<ztpan>; <br></div></dt> <dd><div class="summary">Bitwise adapter over an integral type range. Consumes�4he range elements bit by bit, from�4he least significant bit�4o the most significant bit. </div><div class="keyval Parameters"><span class="key keyParameters">Parameters:</span> <div class="val valParameters"><table class="params"><tr class="param"><td class="param_id">R<zËd> <td class="param_desc">an integral <a href="std_range_primitives.html#.isInputRange">input range<tæ> to iterate over<zËd></tr> <tr class="param"><td class="param_id">R�!�!code class="ddoc_param">range<uode></td> <td class="param_desc">range�4o consume bit by by<zËd></tr> </table></div></div> <div class="keyval Returns"><span class="key keyReturns">Returns:</span> <div class="val valReturns">A <span class="d_inlinecode donthyphenate notranslate">Bitwise</span> input range with�0ropagated forward, bidirectional and random access capabilities<u(iv><u(iv> <span class="dlang_runnable"><ztpan><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples"><pre class="d_code notranslate"><span class="d_keyword">import<ztpan> std.algorithm.comparison : equal; <span class="d_keyword">import<ztpan> std.format : format; <span class="d_comment">/Xë000000� 00001001 </span><span class="d_keyword">ubyte</span>[] arr = [3, 9]; <span class="d_keyword">auto</span> r = arr.<span class="d_psymbol">bitwise<ztpan>; <span class="d_comment">/Xëiterate through it as with any other range <ztpan>writeln(format(<span class="d_string">"%(%d%)"</span>, r)); <span class="d_comment">]å "�00000010010000" </span><span class="d_keyword">assert<ztpan>(format(<span class="d_string">"%(%d%)"<ztpan>, r.retro).equal(<span class="d_string">"1100000010010000"</span>.retro)); <span class="d_keyword">auto</span> r2 = r[5 .. $]; <span class="d_comment">]å set a bit <ztpan>r[�3�3 = 1; writeln(arr[0]);�!�!span class="d_comment">/Xë7 </span>writeln(r[5]); <span class="d_comment">]å r�3�10] <ztpan></pre> <u(iv><u(iv> <span class="dlang_runnable"><ztpan><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples">You can�5se bitwise�4o implement an�5niform bool generator <pre class="d_code notranslate"><span class="d_keyword">import</span> std.algorithm.comparison : equal; <span class="d_keyword">import</span> std.random : rndGen; <span class="d_keyword">auto</span> rb = rndGen.<span class="d_psymbol">bitwise<ztpan>; <span class="d_keyword">static</span> <span class="d_keyword">assert</span>(isInfinite�Z<span class="d_keyword">typeof</span>(rb))); <span class="d_keyword">auto</span> rb�(N��)= rndGen.<span class="d_psymbol">bitwise</span>; <span class="d_comment">/XëDon't forget�4hat structs are passed by value </span><span class="d_keyword">assert<ztpan>(rb.take(10).equal(rb2.take(10))); <y:re> </div></div> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".NullSink"><ztpan><div class="quickindex" id="quickindex.NullSink"><u(iv>struct <span class="def-anchor" id="NullSink"><ztpan><code class="ddoc_psymbol">NullSink<uode>; <br><br><span class="def-anchor" id=".nullSink"></span><div class="quickindex" id="quickindex.nullSink"></div>ref auto�!�!span class="def-anchor" id="nullSink"></span><code class="ddoc_psymbol">nullSink</code>(); <br><u(iv><u(t> <dd><div class="summary">An OutputRange�4hat discards�4he data it receives.</div><span class="dlang_runnable"><ztpan><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples"><pre class="d_code notranslate"><span class="d_keyword">import<ztpan> std.algorithm.iteration : map; <span class="d_keyword">import</span> std.algorithm.mutation : copy;  <4, 5, 6].map�Zx => x * �(SA�).copy(<span class="d_psymbol">nullSink</span>); <span class="d_comment">]å data is discarded <ztpan></pre> <u(iv><u(iv> <span class="dlang_runnable"><ztpan><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples"><pre class="d_code notranslate"><span class="d_keyword">import<ztpan> std.csv : csvNextToken; string line = <span class="d_string">"a,b,c"</span>; <span class="d_comment">]å ignore the first column <ztpan>line.csvNextToken(<span class="d_psymbol">nullSink</span>, ',', '"'); line.popFront; <span class="d_comment">]å look at�4he second column <ztpan>Appender�i�vtring app; line.csvNextToken(app, ',', '"'); writeln(app.data); <span class="d_comment">]å "b" <ztpan></pre> <u(iv><u(iv> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".tee"><ztpan><div class="quickindex" id="quickindex.tee"></div>auto�!�!span class="def-anchor" id="tee"><ztpan><code class="ddoc_psymbol">tee</code>(Flag�T�MpipeOnPop"�0ipeOnPop = Yes.pipeOnPop, R1, R2)(R1�!�!code class="ddoc_param">inputRange</code>, R�(N��)<code class="ddoc_param">outputRange</code>)<br><span class="constraint">if (isInputRange!R1�.�.�.amp;& isOutputRange!(R�(l4�) ElementType�1 D�1�01))<ztpan>; <br><br>auto�!�!span class="def-anchor" id="tee"><ztpan><code class="ddoc_psymbol">tee</code>(alias fun, Flag!"pipeOnPop" pipeOnPop = Yes.pipeOnPop, R1)(R1 <code class="ddoc_param">inputRange<uode>)<br><span class="constraint">if (is(typeof(fun) == void) || isSomeFunction!fun)</span>; <br><u(iv><u(t> <dd><div class="summary">Implements a "tee" style�0ipe,�7rapping an input range so that elements of�4he range can be passed�4o a provided function or�!�!a href="#OutputRange"><span class="d_inlinecode donthyphenate notranslate">OutputRange</span><tæ> as�4hey are iterated over. This is�5seful for printing out intermediate values in a long chain of range code, performing some operation with side-effects on each call �4o <span class="d_inlinecode donthyphenate notranslate">front</span> or�!�!span class="d_inlinecode donthyphenate notranslate">popFront</span>, or diverting the elements of a range into an auxiliary <a href="#OutputRange"><span class="d_inlinecode donthyphenate notranslate">OutputRange<ztpan></a>. </div><div class="description">It is important�4o note�4hat as�4he resultant range is evaluated lazily, in�4he case of�4he�6ersion of <span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="tee"><ztpan><code class="ddoc_psymbol">tee</code><ztpan>�4hat takes a function, the function �7ill not actually be executed�5ntil�4he range is "walked"�5sing functions �4hat evaluate ranges, such as�!�!a href="std_array.html#.array"><span class="d_inlinecode donthyphenate notranslate">std.array.array<ztpan></a> or <a href="std_algorithm_iteration.html#.fold"><span class="d_inlinecode donthyphenate notranslate">std.algorithm.iteration.fold</span><tæ>. </div> <div class="keyval Parameters"><span class="key keyParameters">Parameters:<ztpan>�!�!div class="val�6alParameters"><table class="params"><tr class="param"><td class="param_id">pipeOnPop</td> <td class="param_desc">If <span class="d_inlinecode donthyphenate notranslate">Yes.pipeOnPop</span>, simply iterating the range without ever calling�!�!span class="d_inlinecode donthyphenate notranslate">front<ztpan> is enough�4o have�!�!span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="tee"></span><code class="ddoc_psymbol">tee<uode></span> mirror elements to�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">outputRange</code><ztpan> (or, respectively, <span class="d_inlinecode donthyphenate notranslate">fun</span>). Note�4hat each�!�!span class="d_inlinecode donthyphenate notranslate">popFront()</span> call�7ill mirror�4he old�!�!span class="d_inlinecode donthyphenate notranslate">front<ztpan>�6alue, not the new one. This means that�4he last value will not be forwarded if�4he range isn't iterated until empty.�!�?f <span class="d_inlinecode donthyphenate notranslate">No.pipeOnPop<ztpan>, only elements for which <span class="d_inlinecode donthyphenate notranslate">front</span> does get called will be also sent to�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">outputRange</code><ztpan>_Ãspan class="d_inlinecode donthyphenate notranslate">fun<ztpan>. If�!�!span class="d_inlinecode donthyphenate notranslate">front<ztpan> is called�4wice for�4he same element, it will still be sent only once. If�4his caching is�5ndesired, consider�5sing�!�!a href="std_algorithm_iteration.html#.map"><span class="d_inlinecode donthyphenate notranslate">std.algorithm.iteration.map<ztpan></a> instead.<zËd></tr> <tr class="param"><td class="param_id">R1 <code class="ddoc_param">inputRange<uode></td> <td class="param_desc">The input range being�0assed through.</td><zËr> <tr class="param"><td class="param_id">R2�!�!code class="ddoc_param">outputRange<uode></td> <td class="param_desc">This range will receive elements of�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">inputRange<uode></span> progressively as iteration�0roceeds.</td><zËr> <tr class="param"><td class="param_id">fun<zËd> <td class="param_desc">This function will be called�7ith elements of <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">inputRange</code><ztpan> �0rogressively as iteration proceeds.<zËd></tr> </table></div></div> <div class="keyval Returns"><span class="key keyReturns">Returns:</span> <div class="val valReturns">An input range�4hat offers�4he elements of�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">inputRange<uode></span>. Regardless of �7hether�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">inputRange<uode></span> is a more powerful range (forward, bidirectional etc), �4he result is always an input range. Reading this causes <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">inputRange</code><ztpan>�4o be iterated and returns its elements in turn. In addition,�4he same elements �7ill be�0assed to�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">outputRange</code><ztpan> or <span class="d_inlinecode donthyphenate notranslate">fun</span> as�7ell. </div></div> <div class="keyval SeeAlso"><span class="key keySeeAlso">See Also:<ztpan>�!�!div class="val�6alSeeAlso"><a href="std_algorithm_iteration.html#.each"><span class="d_inlinecode donthyphenate notranslate">std.algorithm.iteration.each<ztpan></a></div></div> <span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:<ztpan>�!�!div class="val�6alExamples"><pre class="d_code notranslate"><span class="d_keyword">import</span> std.algorithm.comparison : equal; <span class="d_keyword">import</span> std.algorithm.iteration : filter, map; <span class="d_comment">]å Sum�6alues while copying </span><span class="d_keyword">int</span>[] values = [1, 2 2 2, 9, 16, 25]; <span class="d_keyword">int<ztpan> sum = 0; <span class="d_keyword">auto</span> newValues = values.<span class="d_psymbol">tee</span>!(a => sum += a).array; <span class="d_keyword">assert</span>(equal(newValues,�6alues)); writeln(sum);�!�!span class="d_comment">/Xë1 + 4 + 9 + ­ + 25 </span> <span class="d_comment">]å Count�6alues that�0ass the first filter <ztpan><span class="d_keyword">int<ztpan> count = 0; <span class="d_keyword">auto</span> newValues4 =�6alues.filter�Za => a < 10) .<span class="d_psymbol">tee<ztpan>�Za => count++) .map!(a => a + 1) .filter!(a => a�.�.�.lt; 10); <span class="d_comment">]åFine, equal also evaluates any lazy ranges�0assed to it. <ztpan><span class="d_comment">]åcount is not 2 2�5ntil equal evaluates newValues4 </span><span class="d_keyword">assert<ztpan>(equal(newValues4, [�(l4�) 5])); writeln(count);�!�!span class="d_comment">/Xë0ª0ü0à</span><y:re> </div></div> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".padLeft"></span><div class="quickindex" id="quickindex.padLeft"><u(iv>auto <span class="def-anchor" id="padLeft"></span><code class="ddoc_psymbol">padLeft<uode><span class="template_param_list" title="Template parameter list">(R, E)</span>(R <code class="ddoc_param">r</code>, E�!�!code class="ddoc_param">e<uode>, size_t�!�!code class="ddoc_param">n<uode>)<br><span class="constraint">if ((isInputRange!R && hasLength�1 D�1�0�=| isForwardRange�1 D�1�0) && !is(CommonType!(ElementType�1 D�1�0, E) == void))</span>; <br><u(iv><u(t> <dd><div class="summary">Extends the length of the input range <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">r<uode></span> by�0adding out�4he start of the range with�4he element�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">e</code><ztpan>. The element <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">e<uode></span> must be of a common type�7ith the element type of the range <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">r<uode></span> as defined by <a href="std_traits.html#.CommonType"><span class="d_inlinecode donthyphenate notranslate">std.traits.CommonType</span><tæ>. If <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">n<uode></span> is less than�4he length of of <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">r<uode></span>,�4hen <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">r<uode></span> is returned unmodified. </div><div class="description">If <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">r<uode></span> is a string with Unicode characters in it,�!�!span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="padLeft"></span><code class="ddoc_psymbol">padLeft<uode></span> follows D's rules about length for strings, which is not�4he number of characters, or graphemes, but instead�4he number of encoding units.�!�?f you want�4o treat each grapheme as only one encoding�5nit long, then call <a href="std_uni.html#.byGrapheme"><span class="d_inlinecode donthyphenate notranslate">std.uni.byGrapheme</span><tæ> before calling�4his function. <div class="blankline"><u(iv> If <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">r<uode></span> has a length, then�4his is�!�!span class="bigoh">Ο(<span class="d_inlinecode donthyphenate notranslate">²ztpan>)<ztpan>. Otherwise, it's <span class="bigoh">Ο(<span class="d_inlinecode donthyphenate notranslate">r.length<ztpan>)<ztpan>. <u(iv> <div class="keyval Parameters"><span class="key keyParameters">Parameters:</span> <div class="val valParameters"><table class="params"><tr class="param"><td class="param_id">R <code class="ddoc_param">r</code><zËd> <td class="param_desc">an�!�!a href="std_range_primitives.html#.isInputRange">input range</a>�7ith a length, or a forward range</td><zËr> <tr class="param"><td class="param_id">E <code class="ddoc_param">e</code><zËd> <td class="param_desc">element to�0ad�4he range�7ith<zËd></tr> <tr class="param"><td class="param_id">size_t <code class="ddoc_param">n</code><zËd> <td class="param_desc">the length�4o pad to</td><zËr> <zËable><u(iv><u(iv> <div class="keyval Returns"><span class="key keyReturns">Returns:<ztpan>�!�!div class="val�6alReturns">A range containing the elements of the original range�7ith the extra padding <div class="blankline"><u(iv> See Also: �!�!a href="std_string.html#.leftJustifier"><span class="d_inlinecode donthyphenate notranslate">std.string.leftJustifier<ztpan></a></div></div> <span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:<ztpan>�!�!div class="val�6alExamples"><pre class="d_code notranslate"><span class="d_keyword">import</span> std.algorithm.comparison : equal; <span class="d_keyword">assert<ztpan>([1, 2, 0Ñ0ü0Ä 2 2 2].<span class="d_psymbol">padLeft<ztpan>(0, 6).equal([0, 0, 1, 2, 0Ñ0ü0Ä 2 2 2])); <span class="d_keyword">assert<ztpan>([1, 2, 0Ñ0ü0Ä 2 2 2].<span class="d_psymbol">padLeft<ztpan>(0, 0Î0Ã0È.equal([1, 2, 0Ñ0ü0Ä 2 2 2])); <span class="d_keyword">assert</span>(<span class="d_string">"abc"</span>.<span class="d_psymbol">padLeft<ztpan>('_', 6).equal(<span class="d_string">"___abc"</span>)); <y:re> </div></div> </dd> <dt class="d_decl"><div ><span class="def-anchor" id=".padRight"><ztpan><div class="quickindex" id="quickindex.padRight"><u(iv>auto <span class="def-anchor" id="padRight"><ztpan><code class="ddoc_psymbol">padRight<uode><span class="template_param_list" title="Template parameter list">(R, E)</span>(R <code class="ddoc_param">r</code>, E�!�!code class="ddoc_param">e<uode>, size_t�!�!code class="ddoc_param">n<uode>)<br><span class="constraint">if (isInputRange�1 D�1�0�.�.�.amp;& �XsInfinite!R && !is(CommonType!(ElementType�1 D�1�0, E) == void))</span>; <br><u(iv><u(t> <dd><div class="summary">Extend�4he length of�4he input range�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">r</code><ztpan> by padding out the end of�4he range with the element <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">e<uode></span>. The element�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">e</code><ztpan> must be of a common�4ype with�4he element�4ype of�4he range�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">r</code><ztpan> as defined by�!�!a href="std_traits.html#.CommonType"><span class="d_inlinecode donthyphenate notranslate">std.traits.CommonType<ztpan></a>. If�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">n</code><ztpan> is less�4han the length of of�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">r</code><ztpan>, then�4he contents of�!�!span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">r</code><ztpan> are returned. <u(iv><div class="description">The range primitives�4hat the resulting range provides depends�7hether or not <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">r<uode></span> provides�4hem. Except the functions <span class="d_inlinecode donthyphenate notranslate">back<ztpan> and�!�!span class="d_inlinecode donthyphenate notranslate">popBack<ztpan>, which also require the range�4o have a length as�7ell as�!�!span class="d_inlinecode donthyphenate notranslate">back</span> and <span class="d_inlinecode donthyphenate notranslate">popBack</span> <u(iv> <div class="keyval Parameters"><span class="key keyParameters">Parameters:</span> <div class="val valParameters"><table class="params"><tr class="param"><td class="param_id">R <code class="ddoc_param">r</code><zËd> <td class="param_desc">an�!�!a href="std_range_primitives.html#.isInputRange">input range</a>�7ith a length</td><zËr> <tr class="param"><td class="param_id">E <code class="ddoc_param">e</code><zËd> <td class="param_desc">element to�0ad�4he range�7ith<zËd></tr> <tr class="param"><td class="param_id">size_t <code class="ddoc_param">n</code><zËd> <td class="param_desc">the length�4o pad to</td><zËr> <zËable><u(iv><u(iv> <div class="keyval Returns"><span class="key keyReturns">Returns:<ztpan>�!�!div class="val�6alReturns">A range containing the elements of the original range�7ith the extra padding <div class="blankline"><u(iv> See Also: �!�!a href="std_string.html#.rightJustifier"><span class="d_inlinecode donthyphenate notranslate">std.string.rightJustifier<ztpan></a></div></div> <span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:<ztpan>�!�!div class="val�6alExamples"><pre class="d_code notranslate"><span class="d_keyword">import</span> std.algorithm.comparison : equal; <span class="d_keyword">assert<ztpan>([1, 2, 0Ñ0ü0Ä 2 2 2].<span class="d_psymbol">padRight</span>(0, 5 5).equal([1, �(l4�) 2 2, 4, 0, 0])); <span class="d_keyword">assert</span>([1, �(l4�) 2 2, 4].<span class="d_psymbol">padRight<ztpan>(0, 4).equal([1, 2, 0Ñ0ü0Ä 2 2 2])); <span class="d_keyword">assert</span>(<span class="d_string">"abc"</span>.<span class="d_psymbol">padRight</span>('_', 5 5).equal(<span class="d_string">"abc___"<ztpan>)); </pre> <u(iv><u(iv> <u(d> <dt class="d_decl"><div� <span class="def-anchor" id=".isSomeFiniteCharInputRange"></span><div class="quickindex" id="quickindex.isSomeFiniteCharInputRange"></div>enum auto <span class="def-anchor" id="isSomeFiniteCharInputRange"><ztpan><code class="ddoc_psymbol">isSomeFiniteCharInputRange<uode>(R); <br><u(iv><u(t> <dd><div class="summary">This simplifies a commonly�5sed idiom in�0hobos for accepting any kind of string parameter. The type�!�!span class="d_inlinecode donthyphenate notranslate">R<ztpan> can for example be a simple string, chained string using <a href="std_range.html#.chain"><span class="d_inlinecode donthyphenate notranslate">std.range.chain</span><tæ>,�!�!a href="std_path.html#.chainPath"><span class="d_inlinecode donthyphenate notranslate">std.path.chainPath<ztpan></a> or any other input range of characters. <u(iv><div class="description">Only finite length character ranges are allowed with�4his constraint. <div class="blankline"><u(iv> This template is equivalent�4o: <pre class="d_code notranslate">isInputRange!R && !isInfinite�1 D�1�0�.�.�.amp;& isSomeChar�ZElementEncodingType!R) <y:re> <u(iv> <div class="keyval SeeAlso"><span class="key keySeeAlso">See Also:</span> <div class="val valSeeAlso"><a href="std_range_primitives.html#.isInputRange"><span class="d_inlinecode donthyphenate notranslate">std.range.primitives.isInputRange</span><tæ>, <a href="std_range_primitives.html#.isInfinite"><span class="d_inlinecode donthyphenate notranslate">std.range.primitives.isInfinite<ztpan></a>, <a href="#isSomeChar"><span class="d_inlinecode donthyphenate notranslate">isSomeChar<ztpan></a>, <a href="std_range_primitives.html#.ElementEncodingType"><span class="d_inlinecode donthyphenate notranslate">std.range.primitives.ElementEncodingType</span><tæ><u(iv><u(iv> <span class="dlang_runnable"><ztpan><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples"><pre class="d_code notranslate"><span class="d_keyword">import<ztpan> std.path : chainPath; <span class="d_keyword">import<ztpan> std.range : chain; <span class="d_keyword">void<ztpan> someLibraryMethod(R)(R argument) <span class="d_keyword">if</span> (<span class="d_psymbol">isSomeFiniteCharInputRange<ztpan>�1 D�1�0) { <span class="d_comment">]å implementation detail, would iterate over each character of argument </span>} someLibraryMethod(<span class="d_string">"simple strings�7ork"</span>); someLibraryMethod(chain(<span class="d_string">"chained"</span>,�!�!span class="d_string">" "<ztpan>, <span class="d_string">"strings"</span>,�!�!span class="d_string">" "<ztpan>, <span class="d_string">"work"<ztpan>)); someLibraryMethod(chainPath(<span class="d_string">"chained"</span>,�!�!span class="d_string">"paths"<ztpan>, <span class="d_string">"work"<ztpan>)); <span class="d_comment">]å�9ou can also use custom structs implementing a char range <ztpan></pre> <u(iv><u(iv> <u(d> <u(l> <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 �):1SE52 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> <script type="textv®avascript" src="..v®s/run_examples.js"><ztcript> <script type="textv®avascript" src="..v®s/listanchors.js"></script> <script type="textv®avascript" src="..v®s/show_contributors.js"></script> <script type="textv®avascript">jQuery(document).ready(listanchors);<ztcript> <link rel="stylesheet" href="https:]åmaxcdn.bootstrapcdn.com/font-awesome^.4.0ussu‹ont-awesome.min.css"> </body> </html> �<�/�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�/�p�h�o�b�o�s�/�s�t�d�_�r�a�n�g�e�.�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�/�p�h�o�b�o�s�/�s�t�d�_�r�a�n�g�e�.�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�>� � �