structboost_1_1hana_1_1string.html 67 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441
  1. <!--
  2. Copyright Louis Dionne 2013-2017
  3. Distributed under the Boost Software License, Version 1.0.
  4. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
  5. -->
  6. <!-- boost-no-inspect -->
  7. <!-- HTML header for doxygen 1.8.9.1-->
  8. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  9. <html xmlns="http://www.w3.org/1999/xhtml">
  10. <head>
  11. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  12. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  13. <meta name="generator" content="Doxygen 1.8.15"/>
  14. <title>Boost.Hana: boost::hana::string&lt; implementation_defined &gt; Struct Template Reference</title>
  15. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  16. <script type="text/javascript" src="jquery.js"></script>
  17. <script type="text/javascript" src="dynsections.js"></script>
  18. <link href="navtree.css" rel="stylesheet" type="text/css"/>
  19. <script type="text/javascript" src="resize.js"></script>
  20. <script type="text/javascript" src="navtreedata.js"></script>
  21. <script type="text/javascript" src="navtree.js"></script>
  22. <script type="text/javascript">
  23. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  24. $(document).ready(initResizable);
  25. /* @license-end */</script>
  26. <link href="search/search.css" rel="stylesheet" type="text/css"/>
  27. <script type="text/javascript" src="search/searchdata.js"></script>
  28. <script type="text/javascript" src="search/search.js"></script>
  29. <script type="text/javascript">
  30. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  31. $(document).ready(function() { init_search(); });
  32. /* @license-end */
  33. </script>
  34. <script type="text/x-mathjax-config">
  35. MathJax.Hub.Config({
  36. extensions: ["tex2jax.js"],
  37. jax: ["input/TeX","output/HTML-CSS"],
  38. });
  39. // Copyright Louis Dionne 2013-2017
  40. // Distributed under the Boost Software License, Version 1.0.
  41. // (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
  42. MathJax.Hub.Config({
  43. "HTML-CSS": {
  44. linebreaks: {
  45. automatic: true,
  46. width: "75% container"
  47. }
  48. }
  49. });
  50. </script><script type="text/javascript" async="async" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
  51. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  52. <!-- Additional javascript for drawing charts. -->
  53. <script type="text/javascript" src="highcharts.js"></script>
  54. <script type="text/javascript" src="highcharts-data.js"></script>
  55. <script type="text/javascript" src="highcharts-exporting.js"></script>
  56. <script type="text/javascript" src="chart.js"></script>
  57. <script type="text/javascript" src="hana.js"></script>
  58. </head>
  59. <body>
  60. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  61. <div id="titlearea">
  62. <table cellspacing="0" cellpadding="0">
  63. <tbody>
  64. <tr style="height: 56px;">
  65. <td id="projectlogo"><img alt="Logo" src="Boost.png"/></td>
  66. <td style="padding-left: 0.5em;">
  67. <div id="projectname">Boost.Hana
  68. &#160;<span id="projectnumber">1.6.0</span>
  69. </div>
  70. <div id="projectbrief">Your standard library for metaprogramming</div>
  71. </td>
  72. <td> <div id="MSearchBox" class="MSearchBoxInactive">
  73. <span class="left">
  74. <img id="MSearchSelect" src="search/mag_sel.png"
  75. onmouseover="return searchBox.OnSearchSelectShow()"
  76. onmouseout="return searchBox.OnSearchSelectHide()"
  77. alt=""/>
  78. <input type="text" id="MSearchField" value="Search" accesskey="S"
  79. onfocus="searchBox.OnSearchFieldFocus(true)"
  80. onblur="searchBox.OnSearchFieldFocus(false)"
  81. onkeyup="searchBox.OnSearchFieldChange(event)"/>
  82. </span><span class="right">
  83. <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
  84. </span>
  85. </div>
  86. </td>
  87. </tr>
  88. </tbody>
  89. </table>
  90. </div>
  91. <!-- end header part -->
  92. <!-- Generated by Doxygen 1.8.15 -->
  93. <script type="text/javascript">
  94. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  95. var searchBox = new SearchBox("searchBox", "search",false,'Search');
  96. /* @license-end */
  97. </script>
  98. </div><!-- top -->
  99. <div id="side-nav" class="ui-resizable side-nav-resizable">
  100. <div id="nav-tree">
  101. <div id="nav-tree-contents">
  102. <div id="nav-sync" class="sync"></div>
  103. </div>
  104. </div>
  105. <div id="splitbar" style="-moz-user-select:none;"
  106. class="ui-resizable-handle">
  107. </div>
  108. </div>
  109. <script type="text/javascript">
  110. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  111. $(document).ready(function(){initNavTree('structboost_1_1hana_1_1string.html','');});
  112. /* @license-end */
  113. </script>
  114. <div id="doc-content">
  115. <!-- window showing the filter options -->
  116. <div id="MSearchSelectWindow"
  117. onmouseover="return searchBox.OnSearchSelectShow()"
  118. onmouseout="return searchBox.OnSearchSelectHide()"
  119. onkeydown="return searchBox.OnSearchSelectKey(event)">
  120. </div>
  121. <!-- iframe showing the search results (closed by default) -->
  122. <div id="MSearchResultsWindow">
  123. <iframe src="javascript:void(0)" frameborder="0"
  124. name="MSearchResults" id="MSearchResults">
  125. </iframe>
  126. </div>
  127. <div class="header">
  128. <div class="summary">
  129. <a href="#related">Synopsis of associated functions</a> &#124;
  130. <a href="#friends">Friends</a> &#124;
  131. <a href="#pub-methods">Public Member Functions</a> &#124;
  132. <a href="#pub-static-methods">Static Public Member Functions</a> &#124;
  133. <a href="structboost_1_1hana_1_1string-members.html">List of all members</a> </div>
  134. <div class="headertitle">
  135. <div class="title">boost::hana::string&lt; implementation_defined &gt; Struct Template Reference<div class="ingroups"><a class="el" href="group__group-datatypes.html">Data types</a></div></div> </div>
  136. </div><!--header-->
  137. <div class="contents">
  138. <a name="details" id="details"></a><h2 class="groupheader">Description</h2>
  139. <div class="textblock"><h3>template&lt;typename implementation_defined&gt;<br />
  140. struct boost::hana::string&lt; implementation_defined &gt;</h3>
  141. <p>Compile-time string. </p>
  142. <p>Conceptually, a <code><a class="el" href="structboost_1_1hana_1_1string.html" title="Compile-time string.">hana::string</a></code> is like a tuple holding <code><a class="el" href="structboost_1_1hana_1_1integral__constant.html" title="Compile-time value of an integral type.">integral_constant</a></code>s of underlying type <code>char</code>. However, the interface of <code><a class="el" href="structboost_1_1hana_1_1string.html" title="Compile-time string.">hana::string</a></code> is not as rich as that of a tuple, because a string can only hold compile-time characters as opposed to any kind of object.</p>
  143. <p>Compile-time strings are used for simple purposes like being keys in a <code><a class="el" href="structboost_1_1hana_1_1map.html" title="Basic associative container requiring unique, Comparable and Hashable keys.">hana::map</a></code> or tagging the members of a <code>Struct</code>. However, you might find that <code><a class="el" href="structboost_1_1hana_1_1string.html" title="Compile-time string.">hana::string</a></code> does not provide enough functionality to be used as a full-blown compile-time string implementation (e.g. regexp matching or substring finding). Indeed, providing a comprehensive string interface is a lot of job, and it is out of the scope of the library for the time being.</p>
  144. <dl class="section note"><dt>Note</dt><dd>The representation of <code><a class="el" href="structboost_1_1hana_1_1string.html" title="Compile-time string.">hana::string</a></code> is implementation-defined. In particular, one should not take for granted that the template parameters are <code>char</code>s. The proper way to access the contents of a <code><a class="el" href="structboost_1_1hana_1_1string.html" title="Compile-time string.">hana::string</a></code> as character constants is to use <code><a class="el" href="group__group-Foldable.html#ga7b0c23944364ce61136e10b978ae2170" title="Invoke a function with the elements of a Foldable as arguments.Given a function and a foldable struct...">hana::unpack</a></code>, <code>.<a class="el" href="structboost_1_1hana_1_1string.html#af21839d798df54bcbe3d552740f3b16b" title="Returns a null-delimited C-style string.">c_str()</a></code> or <code><a class="el" href="group__group-core.html#gadc70755c1d059139297814fb3bfeb91e" title="Converts an object from one data type to another.">hana::to</a>&lt;char const*&gt;</code>, as documented below. More details <a class="el" href="index.html#tutorial-containers-types">in the tutorial</a>.</dd></dl>
  145. <h2>Modeled concepts </h2>
  146. <p>For most purposes, a <code><a class="el" href="structboost_1_1hana_1_1string.html" title="Compile-time string.">hana::string</a></code> is functionally equivalent to a tuple holding <code>Constant</code>s of underlying type <code>char</code>.</p>
  147. <ol type="1">
  148. <li><code>Comparable</code><br />
  149. Two strings are equal if and only if they have the same number of characters and characters at corresponding indices are equal. <div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div><div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div><div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="equal_8hpp.html">boost/hana/equal.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="not__equal_8hpp.html">boost/hana/not_equal.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="string_8hpp.html">boost/hana/string.hpp</a>&gt;</span></div><div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div><div class="line"></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() {</div><div class="line"> <a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(</div><div class="line"> <a class="code" href="structboost_1_1hana_1_1string.html#a7f15faa77e126e1c2b08a2224ceefb84">BOOST_HANA_STRING</a>(<span class="stringliteral">&quot;abcdef&quot;</span>) == <a class="code" href="structboost_1_1hana_1_1string.html#a7f15faa77e126e1c2b08a2224ceefb84">BOOST_HANA_STRING</a>(<span class="stringliteral">&quot;abcdef&quot;</span>)</div><div class="line"> );</div><div class="line"></div><div class="line"> <a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(</div><div class="line"> <a class="code" href="structboost_1_1hana_1_1string.html#a7f15faa77e126e1c2b08a2224ceefb84">BOOST_HANA_STRING</a>(<span class="stringliteral">&quot;abcdef&quot;</span>) != <a class="code" href="structboost_1_1hana_1_1string.html#a7f15faa77e126e1c2b08a2224ceefb84">BOOST_HANA_STRING</a>(<span class="stringliteral">&quot;abef&quot;</span>)</div><div class="line"> );</div><div class="line">}</div></div><!-- fragment --></li>
  150. <li><code>Orderable</code><br />
  151. The total order implemented for <code>Orderable</code> is the usual lexicographical comparison of strings. <div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div><div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div><div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="greater_8hpp.html">boost/hana/greater.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="less_8hpp.html">boost/hana/less.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="string_8hpp.html">boost/hana/string.hpp</a>&gt;</span></div><div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div><div class="line"></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() {</div><div class="line"> <a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(</div><div class="line"> <a class="code" href="structboost_1_1hana_1_1string.html#a7f15faa77e126e1c2b08a2224ceefb84">BOOST_HANA_STRING</a>(<span class="stringliteral">&quot;abc&quot;</span>) &lt; <a class="code" href="structboost_1_1hana_1_1string.html#a7f15faa77e126e1c2b08a2224ceefb84">BOOST_HANA_STRING</a>(<span class="stringliteral">&quot;bcd&quot;</span>)</div><div class="line"> );</div><div class="line"></div><div class="line"> <a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(</div><div class="line"> <a class="code" href="structboost_1_1hana_1_1string.html#a7f15faa77e126e1c2b08a2224ceefb84">BOOST_HANA_STRING</a>(<span class="stringliteral">&quot;abcd&quot;</span>) &gt; <a class="code" href="structboost_1_1hana_1_1string.html#a7f15faa77e126e1c2b08a2224ceefb84">BOOST_HANA_STRING</a>(<span class="stringliteral">&quot;abc&quot;</span>)</div><div class="line"> );</div><div class="line">}</div></div><!-- fragment --></li>
  152. <li><code>Monoid</code><br />
  153. Strings form a monoid under concatenation, with the neutral element being the empty string. <div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div><div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div><div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="equal_8hpp.html">boost/hana/equal.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="plus_8hpp.html">boost/hana/plus.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="string_8hpp.html">boost/hana/string.hpp</a>&gt;</span></div><div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div><div class="line"></div><div class="line"></div><div class="line"><span class="keyword">auto</span> hello_world = <a class="code" href="structboost_1_1hana_1_1string.html#a7f15faa77e126e1c2b08a2224ceefb84">BOOST_HANA_STRING</a>(<span class="stringliteral">&quot;Hello &quot;</span>) + <a class="code" href="structboost_1_1hana_1_1string.html#a7f15faa77e126e1c2b08a2224ceefb84">BOOST_HANA_STRING</a>(<span class="stringliteral">&quot;world!&quot;</span>);</div><div class="line"><a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(hello_world == <a class="code" href="structboost_1_1hana_1_1string.html#a7f15faa77e126e1c2b08a2224ceefb84">BOOST_HANA_STRING</a>(<span class="stringliteral">&quot;Hello world!&quot;</span>));</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() { }</div></div><!-- fragment --></li>
  154. <li><code>Foldable</code><br />
  155. Folding a string is equivalent to folding the sequence of its characters. <div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div><div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div><div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="equal_8hpp.html">boost/hana/equal.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="fold__left_8hpp.html">boost/hana/fold_left.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="integral__constant_8hpp.html">boost/hana/integral_constant.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="plus_8hpp.html">boost/hana/plus.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="string_8hpp.html">boost/hana/string.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="value_8hpp.html">boost/hana/value.hpp</a>&gt;</span></div><div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div><div class="line"></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() {</div><div class="line"> <span class="keyword">auto</span> sum_string = [](<span class="keyword">auto</span> str) {</div><div class="line"> <span class="keywordflow">return</span> <a class="code" href="group__group-Foldable.html#ga38c6b3f6b1cbadb9b8432a05ff16b7d2">hana::fold_left</a>(str, hana::int_c&lt;0&gt;, [](<span class="keyword">auto</span> <a class="code" href="group__group-Foldable.html#ga650def4b2e98f4273d8b9b7aa5a2fc28">sum</a>, <span class="keyword">auto</span> c) {</div><div class="line"> constexpr <span class="keywordtype">int</span> i = <a class="code" href="group__group-Constant.html#ga1687520692a6b0c49e3a69de2980f388">hana::value</a>(c) - 48; <span class="comment">// convert character to decimal</span></div><div class="line"> <span class="keywordflow">return</span> <a class="code" href="group__group-Foldable.html#ga650def4b2e98f4273d8b9b7aa5a2fc28">sum</a> + hana::int_c&lt;i&gt;;</div><div class="line"> });</div><div class="line"> };</div><div class="line"></div><div class="line"> <a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(</div><div class="line"> sum_string(<a class="code" href="structboost_1_1hana_1_1string.html#a7f15faa77e126e1c2b08a2224ceefb84">BOOST_HANA_STRING</a>(<span class="stringliteral">&quot;1234&quot;</span>)) == hana::int_c&lt;1 + 2 + 3 + 4&gt;</div><div class="line"> );</div><div class="line">}</div></div><!-- fragment --></li>
  156. <li><code>Iterable</code><br />
  157. Iterating over a string is equivalent to iterating over the sequence of its characters. Also note that <code>operator[]</code> can be used instead of the <code>at</code> function. <div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div><div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div><div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="contains_8hpp.html">boost/hana/contains.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="drop__while_8hpp.html">boost/hana/drop_while.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="integral__constant_8hpp.html">boost/hana/integral_constant.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="is__empty_8hpp.html">boost/hana/is_empty.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="string_8hpp.html">boost/hana/string.hpp</a>&gt;</span></div><div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div><div class="line"></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() {</div><div class="line"> <a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(!<a class="code" href="group__group-Iterable.html#ga2a05f564f8a7e4afa04fcbc07ad8f394">hana::is_empty</a>(<a class="code" href="structboost_1_1hana_1_1string.html#a7f15faa77e126e1c2b08a2224ceefb84">BOOST_HANA_STRING</a>(<span class="stringliteral">&quot;abcd&quot;</span>)));</div><div class="line"> <a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(<a class="code" href="group__group-Iterable.html#ga2a05f564f8a7e4afa04fcbc07ad8f394">hana::is_empty</a>(<a class="code" href="structboost_1_1hana_1_1string.html#a7f15faa77e126e1c2b08a2224ceefb84">BOOST_HANA_STRING</a>(<span class="stringliteral">&quot;&quot;</span>)));</div><div class="line"></div><div class="line"> <a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(<a class="code" href="structboost_1_1hana_1_1string.html#a7f15faa77e126e1c2b08a2224ceefb84">BOOST_HANA_STRING</a>(<span class="stringliteral">&quot;abcd&quot;</span>)[hana::size_c&lt;2&gt;] == hana::char_c&lt;&#39;c&#39;&gt;);</div><div class="line"></div><div class="line"> <span class="keyword">auto</span> is_vowel = [](<span class="keyword">auto</span> c) {</div><div class="line"> <span class="keywordflow">return</span> c ^<a class="code" href="group__group-Searchable.html#ga0d9456ceda38b6ca664998e79d7c45b7">hana::in</a>^ <a class="code" href="structboost_1_1hana_1_1string.html#a7f15faa77e126e1c2b08a2224ceefb84">BOOST_HANA_STRING</a>(<span class="stringliteral">&quot;aeiouy&quot;</span>);</div><div class="line"> };</div><div class="line"> <a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(</div><div class="line"> <a class="code" href="group__group-Iterable.html#ga9f1d02c74a6bdc1db260e0d6a8f1ee56">hana::drop_while</a>(<a class="code" href="structboost_1_1hana_1_1string.html#a7f15faa77e126e1c2b08a2224ceefb84">BOOST_HANA_STRING</a>(<span class="stringliteral">&quot;aioubcd&quot;</span>), is_vowel) == <a class="code" href="structboost_1_1hana_1_1string.html#a7f15faa77e126e1c2b08a2224ceefb84">BOOST_HANA_STRING</a>(<span class="stringliteral">&quot;bcd&quot;</span>)</div><div class="line"> );</div><div class="line">}</div></div><!-- fragment --></li>
  158. <li><code>Searchable</code><br />
  159. Searching through a string is equivalent to searching through the sequence of its characters. <div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div><div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div><div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="contains_8hpp.html">boost/hana/contains.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="find_8hpp.html">boost/hana/find.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="integral__constant_8hpp.html">boost/hana/integral_constant.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="optional_8hpp.html">boost/hana/optional.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="string_8hpp.html">boost/hana/string.hpp</a>&gt;</span></div><div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div><div class="line"></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() {</div><div class="line"> <a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(hana::char_c&lt;&#39;c&#39;&gt; ^<a class="code" href="group__group-Searchable.html#ga0d9456ceda38b6ca664998e79d7c45b7">hana::in</a>^ <a class="code" href="structboost_1_1hana_1_1string.html#a7f15faa77e126e1c2b08a2224ceefb84">BOOST_HANA_STRING</a>(<span class="stringliteral">&quot;abcde&quot;</span>));</div><div class="line"> <a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(!(hana::char_c&lt;&#39;z&#39;&gt; ^<a class="code" href="group__group-Searchable.html#ga0d9456ceda38b6ca664998e79d7c45b7">hana::in</a>^ <a class="code" href="structboost_1_1hana_1_1string.html#a7f15faa77e126e1c2b08a2224ceefb84">BOOST_HANA_STRING</a>(<span class="stringliteral">&quot;abcde&quot;</span>)));</div><div class="line"></div><div class="line"> <a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(</div><div class="line"> <a class="code" href="group__group-Searchable.html#ga6b6cdd69942b0fe3bf5254247f9c861e">hana::find</a>(<a class="code" href="structboost_1_1hana_1_1string.html#a7f15faa77e126e1c2b08a2224ceefb84">BOOST_HANA_STRING</a>(<span class="stringliteral">&quot;abcxefg&quot;</span>), hana::char_c&lt;&#39;x&#39;&gt;) == hana::just(hana::char_c&lt;&#39;x&#39;&gt;)</div><div class="line"> );</div><div class="line">}</div></div><!-- fragment --></li>
  160. <li><code>Hashable</code><br />
  161. The hash of a compile-time string is a type uniquely representing that string. <div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div><div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div><div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="hash_8hpp.html">boost/hana/hash.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="not__equal_8hpp.html">boost/hana/not_equal.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="string_8hpp.html">boost/hana/string.hpp</a>&gt;</span></div><div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div><div class="line"></div><div class="line"></div><div class="line"><span class="comment">// `hana::hash` returns a type uniquely representing the string. The hash is</span></div><div class="line"><span class="comment">// perfect, meaning no two different strings have the same hash value.</span></div><div class="line"><a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(<a class="code" href="group__group-Comparable.html#gae33be2e0d5e04f19082f4b7740dfc9cd">hana::not_equal</a>(</div><div class="line"> <a class="code" href="group__group-Hashable.html#ga6e906f44f47b210615491385e5c8a7b5">hana::hash</a>(<a class="code" href="structboost_1_1hana_1_1string.html#a7f15faa77e126e1c2b08a2224ceefb84">BOOST_HANA_STRING</a>(<span class="stringliteral">&quot;abcdef&quot;</span>)),</div><div class="line"> <a class="code" href="group__group-Hashable.html#ga6e906f44f47b210615491385e5c8a7b5">hana::hash</a>(<a class="code" href="structboost_1_1hana_1_1string.html#a7f15faa77e126e1c2b08a2224ceefb84">BOOST_HANA_STRING</a>(<span class="stringliteral">&quot;abcdefg&quot;</span>))</div><div class="line">));</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() { }</div></div><!-- fragment --></li>
  162. </ol>
  163. <h2>Conversion to <code>char const*</code> </h2>
  164. <p>A <code><a class="el" href="structboost_1_1hana_1_1string.html" title="Compile-time string.">hana::string</a></code> can be converted to a <code>constexpr</code> null-delimited string of type <code>char const*</code> by using the <code><a class="el" href="structboost_1_1hana_1_1string.html#af21839d798df54bcbe3d552740f3b16b" title="Returns a null-delimited C-style string.">c_str()</a></code> method or <code><a class="el" href="group__group-core.html#gadc70755c1d059139297814fb3bfeb91e" title="Converts an object from one data type to another.">hana::to</a>&lt;char const*&gt;</code>. This makes it easy to turn a compile-time string into a runtime string. However, note that this conversion is not an embedding, because <code>char const*</code> does not model the same concepts as <code><a class="el" href="structboost_1_1hana_1_1string.html" title="Compile-time string.">hana::string</a></code> does. </p><div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div><div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div><div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="core_2to_8hpp.html">boost/hana/core/to.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="string_8hpp.html">boost/hana/string.hpp</a>&gt;</span></div><div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div><div class="line"></div><div class="line"></div><div class="line">constexpr <span class="keyword">auto</span> str = hana::string_c&lt;&#39;h&#39;, &#39;i&#39;&gt;;</div><div class="line"></div><div class="line"><span class="comment">// using c_str()</span></div><div class="line">constexpr <span class="keywordtype">char</span> <span class="keyword">const</span>* s1 = str.c_str();</div><div class="line">static_assert(s1[0] == <span class="charliteral">&#39;h&#39;</span> &amp;&amp; s1[1] == <span class="charliteral">&#39;i&#39;</span> &amp;&amp; s1[2] == <span class="charliteral">&#39;\0&#39;</span>, <span class="stringliteral">&quot;&quot;</span>);</div><div class="line"></div><div class="line"><span class="comment">// using hana::to</span></div><div class="line">constexpr <span class="keywordtype">char</span> <span class="keyword">const</span>* s2 = hana::to&lt;char const*&gt;(str);</div><div class="line">static_assert(s2[0] == <span class="charliteral">&#39;h&#39;</span> &amp;&amp; s2[1] == <span class="charliteral">&#39;i&#39;</span> &amp;&amp; s2[2] == <span class="charliteral">&#39;\0&#39;</span>, <span class="stringliteral">&quot;&quot;</span>);</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() { }</div></div><!-- fragment --><h2>Conversion from any Constant holding a <code>char const*</code> </h2>
  165. <p>A <code><a class="el" href="structboost_1_1hana_1_1string.html" title="Compile-time string.">hana::string</a></code> can be created from any <code>Constant</code> whose underlying value is convertible to a <code>char const*</code> by using <code><a class="el" href="group__group-core.html#gadc70755c1d059139297814fb3bfeb91e" title="Converts an object from one data type to another.">hana::to</a></code>. The contents of the <code>char const*</code> are used to build the content of the <code><a class="el" href="structboost_1_1hana_1_1string.html" title="Compile-time string.">hana::string</a></code>. </p><div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div><div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div><div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="core_2to_8hpp.html">boost/hana/core/to.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="equal_8hpp.html">boost/hana/equal.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="integral__constant_8hpp.html">boost/hana/integral_constant.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="string_8hpp.html">boost/hana/string.hpp</a>&gt;</span></div><div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div><div class="line"></div><div class="line"></div><div class="line">constexpr <span class="keywordtype">char</span> <span class="keyword">const</span> hello[] = <span class="stringliteral">&quot;hello&quot;</span>;</div><div class="line"><span class="keyword">auto</span> hello_constant = hana::integral_constant&lt;char const*, hello&gt;{};</div><div class="line"></div><div class="line"><a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(</div><div class="line"> hana::to_string(hello_constant) == hana::string_c&lt;&#39;h&#39;, &#39;e&#39;, &#39;l&#39;, &#39;l&#39;, &#39;o&#39;&gt;</div><div class="line">);</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() { }</div></div><!-- fragment --><h2>Rationale for <code><a class="el" href="structboost_1_1hana_1_1string.html" title="Compile-time string.">hana::string</a></code> not being a <code>Constant</code> itself </h2>
  166. <p>The underlying type held by a <code><a class="el" href="structboost_1_1hana_1_1string.html" title="Compile-time string.">hana::string</a></code> could be either <code>char const*</code> or some other constexpr-enabled string-like container. In the first case, <code><a class="el" href="structboost_1_1hana_1_1string.html" title="Compile-time string.">hana::string</a></code> can not be a <code>Constant</code> because the models of several concepts would not be respected by the underlying type, causing <code>value</code> not to be structure-preserving. Providing an underlying value of constexpr-enabled string-like container type like <code>std::string_view</code> would be great, but that's a bit complicated for the time being. </p>
  167. </div><table class="memberdecls">
  168. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="related"></a>
  169. Synopsis of associated functions</h2></td></tr>
  170. <tr class="memitem:a75de1ad7b14dc576a98d759dc3176ae9"><td class="memTemplParams" colspan="2">template&lt;&gt; </td></tr>
  171. <tr class="memitem:a75de1ad7b14dc576a98d759dc3176ae9"><td class="memTemplItemLeft" align="right" valign="top">constexpr auto&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1string.html#a75de1ad7b14dc576a98d759dc3176ae9">make&lt; string_tag &gt;</a></td></tr>
  172. <tr class="memdesc:a75de1ad7b14dc576a98d759dc3176ae9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a compile-time <code><a class="el" href="structboost_1_1hana_1_1string.html" title="Compile-time string.">hana::string</a></code> from a parameter pack of <code>char</code> <code><a class="el" href="structboost_1_1hana_1_1integral__constant.html" title="Compile-time value of an integral type.">integral_constant</a></code>s. <a href="#a75de1ad7b14dc576a98d759dc3176ae9">More...</a><br /></td></tr>
  173. <tr class="separator:a75de1ad7b14dc576a98d759dc3176ae9"><td class="memSeparator" colspan="2">&#160;</td></tr>
  174. <tr class="memitem:acd99ab02697909eba5eb76caf1ca7a8b"><td class="memItemLeft" align="right" valign="top">constexpr auto&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1string.html#acd99ab02697909eba5eb76caf1ca7a8b">make_string</a> = <a class="el" href="group__group-core.html#ga1d92480f0af1029878e773dafa3e2f60">make</a>&lt;<a class="el" href="structboost_1_1hana_1_1string__tag.html">string_tag</a>&gt;</td></tr>
  175. <tr class="memdesc:acd99ab02697909eba5eb76caf1ca7a8b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Alias to <code>make&lt;<a class="el" href="structboost_1_1hana_1_1string__tag.html" title="Tag representing a compile-time string.">string_tag</a>&gt;</code>; provided for convenience. <a href="#acd99ab02697909eba5eb76caf1ca7a8b">More...</a><br /></td></tr>
  176. <tr class="separator:acd99ab02697909eba5eb76caf1ca7a8b"><td class="memSeparator" colspan="2">&#160;</td></tr>
  177. <tr class="memitem:aa3fb479070239c86673c624a21a845b6"><td class="memItemLeft" align="right" valign="top">constexpr auto&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1string.html#aa3fb479070239c86673c624a21a845b6">to_string</a> = <a class="el" href="group__group-core.html#gadc70755c1d059139297814fb3bfeb91e">to</a>&lt;<a class="el" href="structboost_1_1hana_1_1string__tag.html">string_tag</a>&gt;</td></tr>
  178. <tr class="memdesc:aa3fb479070239c86673c624a21a845b6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Equivalent to <code>to&lt;<a class="el" href="structboost_1_1hana_1_1string__tag.html" title="Tag representing a compile-time string.">string_tag</a>&gt;</code>; provided for convenience. <a href="#aa3fb479070239c86673c624a21a845b6">More...</a><br /></td></tr>
  179. <tr class="separator:aa3fb479070239c86673c624a21a845b6"><td class="memSeparator" colspan="2">&#160;</td></tr>
  180. <tr class="memitem:a810915f5e494decfe47b047a3500c577"><td class="memTemplParams" colspan="2">template&lt;char ... s&gt; </td></tr>
  181. <tr class="memitem:a810915f5e494decfe47b047a3500c577"><td class="memTemplItemLeft" align="right" valign="top">constexpr <a class="el" href="structboost_1_1hana_1_1string.html">string</a>&lt; implementation_defined &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1string.html#a810915f5e494decfe47b047a3500c577">string_c</a> {}</td></tr>
  182. <tr class="memdesc:a810915f5e494decfe47b047a3500c577"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a compile-time string from a parameter pack of characters. <a href="#a810915f5e494decfe47b047a3500c577">More...</a><br /></td></tr>
  183. <tr class="separator:a810915f5e494decfe47b047a3500c577"><td class="memSeparator" colspan="2">&#160;</td></tr>
  184. <tr class="memitem:a7f15faa77e126e1c2b08a2224ceefb84"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1string.html#a7f15faa77e126e1c2b08a2224ceefb84">BOOST_HANA_STRING</a>(s)&#160;&#160;&#160;see documentation</td></tr>
  185. <tr class="memdesc:a7f15faa77e126e1c2b08a2224ceefb84"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a compile-time string from a string literal. <a href="#a7f15faa77e126e1c2b08a2224ceefb84">More...</a><br /></td></tr>
  186. <tr class="separator:a7f15faa77e126e1c2b08a2224ceefb84"><td class="memSeparator" colspan="2">&#160;</td></tr>
  187. <tr class="memitem:ad77f7afff008c2ce15739ad16a8bf0a8"><td class="memTemplParams" colspan="2">template&lt;typename CharT , CharT ... s&gt; </td></tr>
  188. <tr class="memitem:ad77f7afff008c2ce15739ad16a8bf0a8"><td class="memTemplItemLeft" align="right" valign="top">constexpr auto&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1string.html#ad77f7afff008c2ce15739ad16a8bf0a8">operator&quot;&quot;_s</a> ()</td></tr>
  189. <tr class="memdesc:ad77f7afff008c2ce15739ad16a8bf0a8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a compile-time string from a string literal. <a href="#ad77f7afff008c2ce15739ad16a8bf0a8">More...</a><br /></td></tr>
  190. <tr class="separator:ad77f7afff008c2ce15739ad16a8bf0a8"><td class="memSeparator" colspan="2">&#160;</td></tr>
  191. </table><table class="memberdecls">
  192. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
  193. Friends</h2></td></tr>
  194. <tr class="memitem:a27607958295e6da8a0ba602a2db468f1"><td class="memTemplParams" colspan="2"><a id="a27607958295e6da8a0ba602a2db468f1"></a>
  195. template&lt;typename X , typename Y &gt; </td></tr>
  196. <tr class="memitem:a27607958295e6da8a0ba602a2db468f1"><td class="memTemplItemLeft" align="right" valign="top">constexpr auto&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1string.html#a27607958295e6da8a0ba602a2db468f1">operator==</a> (X &amp;&amp;x, Y &amp;&amp;y)</td></tr>
  197. <tr class="memdesc:a27607958295e6da8a0ba602a2db468f1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Equivalent to <code><a class="el" href="group__group-Comparable.html#gacaf1ebea6b3ab96ac9dcb82f0e64e547" title="Returns a Logical representing whether x is equal to y.The equal function can be called in two differ...">hana::equal</a></code> <br /></td></tr>
  198. <tr class="separator:a27607958295e6da8a0ba602a2db468f1"><td class="memSeparator" colspan="2">&#160;</td></tr>
  199. <tr class="memitem:a0cae3af55edb3eb05bfa184bda633f7d"><td class="memTemplParams" colspan="2"><a id="a0cae3af55edb3eb05bfa184bda633f7d"></a>
  200. template&lt;typename X , typename Y &gt; </td></tr>
  201. <tr class="memitem:a0cae3af55edb3eb05bfa184bda633f7d"><td class="memTemplItemLeft" align="right" valign="top">constexpr auto&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1string.html#a0cae3af55edb3eb05bfa184bda633f7d">operator!=</a> (X &amp;&amp;x, Y &amp;&amp;y)</td></tr>
  202. <tr class="memdesc:a0cae3af55edb3eb05bfa184bda633f7d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Equivalent to <code><a class="el" href="group__group-Comparable.html#gae33be2e0d5e04f19082f4b7740dfc9cd" title="Returns a Logical representing whether x is not equal to y.The not_equal function can be called in tw...">hana::not_equal</a></code> <br /></td></tr>
  203. <tr class="separator:a0cae3af55edb3eb05bfa184bda633f7d"><td class="memSeparator" colspan="2">&#160;</td></tr>
  204. <tr class="memitem:ada078dcf9e68b8e9a82b33c75dde8457"><td class="memTemplParams" colspan="2"><a id="ada078dcf9e68b8e9a82b33c75dde8457"></a>
  205. template&lt;typename X , typename Y &gt; </td></tr>
  206. <tr class="memitem:ada078dcf9e68b8e9a82b33c75dde8457"><td class="memTemplItemLeft" align="right" valign="top">constexpr auto&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1string.html#ada078dcf9e68b8e9a82b33c75dde8457">operator&lt;</a> (X &amp;&amp;x, Y &amp;&amp;y)</td></tr>
  207. <tr class="memdesc:ada078dcf9e68b8e9a82b33c75dde8457"><td class="mdescLeft">&#160;</td><td class="mdescRight">Equivalent to <code><a class="el" href="group__group-Orderable.html#gad510011602bdb14686f1c4ec145301c9" title="Returns a Logical representing whether x is less than y.">hana::less</a></code> <br /></td></tr>
  208. <tr class="separator:ada078dcf9e68b8e9a82b33c75dde8457"><td class="memSeparator" colspan="2">&#160;</td></tr>
  209. <tr class="memitem:aedd11fddefddbbbb87d3b24c7117528f"><td class="memTemplParams" colspan="2"><a id="aedd11fddefddbbbb87d3b24c7117528f"></a>
  210. template&lt;typename X , typename Y &gt; </td></tr>
  211. <tr class="memitem:aedd11fddefddbbbb87d3b24c7117528f"><td class="memTemplItemLeft" align="right" valign="top">constexpr auto&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1string.html#aedd11fddefddbbbb87d3b24c7117528f">operator&gt;</a> (X &amp;&amp;x, Y &amp;&amp;y)</td></tr>
  212. <tr class="memdesc:aedd11fddefddbbbb87d3b24c7117528f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Equivalent to <code><a class="el" href="group__group-Orderable.html#gaf9a073eafebbe514fb19dff82318f198" title="Returns a Logical representing whether x is greater than y.">hana::greater</a></code> <br /></td></tr>
  213. <tr class="separator:aedd11fddefddbbbb87d3b24c7117528f"><td class="memSeparator" colspan="2">&#160;</td></tr>
  214. <tr class="memitem:a53817979990da799e659b2576799a79a"><td class="memTemplParams" colspan="2"><a id="a53817979990da799e659b2576799a79a"></a>
  215. template&lt;typename X , typename Y &gt; </td></tr>
  216. <tr class="memitem:a53817979990da799e659b2576799a79a"><td class="memTemplItemLeft" align="right" valign="top">constexpr auto&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1string.html#a53817979990da799e659b2576799a79a">operator&lt;=</a> (X &amp;&amp;x, Y &amp;&amp;y)</td></tr>
  217. <tr class="memdesc:a53817979990da799e659b2576799a79a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Equivalent to <code><a class="el" href="group__group-Orderable.html#ga9917dd82beb67151bf5657245d37b851" title="Returns a Logical representing whether x is less than or equal to y.">hana::less_equal</a></code> <br /></td></tr>
  218. <tr class="separator:a53817979990da799e659b2576799a79a"><td class="memSeparator" colspan="2">&#160;</td></tr>
  219. <tr class="memitem:aa3f0436b623de5208767751e1e9f7e59"><td class="memTemplParams" colspan="2"><a id="aa3f0436b623de5208767751e1e9f7e59"></a>
  220. template&lt;typename X , typename Y &gt; </td></tr>
  221. <tr class="memitem:aa3f0436b623de5208767751e1e9f7e59"><td class="memTemplItemLeft" align="right" valign="top">constexpr auto&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1string.html#aa3f0436b623de5208767751e1e9f7e59">operator&gt;=</a> (X &amp;&amp;x, Y &amp;&amp;y)</td></tr>
  222. <tr class="memdesc:aa3f0436b623de5208767751e1e9f7e59"><td class="mdescLeft">&#160;</td><td class="mdescRight">Equivalent to <code><a class="el" href="group__group-Orderable.html#ga6023631e7d0a01e16dc3fa4221fbd703" title="Returns a Logical representing whether x is greater than or equal to y.">hana::greater_equal</a></code> <br /></td></tr>
  223. <tr class="separator:aa3f0436b623de5208767751e1e9f7e59"><td class="memSeparator" colspan="2">&#160;</td></tr>
  224. <tr class="memitem:a077af435df78fdb178f98b109c8c4297"><td class="memTemplParams" colspan="2"><a id="a077af435df78fdb178f98b109c8c4297"></a>
  225. template&lt;typename X , typename Y &gt; </td></tr>
  226. <tr class="memitem:a077af435df78fdb178f98b109c8c4297"><td class="memTemplItemLeft" align="right" valign="top">constexpr auto&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1string.html#a077af435df78fdb178f98b109c8c4297">operator+</a> (X &amp;&amp;x, Y &amp;&amp;y)</td></tr>
  227. <tr class="memdesc:a077af435df78fdb178f98b109c8c4297"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs concatenation; equivalent to <code><a class="el" href="group__group-Monoid.html#gaeb5d4a1e967e319712f9e4791948896c" title="Associative binary operation on a Monoid.">hana::plus</a></code> <br /></td></tr>
  228. <tr class="separator:a077af435df78fdb178f98b109c8c4297"><td class="memSeparator" colspan="2">&#160;</td></tr>
  229. </table><table class="memberdecls">
  230. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
  231. Public Member Functions</h2></td></tr>
  232. <tr class="memitem:a02f56704524481cf919907caf271d2a1"><td class="memTemplParams" colspan="2"><a id="a02f56704524481cf919907caf271d2a1"></a>
  233. template&lt;typename N &gt; </td></tr>
  234. <tr class="memitem:a02f56704524481cf919907caf271d2a1"><td class="memTemplItemLeft" align="right" valign="top">decltype(auto) constexpr&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1string.html#a02f56704524481cf919907caf271d2a1">operator[]</a> (N &amp;&amp;n)</td></tr>
  235. <tr class="memdesc:a02f56704524481cf919907caf271d2a1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Equivalent to <code><a class="el" href="group__group-Iterable.html#ga8a484304380eae38f3d9663d98860129" title="Returns the nth element of an iterable.Given an Iterable and an IntegralConstant index,...">hana::at</a></code> <br /></td></tr>
  236. <tr class="separator:a02f56704524481cf919907caf271d2a1"><td class="memSeparator" colspan="2">&#160;</td></tr>
  237. </table><table class="memberdecls">
  238. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
  239. Static Public Member Functions</h2></td></tr>
  240. <tr class="memitem:af21839d798df54bcbe3d552740f3b16b"><td class="memItemLeft" align="right" valign="top"><a id="af21839d798df54bcbe3d552740f3b16b"></a>
  241. static constexpr char const *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1string.html#af21839d798df54bcbe3d552740f3b16b">c_str</a> ()</td></tr>
  242. <tr class="memdesc:af21839d798df54bcbe3d552740f3b16b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a null-delimited C-style string. <br /></td></tr>
  243. <tr class="separator:af21839d798df54bcbe3d552740f3b16b"><td class="memSeparator" colspan="2">&#160;</td></tr>
  244. </table>
  245. <h2 class="groupheader">Associated functions</h2>
  246. <a id="a75de1ad7b14dc576a98d759dc3176ae9"></a>
  247. <h2 class="memtitle"><span class="permalink"><a href="#a75de1ad7b14dc576a98d759dc3176ae9">&#9670;&nbsp;</a></span>make&lt; string_tag &gt;</h2>
  248. <div class="memitem">
  249. <div class="memproto">
  250. <div class="memtemplate">
  251. template&lt;typename implementation_defined &gt; </div>
  252. <div class="memtemplate">
  253. template&lt;&gt; </div>
  254. <table class="mlabels">
  255. <tr>
  256. <td class="mlabels-left">
  257. <table class="memname">
  258. <tr>
  259. <td class="memname">constexpr auto <a class="el" href="group__group-core.html#ga1d92480f0af1029878e773dafa3e2f60">make</a>&lt; <a class="el" href="structboost_1_1hana_1_1string__tag.html">string_tag</a> &gt;</td>
  260. </tr>
  261. </table>
  262. </td>
  263. <td class="mlabels-right">
  264. <span class="mlabels"><span class="mlabel">related</span></span> </td>
  265. </tr>
  266. </table>
  267. </div><div class="memdoc">
  268. <b>Initial value:</b><div class="fragment"><div class="line">= [](<span class="keyword">auto</span>&amp;&amp; ...chars) {</div><div class="line"> <span class="keywordflow">return</span> string&lt;implementation_defined&gt;{};</div><div class="line"> }</div></div><!-- fragment -->
  269. <p>Create a compile-time <code><a class="el" href="structboost_1_1hana_1_1string.html" title="Compile-time string.">hana::string</a></code> from a parameter pack of <code>char</code> <code><a class="el" href="structboost_1_1hana_1_1integral__constant.html" title="Compile-time value of an integral type.">integral_constant</a></code>s. </p>
  270. <p>Given zero or more <code><a class="el" href="structboost_1_1hana_1_1integral__constant.html" title="Compile-time value of an integral type.">integral_constant</a></code>s of underlying type <code>char</code>, <code>make&lt;<a class="el" href="structboost_1_1hana_1_1string__tag.html" title="Tag representing a compile-time string.">string_tag</a>&gt;</code> creates a <code><a class="el" href="structboost_1_1hana_1_1string.html" title="Compile-time string.">hana::string</a></code> containing those characters. This is provided mostly for consistency with the rest of the library, as <code>hana::string_c</code> is more convenient to use in most cases.</p>
  271. <h2>Example </h2>
  272. <div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div><div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div><div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="equal_8hpp.html">boost/hana/equal.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="string_8hpp.html">boost/hana/string.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="tuple_8hpp.html">boost/hana/tuple.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="unpack_8hpp.html">boost/hana/unpack.hpp</a>&gt;</span></div><div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div><div class="line"></div><div class="line"></div><div class="line">constexpr <span class="keyword">auto</span> vowels = hana::tuple_c&lt;char, &#39;a&#39;, &#39;e&#39;, &#39;i&#39;, &#39;o&#39;, &#39;u&#39;, &#39;y&#39;&gt;;</div><div class="line">constexpr <span class="keyword">auto</span> str = <a class="code" href="group__group-Foldable.html#ga7b0c23944364ce61136e10b978ae2170">hana::unpack</a>(vowels, hana::make&lt;hana::string_tag&gt;);</div><div class="line"><a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(str == <a class="code" href="structboost_1_1hana_1_1string.html#a7f15faa77e126e1c2b08a2224ceefb84">BOOST_HANA_STRING</a>(<span class="stringliteral">&quot;aeiouy&quot;</span>));</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() { }</div></div><!-- fragment -->
  273. </div>
  274. </div>
  275. <a id="acd99ab02697909eba5eb76caf1ca7a8b"></a>
  276. <h2 class="memtitle"><span class="permalink"><a href="#acd99ab02697909eba5eb76caf1ca7a8b">&#9670;&nbsp;</a></span>make_string</h2>
  277. <div class="memitem">
  278. <div class="memproto">
  279. <div class="memtemplate">
  280. template&lt;typename implementation_defined &gt; </div>
  281. <table class="mlabels">
  282. <tr>
  283. <td class="mlabels-left">
  284. <table class="memname">
  285. <tr>
  286. <td class="memname">constexpr auto make_string = <a class="el" href="group__group-core.html#ga1d92480f0af1029878e773dafa3e2f60">make</a>&lt;<a class="el" href="structboost_1_1hana_1_1string__tag.html">string_tag</a>&gt;</td>
  287. </tr>
  288. </table>
  289. </td>
  290. <td class="mlabels-right">
  291. <span class="mlabels"><span class="mlabel">related</span></span> </td>
  292. </tr>
  293. </table>
  294. </div><div class="memdoc">
  295. <p>Alias to <code>make&lt;<a class="el" href="structboost_1_1hana_1_1string__tag.html" title="Tag representing a compile-time string.">string_tag</a>&gt;</code>; provided for convenience. </p>
  296. </div>
  297. </div>
  298. <a id="aa3fb479070239c86673c624a21a845b6"></a>
  299. <h2 class="memtitle"><span class="permalink"><a href="#aa3fb479070239c86673c624a21a845b6">&#9670;&nbsp;</a></span>to_string</h2>
  300. <div class="memitem">
  301. <div class="memproto">
  302. <div class="memtemplate">
  303. template&lt;typename implementation_defined &gt; </div>
  304. <table class="mlabels">
  305. <tr>
  306. <td class="mlabels-left">
  307. <table class="memname">
  308. <tr>
  309. <td class="memname">constexpr auto to_string = <a class="el" href="group__group-core.html#gadc70755c1d059139297814fb3bfeb91e">to</a>&lt;<a class="el" href="structboost_1_1hana_1_1string__tag.html">string_tag</a>&gt;</td>
  310. </tr>
  311. </table>
  312. </td>
  313. <td class="mlabels-right">
  314. <span class="mlabels"><span class="mlabel">related</span></span> </td>
  315. </tr>
  316. </table>
  317. </div><div class="memdoc">
  318. <p>Equivalent to <code>to&lt;<a class="el" href="structboost_1_1hana_1_1string__tag.html" title="Tag representing a compile-time string.">string_tag</a>&gt;</code>; provided for convenience. </p>
  319. </div>
  320. </div>
  321. <a id="a810915f5e494decfe47b047a3500c577"></a>
  322. <h2 class="memtitle"><span class="permalink"><a href="#a810915f5e494decfe47b047a3500c577">&#9670;&nbsp;</a></span>string_c</h2>
  323. <div class="memitem">
  324. <div class="memproto">
  325. <div class="memtemplate">
  326. template&lt;typename implementation_defined &gt; </div>
  327. <div class="memtemplate">
  328. template&lt;char ... s&gt; </div>
  329. <table class="mlabels">
  330. <tr>
  331. <td class="mlabels-left">
  332. <table class="memname">
  333. <tr>
  334. <td class="memname">constexpr <a class="el" href="structboost_1_1hana_1_1string.html">string</a>&lt;implementation_defined&gt; string_c {}</td>
  335. </tr>
  336. </table>
  337. </td>
  338. <td class="mlabels-right">
  339. <span class="mlabels"><span class="mlabel">related</span></span> </td>
  340. </tr>
  341. </table>
  342. </div><div class="memdoc">
  343. <p>Create a compile-time string from a parameter pack of characters. </p>
  344. <h2>Example </h2>
  345. <div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div><div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div><div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="core_2is__a_8hpp.html">boost/hana/core/is_a.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="string_8hpp.html">boost/hana/string.hpp</a>&gt;</span></div><div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div><div class="line"></div><div class="line"></div><div class="line">constexpr <span class="keyword">auto</span> str = hana::string_c&lt;&#39;a&#39;, &#39;b&#39;, &#39;c&#39;, &#39;d&#39;, &#39;e&#39;, &#39;f&#39;&gt;;</div><div class="line"><a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(hana::is_a&lt;hana::string_tag&gt;(str));</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() { }</div></div><!-- fragment -->
  346. </div>
  347. </div>
  348. <a id="a7f15faa77e126e1c2b08a2224ceefb84"></a>
  349. <h2 class="memtitle"><span class="permalink"><a href="#a7f15faa77e126e1c2b08a2224ceefb84">&#9670;&nbsp;</a></span>BOOST_HANA_STRING</h2>
  350. <div class="memitem">
  351. <div class="memproto">
  352. <div class="memtemplate">
  353. template&lt;typename implementation_defined &gt; </div>
  354. <table class="mlabels">
  355. <tr>
  356. <td class="mlabels-left">
  357. <table class="memname">
  358. <tr>
  359. <td class="memname">#define BOOST_HANA_STRING</td>
  360. <td>(</td>
  361. <td class="paramtype">&#160;</td>
  362. <td class="paramname">s</td><td>)</td>
  363. <td>&#160;&#160;&#160;see documentation</td>
  364. </tr>
  365. </table>
  366. </td>
  367. <td class="mlabels-right">
  368. <span class="mlabels"><span class="mlabel">related</span></span> </td>
  369. </tr>
  370. </table>
  371. </div><div class="memdoc">
  372. <p>Create a compile-time string from a string literal. </p>
  373. <p>This macro is a more convenient alternative to <code>string_c</code> for creating compile-time strings. However, since this macro uses a lambda internally, it can't be used in an unevaluated context, or where a constant expression is expected before C++17.</p>
  374. <h2>Example </h2>
  375. <div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div><div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div><div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="config_8hpp.html">boost/hana/config.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="core_2is__a_8hpp.html">boost/hana/core/is_a.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="equal_8hpp.html">boost/hana/equal.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="string_8hpp.html">boost/hana/string.hpp</a>&gt;</span></div><div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div><div class="line"></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() {</div><div class="line"> BOOST_HANA_CONSTEXPR_LAMBDA <span class="keyword">auto</span> str = <a class="code" href="structboost_1_1hana_1_1string.html#a7f15faa77e126e1c2b08a2224ceefb84">BOOST_HANA_STRING</a>(<span class="stringliteral">&quot;abcdef&quot;</span>);</div><div class="line"> <a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(str == hana::string_c&lt;&#39;a&#39;, &#39;b&#39;, &#39;c&#39;, &#39;d&#39;, &#39;e&#39;, &#39;f&#39;&gt;);</div><div class="line"> <a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(hana::is_a&lt;hana::string_tag&gt;(str));</div><div class="line">}</div></div><!-- fragment -->
  376. </div>
  377. </div>
  378. <a id="ad77f7afff008c2ce15739ad16a8bf0a8"></a>
  379. <h2 class="memtitle"><span class="permalink"><a href="#ad77f7afff008c2ce15739ad16a8bf0a8">&#9670;&nbsp;</a></span>operator&quot;&quot;_s()</h2>
  380. <div class="memitem">
  381. <div class="memproto">
  382. <div class="memtemplate">
  383. template&lt;typename CharT , CharT ... s&gt; </div>
  384. <table class="mlabels">
  385. <tr>
  386. <td class="mlabels-left">
  387. <table class="memname">
  388. <tr>
  389. <td class="memname">constexpr auto operator&quot;&quot;_s </td>
  390. <td>(</td>
  391. <td class="paramname"></td><td>)</td>
  392. <td></td>
  393. </tr>
  394. </table>
  395. </td>
  396. <td class="mlabels-right">
  397. <span class="mlabels"><span class="mlabel">related</span></span> </td>
  398. </tr>
  399. </table>
  400. </div><div class="memdoc">
  401. <p>Creates a compile-time string from a string literal. </p>
  402. <p>The string literal is parsed at compile-time and the result is returned as a <code><a class="el" href="structboost_1_1hana_1_1string.html" title="Compile-time string.">hana::string</a></code>. This feature is an extension that is disabled by default; see below for details.</p>
  403. <dl class="section note"><dt>Note</dt><dd>Only narrow string literals are supported right now; support for fancier types of string literals like wide or UTF-XX might be added in the future if there is a demand for it. See <a href="https://github.com/boostorg/hana/issues/80">this issue</a> if you need this.</dd></dl>
  404. <dl class="section warning"><dt>Warning</dt><dd>This user-defined literal is an extension which requires a special string literal operator that is not part of the standard yet. That operator is supported by both Clang and GCC, and several proposals were made for it to enter C++17. However, since it is not standard, it is disabled by default and defining the <code>BOOST_HANA_CONFIG_ENABLE_STRING_UDL</code> config macro is required to get this operator. Hence, if you want to stay safe, just use the <code>BOOST_HANA_STRING</code> macro instead. If you want to be fast and furious (I do), define <code>BOOST_HANA_CONFIG_ENABLE_STRING_UDL</code>.</dd></dl>
  405. <h2>Example </h2>
  406. <div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div><div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div><div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="config_8hpp.html">boost/hana/config.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="core_2is__a_8hpp.html">boost/hana/core/is_a.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="equal_8hpp.html">boost/hana/equal.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="integral__constant_8hpp.html">boost/hana/integral_constant.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="length_8hpp.html">boost/hana/length.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="string_8hpp.html">boost/hana/string.hpp</a>&gt;</span></div><div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div><div class="line"><span class="keyword">using namespace </span>hana::literals;</div><div class="line"></div><div class="line"></div><div class="line"><span class="comment">// By default, this is disabled</span></div><div class="line"><span class="preprocessor">#ifdef BOOST_HANA_CONFIG_ENABLE_STRING_UDL</span></div><div class="line"></div><div class="line"> constexpr <span class="keyword">auto</span> str = <span class="stringliteral">&quot;Hello world!&quot;</span>_s;</div><div class="line"> <a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(str == hana::string_c&lt;<span class="charliteral">&#39;H&#39;</span>, <span class="charliteral">&#39;e&#39;</span>, <span class="charliteral">&#39;l&#39;</span>, <span class="charliteral">&#39;l&#39;</span>, <span class="charliteral">&#39;o&#39;</span>, <span class="charliteral">&#39; &#39;</span>,</div><div class="line"> <span class="charliteral">&#39;w&#39;</span>, <span class="charliteral">&#39;o&#39;</span>, <span class="charliteral">&#39;r&#39;</span>, <span class="charliteral">&#39;l&#39;</span>, <span class="charliteral">&#39;d&#39;</span>, <span class="charliteral">&#39;!&#39;</span>&gt;);</div><div class="line"></div><div class="line"> <a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(hana::is_a&lt;hana::string_tag&gt;(str));</div><div class="line"> <a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(<a class="code" href="group__group-Foldable.html#gaf0f8f717245620dc28cd7d7fa44d7475">hana::length</a>(str) == hana::size_c&lt;12&gt;);</div><div class="line"></div><div class="line"><span class="preprocessor">#endif</span></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() { }</div></div><!-- fragment -->
  407. </div>
  408. </div>
  409. </div><!-- contents -->
  410. </div><!-- doc-content -->
  411. <!--
  412. Copyright Louis Dionne 2013-2017
  413. Distributed under the Boost Software License, Version 1.0.
  414. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
  415. -->
  416. <!-- boost-no-inspect -->
  417. <!-- HTML footer for doxygen 1.8.9.1-->
  418. <!-- start footer part -->
  419. <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  420. <ul>
  421. <li class="navelem"><b>boost</b></li><li class="navelem"><a class="el" href="namespaceboost_1_1hana.html">hana</a></li><li class="navelem"><a class="el" href="structboost_1_1hana_1_1string.html">string</a></li>
  422. </ul>
  423. </div>
  424. </body>
  425. </html>