698 lines
74 KiB
HTML
698 lines
74 KiB
HTML
<!--
|
|
Copyright Louis Dionne 2013-2017
|
|
Distributed under the Boost Software License, Version 1.0.
|
|
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
|
|
-->
|
|
<!-- boost-no-inspect -->
|
|
<!-- HTML header for doxygen 1.8.9.1-->
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
|
<meta name="generator" content="Doxygen 1.8.20"/>
|
|
<title>Boost.Hana: boost::hana::string< implementation_defined > Struct Template Reference</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="resize.js"></script>
|
|
<script type="text/javascript" src="navtreedata.js"></script>
|
|
<script type="text/javascript" src="navtree.js"></script>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
$(document).ready(function() { init_search(); });
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/x-mathjax-config">
|
|
MathJax.Hub.Config({
|
|
extensions: ["tex2jax.js"],
|
|
jax: ["input/TeX","output/HTML-CSS"],
|
|
});
|
|
// Copyright Louis Dionne 2013-2017
|
|
// Distributed under the Boost Software License, Version 1.0.
|
|
// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
|
|
MathJax.Hub.Config({
|
|
"HTML-CSS": {
|
|
linebreaks: {
|
|
automatic: true,
|
|
width: "75% container"
|
|
}
|
|
}
|
|
});
|
|
</script>
|
|
<script type="text/javascript" async="async" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
<!-- Additional javascript for drawing charts. -->
|
|
<script type="text/javascript" src="highcharts.js"></script>
|
|
<script type="text/javascript" src="highcharts-data.js"></script>
|
|
<script type="text/javascript" src="highcharts-exporting.js"></script>
|
|
<script type="text/javascript" src="chart.js"></script>
|
|
<script type="text/javascript" src="hana.js"></script>
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr style="height: 56px;">
|
|
<td id="projectlogo"><img alt="Logo" src="Boost.png"/></td>
|
|
<td style="padding-left: 0.5em;">
|
|
<div id="projectname">Boost.Hana
|
|
 <span id="projectnumber">1.7.0</span>
|
|
</div>
|
|
<div id="projectbrief">Your standard library for metaprogramming</div>
|
|
</td>
|
|
<td> <div id="MSearchBox" class="MSearchBoxInactive">
|
|
<span class="left">
|
|
<img id="MSearchSelect" src="search/mag_sel.svg"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
alt=""/>
|
|
<input type="text" id="MSearchField" value="Search" accesskey="S"
|
|
onfocus="searchBox.OnSearchFieldFocus(true)"
|
|
onblur="searchBox.OnSearchFieldFocus(false)"
|
|
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
|
</span><span class="right">
|
|
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
|
|
</span>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.8.20 -->
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
|
/* @license-end */
|
|
</script>
|
|
</div><!-- top -->
|
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
|
<div id="nav-tree">
|
|
<div id="nav-tree-contents">
|
|
<div id="nav-sync" class="sync"></div>
|
|
</div>
|
|
</div>
|
|
<div id="splitbar" style="-moz-user-select:none;"
|
|
class="ui-resizable-handle">
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
$(document).ready(function(){initNavTree('structboost_1_1hana_1_1string.html',''); initResizable(); });
|
|
/* @license-end */
|
|
</script>
|
|
<div id="doc-content">
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<iframe src="javascript:void(0)" frameborder="0"
|
|
name="MSearchResults" id="MSearchResults">
|
|
</iframe>
|
|
</div>
|
|
|
|
<div class="header">
|
|
<div class="summary">
|
|
<a href="#related">Synopsis of associated functions</a> |
|
|
<a href="#friends">Friends</a> |
|
|
<a href="#pub-methods">Public Member Functions</a> |
|
|
<a href="#pub-static-methods">Static Public Member Functions</a> |
|
|
<a href="structboost_1_1hana_1_1string-members.html">List of all members</a> </div>
|
|
<div class="headertitle">
|
|
<div class="title">boost::hana::string< implementation_defined > Struct Template Reference<div class="ingroups"><a class="el" href="group__group-datatypes.html">Data types</a></div></div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<a name="details" id="details"></a><h2 class="groupheader">Description</h2>
|
|
<div class="textblock"><h3>template<typename implementation_defined><br />
|
|
struct boost::hana::string< implementation_defined ></h3>
|
|
|
|
<p>Compile-time string. </p>
|
|
<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>
|
|
<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>
|
|
<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.">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><char const*></code>, as documented below. More details <a class="el" href="index.html#tutorial-containers-types">in the tutorial</a>.</dd></dl>
|
|
<h2><a class="anchor" id="autotoc_md368"></a>
|
|
Modeled concepts</h2>
|
|
<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>
|
|
<ol type="1">
|
|
<li><code>Comparable</code><br />
|
|
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 <<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="equal_8hpp.html">boost/hana/equal.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="not__equal_8hpp.html">boost/hana/not_equal.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="string_8hpp.html">boost/hana/string.hpp</a>></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">"abcdef"</span>) == <a class="code" href="structboost_1_1hana_1_1string.html#a7f15faa77e126e1c2b08a2224ceefb84">BOOST_HANA_STRING</a>(<span class="stringliteral">"abcdef"</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">"abcdef"</span>) != <a class="code" href="structboost_1_1hana_1_1string.html#a7f15faa77e126e1c2b08a2224ceefb84">BOOST_HANA_STRING</a>(<span class="stringliteral">"abef"</span>)</div>
|
|
<div class="line"> );</div>
|
|
<div class="line">}</div>
|
|
</div><!-- fragment --></li>
|
|
<li><code>Orderable</code><br />
|
|
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 <<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="greater_8hpp.html">boost/hana/greater.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="less_8hpp.html">boost/hana/less.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="string_8hpp.html">boost/hana/string.hpp</a>></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">"abc"</span>) < <a class="code" href="structboost_1_1hana_1_1string.html#a7f15faa77e126e1c2b08a2224ceefb84">BOOST_HANA_STRING</a>(<span class="stringliteral">"bcd"</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">"abcd"</span>) > <a class="code" href="structboost_1_1hana_1_1string.html#a7f15faa77e126e1c2b08a2224ceefb84">BOOST_HANA_STRING</a>(<span class="stringliteral">"abc"</span>)</div>
|
|
<div class="line"> );</div>
|
|
<div class="line">}</div>
|
|
</div><!-- fragment --></li>
|
|
<li><code>Monoid</code><br />
|
|
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 <<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="equal_8hpp.html">boost/hana/equal.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="plus_8hpp.html">boost/hana/plus.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="string_8hpp.html">boost/hana/string.hpp</a>></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">"Hello "</span>) + <a class="code" href="structboost_1_1hana_1_1string.html#a7f15faa77e126e1c2b08a2224ceefb84">BOOST_HANA_STRING</a>(<span class="stringliteral">"world!"</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">"Hello world!"</span>));</div>
|
|
<div class="line"> </div>
|
|
<div class="line"><span class="keywordtype">int</span> main() { }</div>
|
|
</div><!-- fragment --></li>
|
|
<li><code>Foldable</code><br />
|
|
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 <<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="equal_8hpp.html">boost/hana/equal.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="fold__left_8hpp.html">boost/hana/fold_left.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="integral__constant_8hpp.html">boost/hana/integral_constant.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="plus_8hpp.html">boost/hana/plus.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="string_8hpp.html">boost/hana/string.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="value_8hpp.html">boost/hana/value.hpp</a>></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> hana::fold_left(str, hana::int_c<0>, [](<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<i>;</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">"1234"</span>)) == hana::int_c<1 + 2 + 3 + 4></div>
|
|
<div class="line"> );</div>
|
|
<div class="line">}</div>
|
|
</div><!-- fragment --></li>
|
|
<li><code>Iterable</code><br />
|
|
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 <<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="contains_8hpp.html">boost/hana/contains.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="drop__while_8hpp.html">boost/hana/drop_while.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="integral__constant_8hpp.html">boost/hana/integral_constant.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="is__empty_8hpp.html">boost/hana/is_empty.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="string_8hpp.html">boost/hana/string.hpp</a>></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">"abcd"</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">""</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">"abcd"</span>)[hana::size_c<2>] == hana::char_c<'c'>);</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">"aeiouy"</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">"aioubcd"</span>), is_vowel) == <a class="code" href="structboost_1_1hana_1_1string.html#a7f15faa77e126e1c2b08a2224ceefb84">BOOST_HANA_STRING</a>(<span class="stringliteral">"bcd"</span>)</div>
|
|
<div class="line"> );</div>
|
|
<div class="line">}</div>
|
|
</div><!-- fragment --></li>
|
|
<li><code>Searchable</code><br />
|
|
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 <<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="contains_8hpp.html">boost/hana/contains.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="find_8hpp.html">boost/hana/find.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="integral__constant_8hpp.html">boost/hana/integral_constant.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="optional_8hpp.html">boost/hana/optional.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="string_8hpp.html">boost/hana/string.hpp</a>></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<'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">"abcde"</span>));</div>
|
|
<div class="line"> <a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(!(hana::char_c<'z'> ^<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">"abcde"</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">"abcxefg"</span>), hana::char_c<'x'>) == hana::just(hana::char_c<'x'>)</div>
|
|
<div class="line"> );</div>
|
|
<div class="line">}</div>
|
|
</div><!-- fragment --></li>
|
|
<li><code>Hashable</code><br />
|
|
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 <<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="hash_8hpp.html">boost/hana/hash.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="not__equal_8hpp.html">boost/hana/not_equal.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="string_8hpp.html">boost/hana/string.hpp</a>></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"> hana::hash(<a class="code" href="structboost_1_1hana_1_1string.html#a7f15faa77e126e1c2b08a2224ceefb84">BOOST_HANA_STRING</a>(<span class="stringliteral">"abcdef"</span>)),</div>
|
|
<div class="line"> hana::hash(<a class="code" href="structboost_1_1hana_1_1string.html#a7f15faa77e126e1c2b08a2224ceefb84">BOOST_HANA_STRING</a>(<span class="stringliteral">"abcdefg"</span>))</div>
|
|
<div class="line">));</div>
|
|
<div class="line"> </div>
|
|
<div class="line"><span class="keywordtype">int</span> main() { }</div>
|
|
</div><!-- fragment --></li>
|
|
</ol>
|
|
<h2><a class="anchor" id="autotoc_md369"></a>
|
|
Conversion to <tt>char const*</tt></h2>
|
|
<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><char const*></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 <<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="core_2to_8hpp.html">boost/hana/core/to.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="string_8hpp.html">boost/hana/string.hpp</a>></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<'h', 'i'>;</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">'h'</span> && s1[1] == <span class="charliteral">'i'</span> && s1[2] == <span class="charliteral">'\0'</span>, <span class="stringliteral">""</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<char const*>(str);</div>
|
|
<div class="line">static_assert(s2[0] == <span class="charliteral">'h'</span> && s2[1] == <span class="charliteral">'i'</span> && s2[2] == <span class="charliteral">'\0'</span>, <span class="stringliteral">""</span>);</div>
|
|
<div class="line"> </div>
|
|
<div class="line"><span class="keywordtype">int</span> main() { }</div>
|
|
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md370"></a>
|
|
Conversion from any Constant holding a <tt>char const*</tt></h2>
|
|
<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 <<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="core_2to_8hpp.html">boost/hana/core/to.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="equal_8hpp.html">boost/hana/equal.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="integral__constant_8hpp.html">boost/hana/integral_constant.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="string_8hpp.html">boost/hana/string.hpp</a>></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">"hello"</span>;</div>
|
|
<div class="line"><span class="keyword">auto</span> hello_constant = hana::integral_constant<char const*, hello>{};</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<'h', 'e', 'l', 'l', 'o'></div>
|
|
<div class="line">);</div>
|
|
<div class="line"> </div>
|
|
<div class="line"><span class="keywordtype">int</span> main() { }</div>
|
|
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md371"></a>
|
|
Rationale for <tt>hana::string</tt> not being a <tt>Constant</tt> itself</h2>
|
|
<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>
|
|
</div><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="related"></a>
|
|
Synopsis of associated functions</h2></td></tr>
|
|
<tr class="memitem:a75de1ad7b14dc576a98d759dc3176ae9"><td class="memItemLeft" align="right" valign="top">template<> </td></tr>
|
|
<tr class="memitem:a75de1ad7b14dc576a98d759dc3176ae9"><td class="memTemplItemLeft" align="right" valign="top">constexpr auto </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1string.html#a75de1ad7b14dc576a98d759dc3176ae9">make< string_tag ></a></td></tr>
|
|
<tr class="memdesc:a75de1ad7b14dc576a98d759dc3176ae9"><td class="mdescLeft"> </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="structboost_1_1hana_1_1string.html#a75de1ad7b14dc576a98d759dc3176ae9">More...</a><br /></td></tr>
|
|
<tr class="separator:a75de1ad7b14dc576a98d759dc3176ae9"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:acd99ab02697909eba5eb76caf1ca7a8b"><td class="memItemLeft" align="right" valign="top"><a id="acd99ab02697909eba5eb76caf1ca7a8b"></a>
|
|
constexpr auto </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><<a class="el" href="structboost_1_1hana_1_1string__tag.html">string_tag</a>></td></tr>
|
|
<tr class="memdesc:acd99ab02697909eba5eb76caf1ca7a8b"><td class="mdescLeft"> </td><td class="mdescRight">Alias to <code>make<<a class="el" href="structboost_1_1hana_1_1string__tag.html" title="Tag representing a compile-time string.">string_tag</a>></code>; provided for convenience. <br /></td></tr>
|
|
<tr class="separator:acd99ab02697909eba5eb76caf1ca7a8b"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aa3fb479070239c86673c624a21a845b6"><td class="memItemLeft" align="right" valign="top"><a id="aa3fb479070239c86673c624a21a845b6"></a>
|
|
constexpr auto </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><<a class="el" href="structboost_1_1hana_1_1string__tag.html">string_tag</a>></td></tr>
|
|
<tr class="memdesc:aa3fb479070239c86673c624a21a845b6"><td class="mdescLeft"> </td><td class="mdescRight">Equivalent to <code>to<<a class="el" href="structboost_1_1hana_1_1string__tag.html" title="Tag representing a compile-time string.">string_tag</a>></code>; provided for convenience. <br /></td></tr>
|
|
<tr class="separator:aa3fb479070239c86673c624a21a845b6"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a810915f5e494decfe47b047a3500c577"><td class="memTemplParams" colspan="2">template<char ... s> </td></tr>
|
|
<tr class="memitem:a810915f5e494decfe47b047a3500c577"><td class="memTemplItemLeft" align="right" valign="top">constexpr <a class="el" href="structboost_1_1hana_1_1string.html">string</a>< implementation_defined > </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1string.html#a810915f5e494decfe47b047a3500c577">string_c</a> {}</td></tr>
|
|
<tr class="memdesc:a810915f5e494decfe47b047a3500c577"><td class="mdescLeft"> </td><td class="mdescRight">Create a compile-time string from a parameter pack of characters. <a href="structboost_1_1hana_1_1string.html#a810915f5e494decfe47b047a3500c577">More...</a><br /></td></tr>
|
|
<tr class="separator:a810915f5e494decfe47b047a3500c577"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a7f15faa77e126e1c2b08a2224ceefb84"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1string.html#a7f15faa77e126e1c2b08a2224ceefb84">BOOST_HANA_STRING</a>(s)   see documentation</td></tr>
|
|
<tr class="memdesc:a7f15faa77e126e1c2b08a2224ceefb84"><td class="mdescLeft"> </td><td class="mdescRight">Create a compile-time string from a string literal. <a href="structboost_1_1hana_1_1string.html#a7f15faa77e126e1c2b08a2224ceefb84">More...</a><br /></td></tr>
|
|
<tr class="separator:a7f15faa77e126e1c2b08a2224ceefb84"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ad77f7afff008c2ce15739ad16a8bf0a8"><td class="memTemplParams" colspan="2">template<typename CharT , CharT ... s> </td></tr>
|
|
<tr class="memitem:ad77f7afff008c2ce15739ad16a8bf0a8"><td class="memTemplItemLeft" align="right" valign="top">constexpr auto </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1string.html#ad77f7afff008c2ce15739ad16a8bf0a8">operator""_s</a> ()</td></tr>
|
|
<tr class="memdesc:ad77f7afff008c2ce15739ad16a8bf0a8"><td class="mdescLeft"> </td><td class="mdescRight">Creates a compile-time string from a string literal. <a href="structboost_1_1hana_1_1string.html#ad77f7afff008c2ce15739ad16a8bf0a8">More...</a><br /></td></tr>
|
|
<tr class="separator:ad77f7afff008c2ce15739ad16a8bf0a8"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
|
|
Friends</h2></td></tr>
|
|
<tr class="memitem:a22bef1b2c14cf393a3a9cb1924d8c8ff"><td class="memTemplParams" colspan="2"><a id="a22bef1b2c14cf393a3a9cb1924d8c8ff"></a>
|
|
template<typename X , typename Y > </td></tr>
|
|
<tr class="memitem:a22bef1b2c14cf393a3a9cb1924d8c8ff"><td class="memTemplItemLeft" align="right" valign="top">constexpr friend auto </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1string.html#a22bef1b2c14cf393a3a9cb1924d8c8ff">operator==</a> (X &&x, Y &&y)</td></tr>
|
|
<tr class="memdesc:a22bef1b2c14cf393a3a9cb1924d8c8ff"><td class="mdescLeft"> </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.">hana::equal</a></code> <br /></td></tr>
|
|
<tr class="separator:a22bef1b2c14cf393a3a9cb1924d8c8ff"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a4ecea0deb4c00ae2eb0b0713ee0645e9"><td class="memTemplParams" colspan="2"><a id="a4ecea0deb4c00ae2eb0b0713ee0645e9"></a>
|
|
template<typename X , typename Y > </td></tr>
|
|
<tr class="memitem:a4ecea0deb4c00ae2eb0b0713ee0645e9"><td class="memTemplItemLeft" align="right" valign="top">constexpr friend auto </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1string.html#a4ecea0deb4c00ae2eb0b0713ee0645e9">operator!=</a> (X &&x, Y &&y)</td></tr>
|
|
<tr class="memdesc:a4ecea0deb4c00ae2eb0b0713ee0645e9"><td class="mdescLeft"> </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.">hana::not_equal</a></code> <br /></td></tr>
|
|
<tr class="separator:a4ecea0deb4c00ae2eb0b0713ee0645e9"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aca31ad50b2d35d48aac88aa762530c75"><td class="memTemplParams" colspan="2"><a id="aca31ad50b2d35d48aac88aa762530c75"></a>
|
|
template<typename X , typename Y > </td></tr>
|
|
<tr class="memitem:aca31ad50b2d35d48aac88aa762530c75"><td class="memTemplItemLeft" align="right" valign="top">constexpr friend auto </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1string.html#aca31ad50b2d35d48aac88aa762530c75">operator<</a> (X &&x, Y &&y)</td></tr>
|
|
<tr class="memdesc:aca31ad50b2d35d48aac88aa762530c75"><td class="mdescLeft"> </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>
|
|
<tr class="separator:aca31ad50b2d35d48aac88aa762530c75"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a65b9400772e651101ae83d7f9f7ba84d"><td class="memTemplParams" colspan="2"><a id="a65b9400772e651101ae83d7f9f7ba84d"></a>
|
|
template<typename X , typename Y > </td></tr>
|
|
<tr class="memitem:a65b9400772e651101ae83d7f9f7ba84d"><td class="memTemplItemLeft" align="right" valign="top">constexpr friend auto </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1string.html#a65b9400772e651101ae83d7f9f7ba84d">operator></a> (X &&x, Y &&y)</td></tr>
|
|
<tr class="memdesc:a65b9400772e651101ae83d7f9f7ba84d"><td class="mdescLeft"> </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>
|
|
<tr class="separator:a65b9400772e651101ae83d7f9f7ba84d"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a971bac762b767fe0ec222adb367c9aeb"><td class="memTemplParams" colspan="2"><a id="a971bac762b767fe0ec222adb367c9aeb"></a>
|
|
template<typename X , typename Y > </td></tr>
|
|
<tr class="memitem:a971bac762b767fe0ec222adb367c9aeb"><td class="memTemplItemLeft" align="right" valign="top">constexpr friend auto </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1string.html#a971bac762b767fe0ec222adb367c9aeb">operator<=</a> (X &&x, Y &&y)</td></tr>
|
|
<tr class="memdesc:a971bac762b767fe0ec222adb367c9aeb"><td class="mdescLeft"> </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>
|
|
<tr class="separator:a971bac762b767fe0ec222adb367c9aeb"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:adec95a8109b858673412671ba341611b"><td class="memTemplParams" colspan="2"><a id="adec95a8109b858673412671ba341611b"></a>
|
|
template<typename X , typename Y > </td></tr>
|
|
<tr class="memitem:adec95a8109b858673412671ba341611b"><td class="memTemplItemLeft" align="right" valign="top">constexpr friend auto </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1string.html#adec95a8109b858673412671ba341611b">operator>=</a> (X &&x, Y &&y)</td></tr>
|
|
<tr class="memdesc:adec95a8109b858673412671ba341611b"><td class="mdescLeft"> </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>
|
|
<tr class="separator:adec95a8109b858673412671ba341611b"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a897cb2a15eeef6924a2b2fda36eac874"><td class="memTemplParams" colspan="2"><a id="a897cb2a15eeef6924a2b2fda36eac874"></a>
|
|
template<typename X , typename Y > </td></tr>
|
|
<tr class="memitem:a897cb2a15eeef6924a2b2fda36eac874"><td class="memTemplItemLeft" align="right" valign="top">constexpr friend auto </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1string.html#a897cb2a15eeef6924a2b2fda36eac874">operator+</a> (X &&x, Y &&y)</td></tr>
|
|
<tr class="memdesc:a897cb2a15eeef6924a2b2fda36eac874"><td class="mdescLeft"> </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>
|
|
<tr class="separator:a897cb2a15eeef6924a2b2fda36eac874"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
|
|
Public Member Functions</h2></td></tr>
|
|
<tr class="memitem:a186fd5a7d40373d568a0c3d4517da929"><td class="memTemplParams" colspan="2"><a id="a186fd5a7d40373d568a0c3d4517da929"></a>
|
|
template<typename N > </td></tr>
|
|
<tr class="memitem:a186fd5a7d40373d568a0c3d4517da929"><td class="memTemplItemLeft" align="right" valign="top">constexpr decltype(auto) </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1string.html#a186fd5a7d40373d568a0c3d4517da929">operator[]</a> (N &&n)</td></tr>
|
|
<tr class="memdesc:a186fd5a7d40373d568a0c3d4517da929"><td class="mdescLeft"> </td><td class="mdescRight">Equivalent to <code><a class="el" href="group__group-_iterable.html#ga8a484304380eae38f3d9663d98860129" title="Returns the nth element of an iterable.">hana::at</a></code> <br /></td></tr>
|
|
<tr class="separator:a186fd5a7d40373d568a0c3d4517da929"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
|
|
Static Public Member Functions</h2></td></tr>
|
|
<tr class="memitem:af21839d798df54bcbe3d552740f3b16b"><td class="memItemLeft" align="right" valign="top"><a id="af21839d798df54bcbe3d552740f3b16b"></a>
|
|
static constexpr char const * </td><td class="memItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1string.html#af21839d798df54bcbe3d552740f3b16b">c_str</a> ()</td></tr>
|
|
<tr class="memdesc:af21839d798df54bcbe3d552740f3b16b"><td class="mdescLeft"> </td><td class="mdescRight">Returns a null-delimited C-style string. <br /></td></tr>
|
|
<tr class="separator:af21839d798df54bcbe3d552740f3b16b"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<h2 class="groupheader">Associated functions</h2>
|
|
<a id="a75de1ad7b14dc576a98d759dc3176ae9"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a75de1ad7b14dc576a98d759dc3176ae9">◆ </a></span>make< string_tag ></h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename implementation_defined > </div>
|
|
<div class="memtemplate">
|
|
template<> </div>
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">constexpr auto <a class="el" href="group__group-core.html#ga1d92480f0af1029878e773dafa3e2f60">make</a>< <a class="el" href="structboost_1_1hana_1_1string__tag.html">string_tag</a> ></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">related</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<b>Initial value:</b><div class="fragment"><div class="line">= [](<span class="keyword">auto</span>&& ...chars) {</div>
|
|
<div class="line"> <span class="keywordflow">return</span> string<implementation_defined>{};</div>
|
|
<div class="line"> }</div>
|
|
</div><!-- fragment -->
|
|
<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>
|
|
<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<<a class="el" href="structboost_1_1hana_1_1string__tag.html" title="Tag representing a compile-time string.">string_tag</a>></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>
|
|
<h2><a class="anchor" id="autotoc_md372"></a>
|
|
Example</h2>
|
|
<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 <<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="equal_8hpp.html">boost/hana/equal.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="string_8hpp.html">boost/hana/string.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="tuple_8hpp.html">boost/hana/tuple.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="unpack_8hpp.html">boost/hana/unpack.hpp</a>></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<char, 'a', 'e', 'i', 'o', 'u', 'y'>;</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<hana::string_tag>);</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">"aeiouy"</span>));</div>
|
|
<div class="line"> </div>
|
|
<div class="line"><span class="keywordtype">int</span> main() { }</div>
|
|
</div><!-- fragment -->
|
|
</div>
|
|
</div>
|
|
<a id="a810915f5e494decfe47b047a3500c577"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a810915f5e494decfe47b047a3500c577">◆ </a></span>string_c</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename implementation_defined > </div>
|
|
<div class="memtemplate">
|
|
template<char ... s> </div>
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">constexpr <a class="el" href="structboost_1_1hana_1_1string.html">string</a><implementation_defined> string_c {}</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">related</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Create a compile-time string from a parameter pack of characters. </p>
|
|
<h2><a class="anchor" id="autotoc_md373"></a>
|
|
Example</h2>
|
|
<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 <<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="core_2is__a_8hpp.html">boost/hana/core/is_a.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="string_8hpp.html">boost/hana/string.hpp</a>></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<'a', 'b', 'c', 'd', 'e', 'f'>;</div>
|
|
<div class="line"><a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(hana::is_a<hana::string_tag>(str));</div>
|
|
<div class="line"> </div>
|
|
<div class="line"><span class="keywordtype">int</span> main() { }</div>
|
|
</div><!-- fragment -->
|
|
</div>
|
|
</div>
|
|
<a id="a7f15faa77e126e1c2b08a2224ceefb84"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a7f15faa77e126e1c2b08a2224ceefb84">◆ </a></span>BOOST_HANA_STRING</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename implementation_defined > </div>
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">#define BOOST_HANA_STRING</td>
|
|
<td>(</td>
|
|
<td class="paramtype"> </td>
|
|
<td class="paramname">s</td><td>)</td>
|
|
<td>   see documentation</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">related</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Create a compile-time string from a string literal. </p>
|
|
<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>
|
|
<h2><a class="anchor" id="autotoc_md374"></a>
|
|
Example</h2>
|
|
<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 <<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="config_8hpp.html">boost/hana/config.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="core_2is__a_8hpp.html">boost/hana/core/is_a.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="equal_8hpp.html">boost/hana/equal.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="string_8hpp.html">boost/hana/string.hpp</a>></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">"abcdef"</span>);</div>
|
|
<div class="line"> <a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(str == hana::string_c<'a', 'b', 'c', 'd', 'e', 'f'>);</div>
|
|
<div class="line"> <a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(hana::is_a<hana::string_tag>(str));</div>
|
|
<div class="line">}</div>
|
|
</div><!-- fragment -->
|
|
</div>
|
|
</div>
|
|
<a id="ad77f7afff008c2ce15739ad16a8bf0a8"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ad77f7afff008c2ce15739ad16a8bf0a8">◆ </a></span>operator""_s()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename CharT , CharT ... s> </div>
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">constexpr auto operator""_s </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">related</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Creates a compile-time string from a string literal. </p>
|
|
<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>
|
|
<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>
|
|
<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>
|
|
<h2><a class="anchor" id="autotoc_md375"></a>
|
|
Example</h2>
|
|
<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 <<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="config_8hpp.html">boost/hana/config.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="core_2is__a_8hpp.html">boost/hana/core/is_a.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="equal_8hpp.html">boost/hana/equal.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="integral__constant_8hpp.html">boost/hana/integral_constant.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="length_8hpp.html">boost/hana/length.hpp</a>></span></div>
|
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="string_8hpp.html">boost/hana/string.hpp</a>></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">"Hello world!"</span>_s;</div>
|
|
<div class="line"> <a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(str == hana::string_c<<span class="charliteral">'H'</span>, <span class="charliteral">'e'</span>, <span class="charliteral">'l'</span>, <span class="charliteral">'l'</span>, <span class="charliteral">'o'</span>, <span class="charliteral">' '</span>,</div>
|
|
<div class="line"> <span class="charliteral">'w'</span>, <span class="charliteral">'o'</span>, <span class="charliteral">'r'</span>, <span class="charliteral">'l'</span>, <span class="charliteral">'d'</span>, <span class="charliteral">'!'</span>>);</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<hana::string_tag>(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<12>);</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 -->
|
|
</div>
|
|
</div>
|
|
</div><!-- contents -->
|
|
</div><!-- doc-content -->
|
|
<div class="ttc" id="aless_8hpp_html"><div class="ttname"><a href="less_8hpp.html">less.hpp</a></div><div class="ttdoc">Defines boost::hana::less.</div></div>
|
|
<div class="ttc" id="aequal_8hpp_html"><div class="ttname"><a href="equal_8hpp.html">equal.hpp</a></div><div class="ttdoc">Defines boost::hana::equal.</div></div>
|
|
<div class="ttc" id="agroup__group-_iterable_html_ga2a05f564f8a7e4afa04fcbc07ad8f394"><div class="ttname"><a href="group__group-_iterable.html#ga2a05f564f8a7e4afa04fcbc07ad8f394">boost::hana::is_empty</a></div><div class="ttdeci">constexpr auto is_empty</div><div class="ttdoc">Returns whether the iterable is empty.</div><div class="ttdef"><b>Definition:</b> is_empty.hpp:33</div></div>
|
|
<div class="ttc" id="ahash_8hpp_html"><div class="ttname"><a href="hash_8hpp.html">hash.hpp</a></div><div class="ttdoc">Defines boost::hana::hash.</div></div>
|
|
<div class="ttc" id="agroup__group-assertions_html_ga2c5006540936d9f8880e3a39f4fcc035"><div class="ttname"><a href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a></div><div class="ttdeci">#define BOOST_HANA_CONSTANT_CHECK(...)</div><div class="ttdoc">Equivalent to BOOST_HANA_CONSTANT_ASSERT, but not influenced by the BOOST_HANA_CONFIG_DISABLE_ASSERTI...</div><div class="ttdef"><b>Definition:</b> assert.hpp:239</div></div>
|
|
<div class="ttc" id="aconfig_8hpp_html"><div class="ttname"><a href="config_8hpp.html">config.hpp</a></div><div class="ttdoc">Defines configuration macros used throughout the library.</div></div>
|
|
<div class="ttc" id="atuple_8hpp_html"><div class="ttname"><a href="tuple_8hpp.html">tuple.hpp</a></div><div class="ttdoc">Defines boost::hana::tuple.</div></div>
|
|
<div class="ttc" id="acore_2is__a_8hpp_html"><div class="ttname"><a href="core_2is__a_8hpp.html">is_a.hpp</a></div><div class="ttdoc">Defines boost::hana::is_a and boost::hana::is_an.</div></div>
|
|
<div class="ttc" id="aintegral__constant_8hpp_html"><div class="ttname"><a href="integral__constant_8hpp.html">integral_constant.hpp</a></div><div class="ttdoc">Defines boost::hana::integral_constant.</div></div>
|
|
<div class="ttc" id="agroup__group-_foldable_html_ga650def4b2e98f4273d8b9b7aa5a2fc28"><div class="ttname"><a href="group__group-_foldable.html#ga650def4b2e98f4273d8b9b7aa5a2fc28">boost::hana::sum</a></div><div class="ttdeci">constexpr auto sum</div><div class="ttdoc">Compute the sum of the numbers of a structure.</div><div class="ttdef"><b>Definition:</b> sum.hpp:66</div></div>
|
|
<div class="ttc" id="agroup__group-_searchable_html_ga6b6cdd69942b0fe3bf5254247f9c861e"><div class="ttname"><a href="group__group-_searchable.html#ga6b6cdd69942b0fe3bf5254247f9c861e">boost::hana::find</a></div><div class="ttdeci">constexpr auto find</div><div class="ttdoc">Finds the value associated to the given key in a structure.</div><div class="ttdef"><b>Definition:</b> find.hpp:44</div></div>
|
|
<div class="ttc" id="afind_8hpp_html"><div class="ttname"><a href="find_8hpp.html">find.hpp</a></div><div class="ttdoc">Defines boost::hana::find.</div></div>
|
|
<div class="ttc" id="agroup__group-_constant_html_ga1687520692a6b0c49e3a69de2980f388"><div class="ttname"><a href="group__group-_constant.html#ga1687520692a6b0c49e3a69de2980f388">boost::hana::value</a></div><div class="ttdeci">constexpr auto value</div><div class="ttdoc">Return the compile-time value associated to a constant.</div><div class="ttdef"><b>Definition:</b> value.hpp:54</div></div>
|
|
<div class="ttc" id="agroup__group-_iterable_html_ga9f1d02c74a6bdc1db260e0d6a8f1ee56"><div class="ttname"><a href="group__group-_iterable.html#ga9f1d02c74a6bdc1db260e0d6a8f1ee56">boost::hana::drop_while</a></div><div class="ttdeci">constexpr auto drop_while</div><div class="ttdoc">Drop elements from an iterable up to, but excluding, the first element for which the predicate is not...</div><div class="ttdef"><b>Definition:</b> drop_while.hpp:44</div></div>
|
|
<div class="ttc" id="astring_8hpp_html"><div class="ttname"><a href="string_8hpp.html">string.hpp</a></div><div class="ttdoc">Defines boost::hana::string.</div></div>
|
|
<div class="ttc" id="agroup__group-_foldable_html_gaf0f8f717245620dc28cd7d7fa44d7475"><div class="ttname"><a href="group__group-_foldable.html#gaf0f8f717245620dc28cd7d7fa44d7475">boost::hana::length</a></div><div class="ttdeci">constexpr auto length</div><div class="ttdoc">Return the number of elements in a foldable structure.</div><div class="ttdef"><b>Definition:</b> length.hpp:34</div></div>
|
|
<div class="ttc" id="acontains_8hpp_html"><div class="ttname"><a href="contains_8hpp.html">contains.hpp</a></div><div class="ttdoc">Defines boost::hana::contains and boost::hana::in.</div></div>
|
|
<div class="ttc" id="astructboost_1_1hana_1_1string_html_a7f15faa77e126e1c2b08a2224ceefb84"><div class="ttname"><a href="structboost_1_1hana_1_1string.html#a7f15faa77e126e1c2b08a2224ceefb84">boost::hana::string::BOOST_HANA_STRING</a></div><div class="ttdeci">#define BOOST_HANA_STRING(s)</div><div class="ttdoc">Create a compile-time string from a string literal.</div><div class="ttdef"><b>Definition:</b> string.hpp:225</div></div>
|
|
<div class="ttc" id="aplus_8hpp_html"><div class="ttname"><a href="plus_8hpp.html">plus.hpp</a></div><div class="ttdoc">Defines boost::hana::plus.</div></div>
|
|
<div class="ttc" id="agreater_8hpp_html"><div class="ttname"><a href="greater_8hpp.html">greater.hpp</a></div><div class="ttdoc">Defines boost::hana::greater.</div></div>
|
|
<div class="ttc" id="anamespaceboost_1_1hana_html"><div class="ttname"><a href="namespaceboost_1_1hana.html">boost::hana</a></div><div class="ttdoc">Namespace containing everything in the library.</div><div class="ttdef"><b>Definition:</b> accessors.hpp:20</div></div>
|
|
<div class="ttc" id="agroup__group-_foldable_html_ga7b0c23944364ce61136e10b978ae2170"><div class="ttname"><a href="group__group-_foldable.html#ga7b0c23944364ce61136e10b978ae2170">boost::hana::unpack</a></div><div class="ttdeci">constexpr auto unpack</div><div class="ttdoc">Invoke a function with the elements of a Foldable as arguments.</div><div class="ttdef"><b>Definition:</b> unpack.hpp:79</div></div>
|
|
<div class="ttc" id="agroup__group-_searchable_html_ga0d9456ceda38b6ca664998e79d7c45b7"><div class="ttname"><a href="group__group-_searchable.html#ga0d9456ceda38b6ca664998e79d7c45b7">boost::hana::in</a></div><div class="ttdeci">constexpr auto in</div><div class="ttdoc">Return whether the key occurs in the structure.</div><div class="ttdef"><b>Definition:</b> contains.hpp:70</div></div>
|
|
<div class="ttc" id="aassert_8hpp_html"><div class="ttname"><a href="assert_8hpp.html">assert.hpp</a></div><div class="ttdoc">Defines macros to perform different kinds of assertions.</div></div>
|
|
<div class="ttc" id="afold__left_8hpp_html"><div class="ttname"><a href="fold__left_8hpp.html">fold_left.hpp</a></div><div class="ttdoc">Defines boost::hana::fold_left.</div></div>
|
|
<div class="ttc" id="acore_2to_8hpp_html"><div class="ttname"><a href="core_2to_8hpp.html">to.hpp</a></div><div class="ttdoc">Defines boost::hana::to and related utilities.</div></div>
|
|
<div class="ttc" id="avalue_8hpp_html"><div class="ttname"><a href="value_8hpp.html">value.hpp</a></div><div class="ttdoc">Defines boost::hana::value.</div></div>
|
|
<div class="ttc" id="anot__equal_8hpp_html"><div class="ttname"><a href="not__equal_8hpp.html">not_equal.hpp</a></div><div class="ttdoc">Defines boost::hana::not_equal.</div></div>
|
|
<div class="ttc" id="ais__empty_8hpp_html"><div class="ttname"><a href="is__empty_8hpp.html">is_empty.hpp</a></div><div class="ttdoc">Defines boost::hana::is_empty.</div></div>
|
|
<div class="ttc" id="agroup__group-_comparable_html_gae33be2e0d5e04f19082f4b7740dfc9cd"><div class="ttname"><a href="group__group-_comparable.html#gae33be2e0d5e04f19082f4b7740dfc9cd">boost::hana::not_equal</a></div><div class="ttdeci">constexpr auto not_equal</div><div class="ttdoc">Returns a Logical representing whether x is not equal to y.</div><div class="ttdef"><b>Definition:</b> not_equal.hpp:54</div></div>
|
|
<div class="ttc" id="alength_8hpp_html"><div class="ttname"><a href="length_8hpp.html">length.hpp</a></div><div class="ttdoc">Defines boost::hana::length.</div></div>
|
|
<div class="ttc" id="adrop__while_8hpp_html"><div class="ttname"><a href="drop__while_8hpp.html">drop_while.hpp</a></div><div class="ttdoc">Defines boost::hana::drop_while.</div></div>
|
|
<div class="ttc" id="aunpack_8hpp_html"><div class="ttname"><a href="unpack_8hpp.html">unpack.hpp</a></div><div class="ttdoc">Defines boost::hana::unpack.</div></div>
|
|
<div class="ttc" id="aoptional_8hpp_html"><div class="ttname"><a href="optional_8hpp.html">optional.hpp</a></div><div class="ttdoc">Defines boost::hana::optional.</div></div>
|
|
<!--
|
|
Copyright Louis Dionne 2013-2017
|
|
Distributed under the Boost Software License, Version 1.0.
|
|
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
|
|
-->
|
|
<!-- boost-no-inspect -->
|
|
<!-- HTML footer for doxygen 1.8.9.1-->
|
|
<!-- start footer part -->
|
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
|
<ul>
|
|
<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>
|
|
</ul>
|
|
</div>
|
|
</body>
|
|
</html>
|