add doc: char_traits character operations

This commit is contained in:
Bolero-MURAKAMI 2013-09-05 13:09:04 +09:00
parent 55eba4ae71
commit b7d68b357d
23 changed files with 1569 additions and 25 deletions

View file

@ -0,0 +1,40 @@
.. _sprout-string-char_traits-assign:
###############################################################################
assign
###############################################################################
Interface
========================================
.. sourcecode:: c++
static void assign(char_type& c1, char_type const& c2);
Effects
========================================
| Equivalent to ``std::char_traits<Char>::assign(c1, c2)``.
Examples
========================================
.. sourcecode:: c++
#include <sprout/string.hpp>
#include <sprout/assert.hpp>
using namespace sprout;
char x = 'H';
SPROUT_STATIC_CONSTEXPR char y = 'M';
char_traits<char>::assign(x, y);
SPROUT_ASSERT_MSG(x == y, "y is assigned to x.");
Complexity
========================================
| constant.
Header
========================================
| ``sprout/string/char_traits.hpp``
| Convenience header: ``sprout/string.hpp``

View file

@ -0,0 +1,40 @@
.. _sprout-string-char_traits-compare:
###############################################################################
compare
###############################################################################
Interface
========================================
.. sourcecode:: c++
static SPROUT_CONSTEXPR int compare(char_type const* s1, char_type const* s2, std::size_t n);
Returns
========================================
| Equivalent to ``std::char_traits<Char>::compare(s1, s2, n)`` in constant expression.
Examples
========================================
.. sourcecode:: c++
#include <sprout/string.hpp>
using namespace sprout;
SPROUT_STATIC_CONSTEXPR char const* x = "homuhomu";
SPROUT_STATIC_CONSTEXPR char const* y = "madocchi";
SPROUT_STATIC_CONSTEXPR auto result = char_traits<char>::compare(x, y, 8);
static_assert(result < 0, "x is less than y.");
Complexity
========================================
| linear.
| Recursive function invocations in *O(logN)* (logarithmic) depth.
Header
========================================
| ``sprout/string/char_traits.hpp``
| Convenience header: ``sprout/string.hpp``

View file

@ -0,0 +1,40 @@
.. _sprout-string-char_traits-eq:
###############################################################################
eq
###############################################################################
Interface
========================================
.. sourcecode:: c++
static SPROUT_CONSTEXPR bool eq(char_type c1, char_type c2) SPROUT_NOEXCEPT;
Effects
========================================
| Equivalent to ``std::char_traits<Char>::eq(c1, c2)``.
Examples
========================================
.. sourcecode:: c++
#include <sprout/string.hpp>
using namespace sprout;
SPROUT_STATIC_CONSTEXPR char x = 'H';
SPROUT_STATIC_CONSTEXPR char y = 'H';
SPROUT_STATIC_CONSTEXPR auto result = char_traits<char>::eq(x, y);
static_assert(result, "x is equal to y.");
Complexity
========================================
| constant.
| Recursive function invocations in *O(1)* (constant) depth.
Header
========================================
| ``sprout/string/char_traits.hpp``
| Convenience header: ``sprout/string.hpp``

View file

@ -0,0 +1,40 @@
.. _sprout-string-char_traits-find:
###############################################################################
find
###############################################################################
Interface
========================================
.. sourcecode:: c++
static SPROUT_CONSTEXPR char_type const* find(char_type const* s, std::size_t n, char_type const& a);
Returns
========================================
| Equivalent to ``std::char_traits<Char>::find(s, n, a)`` in constant expression.
Examples
========================================
.. sourcecode:: c++
#include <sprout/string.hpp>
#include <sprout/iterator.hpp>
using namespace sprout;
SPROUT_STATIC_CONSTEXPR char const* x = "homuhomu";
SPROUT_STATIC_CONSTEXPR auto result = char_traits<char>::find(x, 8, 'm');
static_assert(sprout::distance(x, result) == 2, "a found position is 2.");
Complexity
========================================
| linear.
| Recursive function invocations in *O(logN)* (logarithmic) depth.
Header
========================================
| ``sprout/string/char_traits.hpp``
| Convenience header: ``sprout/string.hpp``

View file

@ -6,6 +6,13 @@ char_traits
.. toctree::
:hidden:
assign
rq
lt
compare
length
find
Interface
========================================
.. sourcecode:: c++
@ -74,7 +81,7 @@ pos_type std::char_traits<Char>::pos_type
state_type std::char_traits<Char>::state_type
======================================== =============================================================================== =======================================
Static Member functions
Static member functions
----------------------------------------
character operations
@ -95,11 +102,11 @@ string operations
function
======================================== ===============================================================================
:doc:`compare <./compare>`
:doc:`eqlength<./length>`
:doc:`length<./length>`
:doc:`find <./find>`
:doc:`move <./move>`
:doc:`copy <./copy>`
:doc:`assign <./assign>`
:doc:`assign <./assign-string>`
======================================== ===============================================================================
integer type operations

View file

@ -0,0 +1,39 @@
.. _sprout-string-char_traits-length:
###############################################################################
length
###############################################################################
Interface
========================================
.. sourcecode:: c++
static SPROUT_CONSTEXPR std::size_t length(char_type const* s);
Returns
========================================
| Equivalent to ``std::char_traits<Char>::length(s)`` in constant expression.
Examples
========================================
.. sourcecode:: c++
#include <sprout/string.hpp>
using namespace sprout;
SPROUT_STATIC_CONSTEXPR char const* x = "homuhomu";
SPROUT_STATIC_CONSTEXPR auto result = char_traits<char>::length(x);
static_assert(result == 8, "length of x is 8.");
Complexity
========================================
| linear.
| Recursive function invocations in *O(logN)* (logarithmic) depth.
Header
========================================
| ``sprout/string/char_traits.hpp``
| Convenience header: ``sprout/string.hpp``

View file

@ -0,0 +1,40 @@
.. _sprout-string-char_traits-lt:
###############################################################################
lt
###############################################################################
Interface
========================================
.. sourcecode:: c++
static SPROUT_CONSTEXPR bool lt(char_type c1, char_type c2) SPROUT_NOEXCEPT;
Effects
========================================
| Equivalent to ``std::char_traits<Char>::lt(c1, c2)``.
Examples
========================================
.. sourcecode:: c++
#include <sprout/string.hpp>
using namespace sprout;
SPROUT_STATIC_CONSTEXPR char x = 'H';
SPROUT_STATIC_CONSTEXPR char y = 'M';
SPROUT_STATIC_CONSTEXPR auto result = char_traits<char>::lt(x, y);
static_assert(result, "x is less than y.");
Complexity
========================================
| constant.
| Recursive function invocations in *O(1)* (constant) depth.
Header
========================================
| ``sprout/string/char_traits.hpp``
| Convenience header: ``sprout/string.hpp``

View file

@ -39,7 +39,7 @@
<link rel="top" title="Sprout 1.0 documentation" href="../../../index.html" />
<link rel="up" title="Sprout.String" href="../index.html" />
<link rel="next" title="operator+" href="operator-plus.html" />
<link rel="prev" title="char_traits" href="../char_traits/index.html" />
<link rel="prev" title="find" href="../char_traits/find.html" />
</head>
<body>
<div class="related">
@ -52,7 +52,7 @@
<a href="operator-plus.html" title="operator+"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="../char_traits/index.html" title="char_traits"
<a href="../char_traits/find.html" title="find"
accesskey="P">previous</a> |</li>
<li><a href="../../../index.html">Sprout 1.0 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Libraries</a> &raquo;</li>
@ -75,8 +75,8 @@
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="../char_traits/index.html"
title="previous chapter">char_traits</a></p>
<p class="topless"><a href="../char_traits/find.html"
title="previous chapter">find</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="operator-plus.html"
title="next chapter">operator+</a></p>
@ -173,7 +173,7 @@
<a href="operator-plus.html" title="operator+"
>next</a> |</li>
<li class="right" >
<a href="../char_traits/index.html" title="char_traits"
<a href="../char_traits/find.html" title="find"
>previous</a> |</li>
<li><a href="../../../index.html">Sprout 1.0 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Libraries</a> &raquo;</li>

View file

@ -0,0 +1,180 @@
<!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/html; charset=utf-8" />
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-43764535-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<title>assign &mdash; Sprout 1.0 documentation</title>
<link rel="stylesheet" href="../../../_static/sphinxdoc.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../../',
VERSION: '1.0',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../_static/doctools.js"></script>
<link rel="top" title="Sprout 1.0 documentation" href="../../../index.html" />
<link rel="up" title="char_traits" href="index.html" />
<link rel="next" title="lt" href="lt.html" />
<link rel="prev" title="char_traits" href="index.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="lt.html" title="lt"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="index.html" title="char_traits"
accesskey="P">previous</a> |</li>
<li><a href="../../../index.html">Sprout 1.0 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Libraries</a> &raquo;</li>
<li><a href="../index.html" >Sprout.String</a> &raquo;</li>
<li><a href="index.html" accesskey="U">char_traits</a> &raquo;</li>
</ul>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="../../../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">assign</a><ul>
<li><a class="reference internal" href="#interface">Interface</a></li>
<li><a class="reference internal" href="#effects">Effects</a></li>
<li><a class="reference internal" href="#examples">Examples</a></li>
<li><a class="reference internal" href="#complexity">Complexity</a></li>
<li><a class="reference internal" href="#header">Header</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="index.html"
title="previous chapter">char_traits</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="lt.html"
title="next chapter">lt</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../../_sources/libs/string/char_traits/assign.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../../../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="assign">
<h1>assign<a class="headerlink" href="#assign" title="Permalink to this headline"></a></h1>
<div class="section" id="interface">
<h2>Interface<a class="headerlink" href="#interface" title="Permalink to this headline"></a></h2>
<div class="highlight-c++"><div class="highlight"><pre><span class="k">static</span> <span class="kt">void</span> <span class="n">assign</span><span class="p">(</span><span class="n">char_type</span><span class="o">&amp;</span> <span class="n">c1</span><span class="p">,</span> <span class="n">char_type</span> <span class="k">const</span><span class="o">&amp;</span> <span class="n">c2</span><span class="p">);</span>
</pre></div>
</div>
</div>
<div class="section" id="effects">
<h2>Effects<a class="headerlink" href="#effects" title="Permalink to this headline"></a></h2>
<div class="line-block">
<div class="line">Equivalent to <tt class="docutils literal"><span class="pre">std::char_traits&lt;Char&gt;::assign(c1,</span> <span class="pre">c2)</span></tt>.</div>
</div>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline"></a></h2>
<div class="highlight-c++"><div class="highlight"><pre><span class="cp">#include &lt;sprout/string.hpp&gt;</span>
<span class="cp">#include &lt;sprout/assert.hpp&gt;</span>
<span class="k">using</span> <span class="k">namespace</span> <span class="n">sprout</span><span class="p">;</span>
<span class="kt">char</span> <span class="n">x</span> <span class="o">=</span> <span class="sc">&#39;H&#39;</span><span class="p">;</span>
<span class="n">SPROUT_STATIC_CONSTEXPR</span> <span class="kt">char</span> <span class="n">y</span> <span class="o">=</span> <span class="sc">&#39;M&#39;</span><span class="p">;</span>
<span class="n">char_traits</span><span class="o">&lt;</span><span class="kt">char</span><span class="o">&gt;::</span><span class="n">assign</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">);</span>
<span class="n">SPROUT_ASSERT_MSG</span><span class="p">(</span><span class="n">x</span> <span class="o">==</span> <span class="n">y</span><span class="p">,</span> <span class="s">&quot;y is assigned to x.&quot;</span><span class="p">);</span>
</pre></div>
</div>
</div>
<div class="section" id="complexity">
<h2>Complexity<a class="headerlink" href="#complexity" title="Permalink to this headline"></a></h2>
<div class="line-block">
<div class="line">constant.</div>
</div>
</div>
<div class="section" id="header">
<h2>Header<a class="headerlink" href="#header" title="Permalink to this headline"></a></h2>
<div class="line-block">
<div class="line"><tt class="docutils literal"><span class="pre">sprout/string/char_traits.hpp</span></tt></div>
<div class="line">Convenience header: <tt class="docutils literal"><span class="pre">sprout/string.hpp</span></tt></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="lt.html" title="lt"
>next</a> |</li>
<li class="right" >
<a href="index.html" title="char_traits"
>previous</a> |</li>
<li><a href="../../../index.html">Sprout 1.0 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Libraries</a> &raquo;</li>
<li><a href="../index.html" >Sprout.String</a> &raquo;</li>
<li><a href="index.html" >char_traits</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2013, Bolero MURAKAMI.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
</div>
</body>
</html>

View file

@ -0,0 +1,180 @@
<!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/html; charset=utf-8" />
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-43764535-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<title>compare &mdash; Sprout 1.0 documentation</title>
<link rel="stylesheet" href="../../../_static/sphinxdoc.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../../',
VERSION: '1.0',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../_static/doctools.js"></script>
<link rel="top" title="Sprout 1.0 documentation" href="../../../index.html" />
<link rel="up" title="char_traits" href="index.html" />
<link rel="next" title="length" href="length.html" />
<link rel="prev" title="lt" href="lt.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="length.html" title="length"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="lt.html" title="lt"
accesskey="P">previous</a> |</li>
<li><a href="../../../index.html">Sprout 1.0 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Libraries</a> &raquo;</li>
<li><a href="../index.html" >Sprout.String</a> &raquo;</li>
<li><a href="index.html" accesskey="U">char_traits</a> &raquo;</li>
</ul>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="../../../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">compare</a><ul>
<li><a class="reference internal" href="#interface">Interface</a></li>
<li><a class="reference internal" href="#returns">Returns</a></li>
<li><a class="reference internal" href="#examples">Examples</a></li>
<li><a class="reference internal" href="#complexity">Complexity</a></li>
<li><a class="reference internal" href="#header">Header</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="lt.html"
title="previous chapter">lt</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="length.html"
title="next chapter">length</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../../_sources/libs/string/char_traits/compare.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../../../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="compare">
<h1>compare<a class="headerlink" href="#compare" title="Permalink to this headline"></a></h1>
<div class="section" id="interface">
<h2>Interface<a class="headerlink" href="#interface" title="Permalink to this headline"></a></h2>
<div class="highlight-c++"><div class="highlight"><pre><span class="k">static</span> <span class="n">SPROUT_CONSTEXPR</span> <span class="kt">int</span> <span class="n">compare</span><span class="p">(</span><span class="n">char_type</span> <span class="k">const</span><span class="o">*</span> <span class="n">s1</span><span class="p">,</span> <span class="n">char_type</span> <span class="k">const</span><span class="o">*</span> <span class="n">s2</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">size_t</span> <span class="n">n</span><span class="p">);</span>
</pre></div>
</div>
</div>
<div class="section" id="returns">
<h2>Returns<a class="headerlink" href="#returns" title="Permalink to this headline"></a></h2>
<div class="line-block">
<div class="line">Equivalent to <tt class="docutils literal"><span class="pre">std::char_traits&lt;Char&gt;::compare(s1,</span> <span class="pre">s2,</span> <span class="pre">n)</span></tt> in constant expression.</div>
</div>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline"></a></h2>
<div class="highlight-c++"><div class="highlight"><pre><span class="cp">#include &lt;sprout/string.hpp&gt;</span>
<span class="k">using</span> <span class="k">namespace</span> <span class="n">sprout</span><span class="p">;</span>
<span class="n">SPROUT_STATIC_CONSTEXPR</span> <span class="kt">char</span> <span class="k">const</span><span class="o">*</span> <span class="n">x</span> <span class="o">=</span> <span class="s">&quot;homuhomu&quot;</span><span class="p">;</span>
<span class="n">SPROUT_STATIC_CONSTEXPR</span> <span class="kt">char</span> <span class="k">const</span><span class="o">*</span> <span class="n">y</span> <span class="o">=</span> <span class="s">&quot;madocchi&quot;</span><span class="p">;</span>
<span class="n">SPROUT_STATIC_CONSTEXPR</span> <span class="k">auto</span> <span class="n">result</span> <span class="o">=</span> <span class="n">char_traits</span><span class="o">&lt;</span><span class="kt">char</span><span class="o">&gt;::</span><span class="n">compare</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="mi">8</span><span class="p">);</span>
<span class="n">static_assert</span><span class="p">(</span><span class="n">result</span> <span class="o">&lt;</span> <span class="mi">0</span><span class="p">,</span> <span class="s">&quot;x is less than y.&quot;</span><span class="p">);</span>
</pre></div>
</div>
</div>
<div class="section" id="complexity">
<h2>Complexity<a class="headerlink" href="#complexity" title="Permalink to this headline"></a></h2>
<div class="line-block">
<div class="line">linear.</div>
<div class="line">Recursive function invocations in <em>O(logN)</em> (logarithmic) depth.</div>
</div>
</div>
<div class="section" id="header">
<h2>Header<a class="headerlink" href="#header" title="Permalink to this headline"></a></h2>
<div class="line-block">
<div class="line"><tt class="docutils literal"><span class="pre">sprout/string/char_traits.hpp</span></tt></div>
<div class="line">Convenience header: <tt class="docutils literal"><span class="pre">sprout/string.hpp</span></tt></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="length.html" title="length"
>next</a> |</li>
<li class="right" >
<a href="lt.html" title="lt"
>previous</a> |</li>
<li><a href="../../../index.html">Sprout 1.0 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Libraries</a> &raquo;</li>
<li><a href="../index.html" >Sprout.String</a> &raquo;</li>
<li><a href="index.html" >char_traits</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2013, Bolero MURAKAMI.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
</div>
</body>
</html>

View file

@ -0,0 +1,153 @@
<!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/html; charset=utf-8" />
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-43764535-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<title>eq &mdash; Sprout 1.0 documentation</title>
<link rel="stylesheet" href="../../../_static/sphinxdoc.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../../',
VERSION: '1.0',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../_static/doctools.js"></script>
<link rel="top" title="Sprout 1.0 documentation" href="../../../index.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li><a href="../../../index.html">Sprout 1.0 documentation</a> &raquo;</li>
</ul>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="../../../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">eq</a><ul>
<li><a class="reference internal" href="#interface">Interface</a></li>
<li><a class="reference internal" href="#effects">Effects</a></li>
<li><a class="reference internal" href="#examples">Examples</a></li>
<li><a class="reference internal" href="#complexity">Complexity</a></li>
<li><a class="reference internal" href="#header">Header</a></li>
</ul>
</li>
</ul>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../../_sources/libs/string/char_traits/eq.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../../../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="eq">
<h1>eq<a class="headerlink" href="#eq" title="Permalink to this headline"></a></h1>
<div class="section" id="interface">
<h2>Interface<a class="headerlink" href="#interface" title="Permalink to this headline"></a></h2>
<div class="highlight-c++"><div class="highlight"><pre><span class="k">static</span> <span class="n">SPROUT_CONSTEXPR</span> <span class="kt">bool</span> <span class="n">eq</span><span class="p">(</span><span class="n">char_type</span> <span class="n">c1</span><span class="p">,</span> <span class="n">char_type</span> <span class="n">c2</span><span class="p">)</span> <span class="n">SPROUT_NOEXCEPT</span><span class="p">;</span>
</pre></div>
</div>
</div>
<div class="section" id="effects">
<h2>Effects<a class="headerlink" href="#effects" title="Permalink to this headline"></a></h2>
<div class="line-block">
<div class="line">Equivalent to <tt class="docutils literal"><span class="pre">std::char_traits&lt;Char&gt;::eq(c1,</span> <span class="pre">c2)</span></tt>.</div>
</div>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline"></a></h2>
<div class="highlight-c++"><div class="highlight"><pre><span class="cp">#include &lt;sprout/string.hpp&gt;</span>
<span class="k">using</span> <span class="k">namespace</span> <span class="n">sprout</span><span class="p">;</span>
<span class="n">SPROUT_STATIC_CONSTEXPR</span> <span class="kt">char</span> <span class="n">x</span> <span class="o">=</span> <span class="sc">&#39;H&#39;</span><span class="p">;</span>
<span class="n">SPROUT_STATIC_CONSTEXPR</span> <span class="kt">char</span> <span class="n">y</span> <span class="o">=</span> <span class="sc">&#39;H&#39;</span><span class="p">;</span>
<span class="n">SPROUT_STATIC_CONSTEXPR</span> <span class="k">auto</span> <span class="n">result</span> <span class="o">=</span> <span class="n">char_traits</span><span class="o">&lt;</span><span class="kt">char</span><span class="o">&gt;::</span><span class="n">eq</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">);</span>
<span class="n">static_assert</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="s">&quot;x is equal to y.&quot;</span><span class="p">);</span>
</pre></div>
</div>
</div>
<div class="section" id="complexity">
<h2>Complexity<a class="headerlink" href="#complexity" title="Permalink to this headline"></a></h2>
<div class="line-block">
<div class="line">constant.</div>
<div class="line">Recursive function invocations in <em>O(1)</em> (constant) depth.</div>
</div>
</div>
<div class="section" id="header">
<h2>Header<a class="headerlink" href="#header" title="Permalink to this headline"></a></h2>
<div class="line-block">
<div class="line"><tt class="docutils literal"><span class="pre">sprout/string/char_traits.hpp</span></tt></div>
<div class="line">Convenience header: <tt class="docutils literal"><span class="pre">sprout/string.hpp</span></tt></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../../genindex.html" title="General Index"
>index</a></li>
<li><a href="../../../index.html">Sprout 1.0 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2013, Bolero MURAKAMI.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
</div>
</body>
</html>

View file

@ -0,0 +1,180 @@
<!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/html; charset=utf-8" />
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-43764535-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<title>find &mdash; Sprout 1.0 documentation</title>
<link rel="stylesheet" href="../../../_static/sphinxdoc.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../../',
VERSION: '1.0',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../_static/doctools.js"></script>
<link rel="top" title="Sprout 1.0 documentation" href="../../../index.html" />
<link rel="up" title="char_traits" href="index.html" />
<link rel="next" title="swap" href="../basic_string/swap-global.html" />
<link rel="prev" title="length" href="length.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../basic_string/swap-global.html" title="swap"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="length.html" title="length"
accesskey="P">previous</a> |</li>
<li><a href="../../../index.html">Sprout 1.0 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Libraries</a> &raquo;</li>
<li><a href="../index.html" >Sprout.String</a> &raquo;</li>
<li><a href="index.html" accesskey="U">char_traits</a> &raquo;</li>
</ul>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="../../../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">find</a><ul>
<li><a class="reference internal" href="#interface">Interface</a></li>
<li><a class="reference internal" href="#returns">Returns</a></li>
<li><a class="reference internal" href="#examples">Examples</a></li>
<li><a class="reference internal" href="#complexity">Complexity</a></li>
<li><a class="reference internal" href="#header">Header</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="length.html"
title="previous chapter">length</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="../basic_string/swap-global.html"
title="next chapter">swap</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../../_sources/libs/string/char_traits/find.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../../../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="find">
<h1>find<a class="headerlink" href="#find" title="Permalink to this headline"></a></h1>
<div class="section" id="interface">
<h2>Interface<a class="headerlink" href="#interface" title="Permalink to this headline"></a></h2>
<div class="highlight-c++"><div class="highlight"><pre><span class="k">static</span> <span class="n">SPROUT_CONSTEXPR</span> <span class="n">char_type</span> <span class="k">const</span><span class="o">*</span> <span class="n">find</span><span class="p">(</span><span class="n">char_type</span> <span class="k">const</span><span class="o">*</span> <span class="n">s</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">size_t</span> <span class="n">n</span><span class="p">,</span> <span class="n">char_type</span> <span class="k">const</span><span class="o">&amp;</span> <span class="n">a</span><span class="p">);</span>
</pre></div>
</div>
</div>
<div class="section" id="returns">
<h2>Returns<a class="headerlink" href="#returns" title="Permalink to this headline"></a></h2>
<div class="line-block">
<div class="line">Equivalent to <tt class="docutils literal"><span class="pre">std::char_traits&lt;Char&gt;::find(s,</span> <span class="pre">n,</span> <span class="pre">a)</span></tt> in constant expression.</div>
</div>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline"></a></h2>
<div class="highlight-c++"><div class="highlight"><pre><span class="cp">#include &lt;sprout/string.hpp&gt;</span>
<span class="cp">#include &lt;sprout/iterator.hpp&gt;</span>
<span class="k">using</span> <span class="k">namespace</span> <span class="n">sprout</span><span class="p">;</span>
<span class="n">SPROUT_STATIC_CONSTEXPR</span> <span class="kt">char</span> <span class="k">const</span><span class="o">*</span> <span class="n">x</span> <span class="o">=</span> <span class="s">&quot;homuhomu&quot;</span><span class="p">;</span>
<span class="n">SPROUT_STATIC_CONSTEXPR</span> <span class="k">auto</span> <span class="n">result</span> <span class="o">=</span> <span class="n">char_traits</span><span class="o">&lt;</span><span class="kt">char</span><span class="o">&gt;::</span><span class="n">find</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">8</span><span class="p">,</span> <span class="sc">&#39;m&#39;</span><span class="p">);</span>
<span class="n">static_assert</span><span class="p">(</span><span class="n">sprout</span><span class="o">::</span><span class="n">distance</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">result</span><span class="p">)</span> <span class="o">==</span> <span class="mi">2</span><span class="p">,</span> <span class="s">&quot;a found position is 2.&quot;</span><span class="p">);</span>
</pre></div>
</div>
</div>
<div class="section" id="complexity">
<h2>Complexity<a class="headerlink" href="#complexity" title="Permalink to this headline"></a></h2>
<div class="line-block">
<div class="line">linear.</div>
<div class="line">Recursive function invocations in <em>O(logN)</em> (logarithmic) depth.</div>
</div>
</div>
<div class="section" id="header">
<h2>Header<a class="headerlink" href="#header" title="Permalink to this headline"></a></h2>
<div class="line-block">
<div class="line"><tt class="docutils literal"><span class="pre">sprout/string/char_traits.hpp</span></tt></div>
<div class="line">Convenience header: <tt class="docutils literal"><span class="pre">sprout/string.hpp</span></tt></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="../basic_string/swap-global.html" title="swap"
>next</a> |</li>
<li class="right" >
<a href="length.html" title="length"
>previous</a> |</li>
<li><a href="../../../index.html">Sprout 1.0 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Libraries</a> &raquo;</li>
<li><a href="../index.html" >Sprout.String</a> &raquo;</li>
<li><a href="index.html" >char_traits</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2013, Bolero MURAKAMI.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
</div>
</body>
</html>

View file

@ -38,7 +38,7 @@
<script type="text/javascript" src="../../../_static/doctools.js"></script>
<link rel="top" title="Sprout 1.0 documentation" href="../../../index.html" />
<link rel="up" title="Sprout.String" href="../index.html" />
<link rel="next" title="swap" href="../basic_string/swap-global.html" />
<link rel="next" title="assign" href="assign.html" />
<link rel="prev" title="Sprout.String" href="../index.html" />
</head>
<body>
@ -49,7 +49,7 @@
<a href="../../../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../basic_string/swap-global.html" title="swap"
<a href="assign.html" title="assign"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="../index.html" title="Sprout.String"
@ -67,7 +67,7 @@
<li><a class="reference internal" href="#interface">Interface</a></li>
<li><a class="reference internal" href="#description">Description</a><ul>
<li><a class="reference internal" href="#member-types">Member types</a></li>
<li><a class="reference internal" href="#static-member-functions">Static Member functions</a><ul>
<li><a class="reference internal" href="#static-member-functions">Static member functions</a><ul>
<li><a class="reference internal" href="#character-operations">character operations</a></li>
<li><a class="reference internal" href="#string-operations">string operations</a></li>
<li><a class="reference internal" href="#integer-type-operations">integer type operations</a></li>
@ -85,8 +85,8 @@
<p class="topless"><a href="../index.html"
title="previous chapter">Sprout.String</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="../basic_string/swap-global.html"
title="next chapter">swap</a></p>
<p class="topless"><a href="assign.html"
title="next chapter">assign</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../../_sources/libs/string/char_traits/index.txt"
@ -210,7 +210,7 @@
</table>
</div>
<div class="section" id="static-member-functions">
<h3>Static Member functions<a class="headerlink" href="#static-member-functions" title="Permalink to this headline"></a></h3>
<h3>Static member functions<a class="headerlink" href="#static-member-functions" title="Permalink to this headline"></a></h3>
<div class="section" id="character-operations">
<h4>character operations<a class="headerlink" href="#character-operations" title="Permalink to this headline"></a></h4>
<table border="1" class="docutils">
@ -224,13 +224,13 @@
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><tt class="xref doc docutils literal"><span class="pre">assign</span></tt></td>
<tr class="row-even"><td><a class="reference internal" href="assign.html"><em>assign</em></a></td>
<td>&nbsp;</td>
</tr>
<tr class="row-odd"><td><tt class="xref doc docutils literal"><span class="pre">eq</span></tt></td>
<tr class="row-odd"><td><a class="reference internal" href="eq.html"><em>eq</em></a></td>
<td>&nbsp;</td>
</tr>
<tr class="row-even"><td><tt class="xref doc docutils literal"><span class="pre">lt</span></tt></td>
<tr class="row-even"><td><a class="reference internal" href="lt.html"><em>lt</em></a></td>
<td>&nbsp;</td>
</tr>
</tbody>
@ -249,13 +249,13 @@
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><tt class="xref doc docutils literal"><span class="pre">compare</span></tt></td>
<tr class="row-even"><td><a class="reference internal" href="compare.html"><em>compare</em></a></td>
<td>&nbsp;</td>
</tr>
<tr class="row-odd"><td><tt class="xref doc docutils literal"><span class="pre">eqlength</span></tt></td>
<tr class="row-odd"><td><a class="reference internal" href="length.html"><em>length</em></a></td>
<td>&nbsp;</td>
</tr>
<tr class="row-even"><td><tt class="xref doc docutils literal"><span class="pre">find</span></tt></td>
<tr class="row-even"><td><a class="reference internal" href="find.html"><em>find</em></a></td>
<td>&nbsp;</td>
</tr>
<tr class="row-odd"><td><tt class="xref doc docutils literal"><span class="pre">move</span></tt></td>
@ -357,7 +357,7 @@
<a href="../../../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="../basic_string/swap-global.html" title="swap"
<a href="assign.html" title="assign"
>next</a> |</li>
<li class="right" >
<a href="../index.html" title="Sprout.String"

View file

@ -0,0 +1,179 @@
<!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/html; charset=utf-8" />
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-43764535-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<title>length &mdash; Sprout 1.0 documentation</title>
<link rel="stylesheet" href="../../../_static/sphinxdoc.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../../',
VERSION: '1.0',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../_static/doctools.js"></script>
<link rel="top" title="Sprout 1.0 documentation" href="../../../index.html" />
<link rel="up" title="char_traits" href="index.html" />
<link rel="next" title="find" href="find.html" />
<link rel="prev" title="compare" href="compare.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="find.html" title="find"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="compare.html" title="compare"
accesskey="P">previous</a> |</li>
<li><a href="../../../index.html">Sprout 1.0 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Libraries</a> &raquo;</li>
<li><a href="../index.html" >Sprout.String</a> &raquo;</li>
<li><a href="index.html" accesskey="U">char_traits</a> &raquo;</li>
</ul>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="../../../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">length</a><ul>
<li><a class="reference internal" href="#interface">Interface</a></li>
<li><a class="reference internal" href="#returns">Returns</a></li>
<li><a class="reference internal" href="#examples">Examples</a></li>
<li><a class="reference internal" href="#complexity">Complexity</a></li>
<li><a class="reference internal" href="#header">Header</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="compare.html"
title="previous chapter">compare</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="find.html"
title="next chapter">find</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../../_sources/libs/string/char_traits/length.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../../../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="length">
<h1>length<a class="headerlink" href="#length" title="Permalink to this headline"></a></h1>
<div class="section" id="interface">
<h2>Interface<a class="headerlink" href="#interface" title="Permalink to this headline"></a></h2>
<div class="highlight-c++"><div class="highlight"><pre><span class="k">static</span> <span class="n">SPROUT_CONSTEXPR</span> <span class="n">std</span><span class="o">::</span><span class="n">size_t</span> <span class="n">length</span><span class="p">(</span><span class="n">char_type</span> <span class="k">const</span><span class="o">*</span> <span class="n">s</span><span class="p">);</span>
</pre></div>
</div>
</div>
<div class="section" id="returns">
<h2>Returns<a class="headerlink" href="#returns" title="Permalink to this headline"></a></h2>
<div class="line-block">
<div class="line">Equivalent to <tt class="docutils literal"><span class="pre">std::char_traits&lt;Char&gt;::length(s)</span></tt> in constant expression.</div>
</div>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline"></a></h2>
<div class="highlight-c++"><div class="highlight"><pre><span class="cp">#include &lt;sprout/string.hpp&gt;</span>
<span class="k">using</span> <span class="k">namespace</span> <span class="n">sprout</span><span class="p">;</span>
<span class="n">SPROUT_STATIC_CONSTEXPR</span> <span class="kt">char</span> <span class="k">const</span><span class="o">*</span> <span class="n">x</span> <span class="o">=</span> <span class="s">&quot;homuhomu&quot;</span><span class="p">;</span>
<span class="n">SPROUT_STATIC_CONSTEXPR</span> <span class="k">auto</span> <span class="n">result</span> <span class="o">=</span> <span class="n">char_traits</span><span class="o">&lt;</span><span class="kt">char</span><span class="o">&gt;::</span><span class="n">length</span><span class="p">(</span><span class="n">x</span><span class="p">);</span>
<span class="n">static_assert</span><span class="p">(</span><span class="n">result</span> <span class="o">==</span> <span class="mi">8</span><span class="p">,</span> <span class="s">&quot;length of x is 8.&quot;</span><span class="p">);</span>
</pre></div>
</div>
</div>
<div class="section" id="complexity">
<h2>Complexity<a class="headerlink" href="#complexity" title="Permalink to this headline"></a></h2>
<div class="line-block">
<div class="line">linear.</div>
<div class="line">Recursive function invocations in <em>O(logN)</em> (logarithmic) depth.</div>
</div>
</div>
<div class="section" id="header">
<h2>Header<a class="headerlink" href="#header" title="Permalink to this headline"></a></h2>
<div class="line-block">
<div class="line"><tt class="docutils literal"><span class="pre">sprout/string/char_traits.hpp</span></tt></div>
<div class="line">Convenience header: <tt class="docutils literal"><span class="pre">sprout/string.hpp</span></tt></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="find.html" title="find"
>next</a> |</li>
<li class="right" >
<a href="compare.html" title="compare"
>previous</a> |</li>
<li><a href="../../../index.html">Sprout 1.0 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Libraries</a> &raquo;</li>
<li><a href="../index.html" >Sprout.String</a> &raquo;</li>
<li><a href="index.html" >char_traits</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2013, Bolero MURAKAMI.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
</div>
</body>
</html>

View file

@ -0,0 +1,180 @@
<!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/html; charset=utf-8" />
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-43764535-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<title>lt &mdash; Sprout 1.0 documentation</title>
<link rel="stylesheet" href="../../../_static/sphinxdoc.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../../',
VERSION: '1.0',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../_static/doctools.js"></script>
<link rel="top" title="Sprout 1.0 documentation" href="../../../index.html" />
<link rel="up" title="char_traits" href="index.html" />
<link rel="next" title="compare" href="compare.html" />
<link rel="prev" title="assign" href="assign.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="compare.html" title="compare"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="assign.html" title="assign"
accesskey="P">previous</a> |</li>
<li><a href="../../../index.html">Sprout 1.0 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Libraries</a> &raquo;</li>
<li><a href="../index.html" >Sprout.String</a> &raquo;</li>
<li><a href="index.html" accesskey="U">char_traits</a> &raquo;</li>
</ul>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="../../../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">lt</a><ul>
<li><a class="reference internal" href="#interface">Interface</a></li>
<li><a class="reference internal" href="#effects">Effects</a></li>
<li><a class="reference internal" href="#examples">Examples</a></li>
<li><a class="reference internal" href="#complexity">Complexity</a></li>
<li><a class="reference internal" href="#header">Header</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="assign.html"
title="previous chapter">assign</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="compare.html"
title="next chapter">compare</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../../_sources/libs/string/char_traits/lt.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../../../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="lt">
<h1>lt<a class="headerlink" href="#lt" title="Permalink to this headline"></a></h1>
<div class="section" id="interface">
<h2>Interface<a class="headerlink" href="#interface" title="Permalink to this headline"></a></h2>
<div class="highlight-c++"><div class="highlight"><pre><span class="k">static</span> <span class="n">SPROUT_CONSTEXPR</span> <span class="kt">bool</span> <span class="n">lt</span><span class="p">(</span><span class="n">char_type</span> <span class="n">c1</span><span class="p">,</span> <span class="n">char_type</span> <span class="n">c2</span><span class="p">)</span> <span class="n">SPROUT_NOEXCEPT</span><span class="p">;</span>
</pre></div>
</div>
</div>
<div class="section" id="effects">
<h2>Effects<a class="headerlink" href="#effects" title="Permalink to this headline"></a></h2>
<div class="line-block">
<div class="line">Equivalent to <tt class="docutils literal"><span class="pre">std::char_traits&lt;Char&gt;::lt(c1,</span> <span class="pre">c2)</span></tt>.</div>
</div>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline"></a></h2>
<div class="highlight-c++"><div class="highlight"><pre><span class="cp">#include &lt;sprout/string.hpp&gt;</span>
<span class="k">using</span> <span class="k">namespace</span> <span class="n">sprout</span><span class="p">;</span>
<span class="n">SPROUT_STATIC_CONSTEXPR</span> <span class="kt">char</span> <span class="n">x</span> <span class="o">=</span> <span class="sc">&#39;H&#39;</span><span class="p">;</span>
<span class="n">SPROUT_STATIC_CONSTEXPR</span> <span class="kt">char</span> <span class="n">y</span> <span class="o">=</span> <span class="sc">&#39;M&#39;</span><span class="p">;</span>
<span class="n">SPROUT_STATIC_CONSTEXPR</span> <span class="k">auto</span> <span class="n">result</span> <span class="o">=</span> <span class="n">char_traits</span><span class="o">&lt;</span><span class="kt">char</span><span class="o">&gt;::</span><span class="n">lt</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">);</span>
<span class="n">static_assert</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="s">&quot;x is less than y.&quot;</span><span class="p">);</span>
</pre></div>
</div>
</div>
<div class="section" id="complexity">
<h2>Complexity<a class="headerlink" href="#complexity" title="Permalink to this headline"></a></h2>
<div class="line-block">
<div class="line">constant.</div>
<div class="line">Recursive function invocations in <em>O(1)</em> (constant) depth.</div>
</div>
</div>
<div class="section" id="header">
<h2>Header<a class="headerlink" href="#header" title="Permalink to this headline"></a></h2>
<div class="line-block">
<div class="line"><tt class="docutils literal"><span class="pre">sprout/string/char_traits.hpp</span></tt></div>
<div class="line">Convenience header: <tt class="docutils literal"><span class="pre">sprout/string.hpp</span></tt></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="compare.html" title="compare"
>next</a> |</li>
<li class="right" >
<a href="assign.html" title="assign"
>previous</a> |</li>
<li><a href="../../../index.html">Sprout 1.0 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Libraries</a> &raquo;</li>
<li><a href="../index.html" >Sprout.String</a> &raquo;</li>
<li><a href="index.html" >char_traits</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2013, Bolero MURAKAMI.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
</div>
</body>
</html>

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,40 @@
.. _sprout-string-char_traits-assign:
###############################################################################
assign
###############################################################################
Interface
========================================
.. sourcecode:: c++
static void assign(char_type& c1, char_type const& c2);
Effects
========================================
| Equivalent to ``std::char_traits<Char>::assign(c1, c2)``.
Examples
========================================
.. sourcecode:: c++
#include <sprout/string.hpp>
#include <sprout/assert.hpp>
using namespace sprout;
char x = 'H';
SPROUT_STATIC_CONSTEXPR char y = 'M';
char_traits<char>::assign(x, y);
SPROUT_ASSERT_MSG(x == y, "y is assigned to x.");
Complexity
========================================
| constant.
Header
========================================
| ``sprout/string/char_traits.hpp``
| Convenience header: ``sprout/string.hpp``

View file

@ -0,0 +1,40 @@
.. _sprout-string-char_traits-compare:
###############################################################################
compare
###############################################################################
Interface
========================================
.. sourcecode:: c++
static SPROUT_CONSTEXPR int compare(char_type const* s1, char_type const* s2, std::size_t n);
Returns
========================================
| Equivalent to ``std::char_traits<Char>::compare(s1, s2, n)`` in constant expression.
Examples
========================================
.. sourcecode:: c++
#include <sprout/string.hpp>
using namespace sprout;
SPROUT_STATIC_CONSTEXPR char const* x = "homuhomu";
SPROUT_STATIC_CONSTEXPR char const* y = "madocchi";
SPROUT_STATIC_CONSTEXPR auto result = char_traits<char>::compare(x, y, 8);
static_assert(result < 0, "x is less than y.");
Complexity
========================================
| linear.
| Recursive function invocations in *O(logN)* (logarithmic) depth.
Header
========================================
| ``sprout/string/char_traits.hpp``
| Convenience header: ``sprout/string.hpp``

View file

@ -0,0 +1,40 @@
.. _sprout-string-char_traits-eq:
###############################################################################
eq
###############################################################################
Interface
========================================
.. sourcecode:: c++
static SPROUT_CONSTEXPR bool eq(char_type c1, char_type c2) SPROUT_NOEXCEPT;
Effects
========================================
| Equivalent to ``std::char_traits<Char>::eq(c1, c2)``.
Examples
========================================
.. sourcecode:: c++
#include <sprout/string.hpp>
using namespace sprout;
SPROUT_STATIC_CONSTEXPR char x = 'H';
SPROUT_STATIC_CONSTEXPR char y = 'H';
SPROUT_STATIC_CONSTEXPR auto result = char_traits<char>::eq(x, y);
static_assert(result, "x is equal to y.");
Complexity
========================================
| constant.
| Recursive function invocations in *O(1)* (constant) depth.
Header
========================================
| ``sprout/string/char_traits.hpp``
| Convenience header: ``sprout/string.hpp``

View file

@ -0,0 +1,40 @@
.. _sprout-string-char_traits-find:
###############################################################################
find
###############################################################################
Interface
========================================
.. sourcecode:: c++
static SPROUT_CONSTEXPR char_type const* find(char_type const* s, std::size_t n, char_type const& a);
Returns
========================================
| Equivalent to ``std::char_traits<Char>::find(s, n, a)`` in constant expression.
Examples
========================================
.. sourcecode:: c++
#include <sprout/string.hpp>
#include <sprout/iterator.hpp>
using namespace sprout;
SPROUT_STATIC_CONSTEXPR char const* x = "homuhomu";
SPROUT_STATIC_CONSTEXPR auto result = char_traits<char>::find(x, 8, 'm');
static_assert(sprout::distance(x, result) == 2, "a found position is 2.");
Complexity
========================================
| linear.
| Recursive function invocations in *O(logN)* (logarithmic) depth.
Header
========================================
| ``sprout/string/char_traits.hpp``
| Convenience header: ``sprout/string.hpp``

View file

@ -6,6 +6,13 @@ char_traits
.. toctree::
:hidden:
assign
rq
lt
compare
length
find
Interface
========================================
.. sourcecode:: c++
@ -74,7 +81,7 @@ pos_type std::char_traits<Char>::pos_type
state_type std::char_traits<Char>::state_type
======================================== =============================================================================== =======================================
Static Member functions
Static member functions
----------------------------------------
character operations
@ -95,11 +102,11 @@ string operations
function
======================================== ===============================================================================
:doc:`compare <./compare>`
:doc:`eqlength<./length>`
:doc:`length<./length>`
:doc:`find <./find>`
:doc:`move <./move>`
:doc:`copy <./copy>`
:doc:`assign <./assign>`
:doc:`assign <./assign-string>`
======================================== ===============================================================================
integer type operations

View file

@ -0,0 +1,39 @@
.. _sprout-string-char_traits-length:
###############################################################################
length
###############################################################################
Interface
========================================
.. sourcecode:: c++
static SPROUT_CONSTEXPR std::size_t length(char_type const* s);
Returns
========================================
| Equivalent to ``std::char_traits<Char>::length(s)`` in constant expression.
Examples
========================================
.. sourcecode:: c++
#include <sprout/string.hpp>
using namespace sprout;
SPROUT_STATIC_CONSTEXPR char const* x = "homuhomu";
SPROUT_STATIC_CONSTEXPR auto result = char_traits<char>::length(x);
static_assert(result == 8, "length of x is 8.");
Complexity
========================================
| linear.
| Recursive function invocations in *O(logN)* (logarithmic) depth.
Header
========================================
| ``sprout/string/char_traits.hpp``
| Convenience header: ``sprout/string.hpp``

View file

@ -0,0 +1,40 @@
.. _sprout-string-char_traits-lt:
###############################################################################
lt
###############################################################################
Interface
========================================
.. sourcecode:: c++
static SPROUT_CONSTEXPR bool lt(char_type c1, char_type c2) SPROUT_NOEXCEPT;
Effects
========================================
| Equivalent to ``std::char_traits<Char>::lt(c1, c2)``.
Examples
========================================
.. sourcecode:: c++
#include <sprout/string.hpp>
using namespace sprout;
SPROUT_STATIC_CONSTEXPR char x = 'H';
SPROUT_STATIC_CONSTEXPR char y = 'M';
SPROUT_STATIC_CONSTEXPR auto result = char_traits<char>::lt(x, y);
static_assert(result, "x is less than y.");
Complexity
========================================
| constant.
| Recursive function invocations in *O(1)* (constant) depth.
Header
========================================
| ``sprout/string/char_traits.hpp``
| Convenience header: ``sprout/string.hpp``