mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-02-19 10:34:53 +00:00
add doc: array generators
This commit is contained in:
parent
72f335f35a
commit
ed85c56acc
15 changed files with 795 additions and 41 deletions
|
@ -7,6 +7,9 @@ Sprout.Array
|
|||
:hidden:
|
||||
|
||||
array/index
|
||||
to_array
|
||||
make_array
|
||||
make_common_array
|
||||
|
||||
Description
|
||||
========================================
|
||||
|
@ -23,7 +26,7 @@ class
|
|||
Non-member functions
|
||||
----------------------------------------
|
||||
|
||||
generators
|
||||
array generators
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
============================================================ ===============================================================================
|
||||
|
@ -40,7 +43,7 @@ specialized algorithms
|
|||
======================================== ===============================================================================
|
||||
function
|
||||
======================================== ===============================================================================
|
||||
:doc:`swap <./swap>`
|
||||
:doc:`swap <./array/swap-global>`
|
||||
======================================== ===============================================================================
|
||||
|
||||
comparisons
|
||||
|
@ -49,12 +52,12 @@ comparisons
|
|||
============================================================ ===============================================================================
|
||||
function
|
||||
============================================================ ===============================================================================
|
||||
:doc:`operator== <./operator-equal_to>`
|
||||
:doc:`operator!= <./operator-not_equal_to>`
|
||||
:doc:`operator< <./operator-less>`
|
||||
:doc:`operator> <./operator-greater>`
|
||||
:doc:`operator<= <./operator-less_equal>`
|
||||
:doc:`operator>= <./operator-greater_equal>`
|
||||
:doc:`operator== <./array/operator-equal_to>`
|
||||
:doc:`operator!= <./array/operator-not_equal_to>`
|
||||
:doc:`operator< <./array/operator-less>`
|
||||
:doc:`operator> <./array/operator-greater>`
|
||||
:doc:`operator<= <./array/operator-less_equal>`
|
||||
:doc:`operator>= <./array/operator-greater_equal>`
|
||||
============================================================ ===============================================================================
|
||||
|
||||
Tuple interface
|
||||
|
@ -63,14 +66,14 @@ Tuple interface
|
|||
============================================================ ===============================================================================
|
||||
matafunction
|
||||
============================================================ ===============================================================================
|
||||
:doc:`std::tuple_size <./std-tuple_size>`
|
||||
:doc:`std::tuple_element <./std-tuple_element>`
|
||||
:doc:`std::tuple_size <./array/std-tuple_size>`
|
||||
:doc:`std::tuple_element <./array/std-tuple_element>`
|
||||
============================================================ ===============================================================================
|
||||
|
||||
============================================================ ===============================================================================
|
||||
function
|
||||
============================================================ ===============================================================================
|
||||
:doc:`tuple_get <./tuple_get>`
|
||||
:doc:`tuple_get <./array/tuple_get>`
|
||||
============================================================ ===============================================================================
|
||||
|
||||
Hash support
|
||||
|
@ -79,7 +82,7 @@ Hash support
|
|||
======================================== ===============================================================================
|
||||
function
|
||||
======================================== ===============================================================================
|
||||
:doc:`hash_value <./hash_value>`
|
||||
:doc:`hash_value <./array/hash_value>`
|
||||
======================================== ===============================================================================
|
||||
|
||||
Header
|
||||
|
|
43
docs/_sources/libs/sprout/array/make_array.txt
Normal file
43
docs/_sources/libs/sprout/array/make_array.txt
Normal file
|
@ -0,0 +1,43 @@
|
|||
.. _sprout-array-make_array:
|
||||
###############################################################################
|
||||
make_array
|
||||
###############################################################################
|
||||
|
||||
Interface
|
||||
========================================
|
||||
.. sourcecode:: c++
|
||||
|
||||
template<typename T, typename... Types>
|
||||
inline SPROUT_CONSTEXPR sprout::array<T, sizeof...(Types)>
|
||||
make_array(Types&&... args);
|
||||
|
||||
Returns
|
||||
========================================
|
||||
|
||||
| Returns an array object initialized with the argument all elements.
|
||||
|
||||
Remarks
|
||||
========================================
|
||||
|
||||
| This function needs to be specified in the template parameters explicitly type T of the elements in the array.
|
||||
|
||||
Examples
|
||||
========================================
|
||||
.. sourcecode:: c++
|
||||
|
||||
#include <sprout/array.hpp>
|
||||
|
||||
SPROUT_STATIC_CONSTEXPR auto x = sprout::make_array<int>(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
|
||||
static_assert(x.size() == 10, "array x initialized with 10 elements.");
|
||||
|
||||
Complexity
|
||||
========================================
|
||||
|
||||
| Recursive function invocations in *O(1)* (constant) depth.
|
||||
|
||||
Header
|
||||
========================================
|
||||
|
||||
| ``sprout/array/make_array.hpp``
|
||||
| Convenience header: ``sprout/array.hpp``
|
||||
|
43
docs/_sources/libs/sprout/array/make_common_array.txt
Normal file
43
docs/_sources/libs/sprout/array/make_common_array.txt
Normal file
|
@ -0,0 +1,43 @@
|
|||
.. _sprout-array-make_common_array:
|
||||
###############################################################################
|
||||
make_common_array
|
||||
###############################################################################
|
||||
|
||||
Interface
|
||||
========================================
|
||||
.. sourcecode:: c++
|
||||
|
||||
template<typename... Types>
|
||||
inline SPROUT_CONSTEXPR sprout::array<typename sprout::common_decay<Types&&...>::type, sizeof...(Types)>
|
||||
make_common_array(Types&&... args);
|
||||
|
||||
Returns
|
||||
========================================
|
||||
|
||||
| Returns an array object initialized with the argument all elements.
|
||||
|
||||
Remarks
|
||||
========================================
|
||||
|
||||
| Type of the elements in the array is a decayed common type of all arguments.
|
||||
|
||||
Examples
|
||||
========================================
|
||||
.. sourcecode:: c++
|
||||
|
||||
#include <sprout/array.hpp>
|
||||
|
||||
SPROUT_STATIC_CONSTEXPR auto x = sprout::make_common_array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
|
||||
static_assert(x.size() == 10, "array x initialized with 10 elements.");
|
||||
|
||||
Complexity
|
||||
========================================
|
||||
|
||||
| Recursive function invocations in *O(1)* (constant) depth.
|
||||
|
||||
Header
|
||||
========================================
|
||||
|
||||
| ``sprout/array/make_array.hpp``
|
||||
| Convenience header: ``sprout/array.hpp``
|
||||
|
39
docs/_sources/libs/sprout/array/to_array.txt
Normal file
39
docs/_sources/libs/sprout/array/to_array.txt
Normal file
|
@ -0,0 +1,39 @@
|
|||
.. _sprout-array-to_array:
|
||||
###############################################################################
|
||||
to_array
|
||||
###############################################################################
|
||||
|
||||
Interface
|
||||
========================================
|
||||
.. sourcecode:: c++
|
||||
|
||||
template<typename T, std::size_t N>
|
||||
inline SPROUT_CONSTEXPR sprout::array<T, N>
|
||||
to_array(T const (& arr)[N]);
|
||||
|
||||
Returns
|
||||
========================================
|
||||
|
||||
| Returns the array object copied all elements from the built-in array.
|
||||
|
||||
Examples
|
||||
========================================
|
||||
.. sourcecode:: c++
|
||||
|
||||
#include <sprout/array.hpp>
|
||||
|
||||
SPROUT_STATIC_CONSTEXPR int x[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
|
||||
SPROUT_STATIC_CONSTEXPR auto y = sprout::to_array(x);
|
||||
static_assert(y[0] == x[0], "array y is same as built-in array x.");
|
||||
|
||||
Complexity
|
||||
========================================
|
||||
|
||||
| Recursive function invocations in *O(1)* (constant) depth.
|
||||
|
||||
Header
|
||||
========================================
|
||||
|
||||
| ``sprout/array/array.hpp``
|
||||
| Convenience header: ``sprout/array.hpp``
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
<link rel="top" title="Sprout v1.0 documentation" href="../../../index.html" />
|
||||
<link rel="up" title="Libraries" href="../../libraries.html" />
|
||||
<link rel="next" title="all_of" href="all_of.html" />
|
||||
<link rel="prev" title="back" href="../array/array/c_array.html" />
|
||||
<link rel="prev" title="make_common_array" href="../array/make_common_array.html" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="related">
|
||||
|
@ -35,7 +35,7 @@
|
|||
<a href="all_of.html" title="all_of"
|
||||
accesskey="N">next</a> |</li>
|
||||
<li class="right" >
|
||||
<a href="../array/array/c_array.html" title="back"
|
||||
<a href="../array/make_common_array.html" title="make_common_array"
|
||||
accesskey="P">previous</a> |</li>
|
||||
<li><a href="../../../index.html">Sprout v1.0 documentation</a> »</li>
|
||||
<li><a href="../../index.html" >Sprout C++ Libraries</a> »</li>
|
||||
|
@ -62,8 +62,8 @@
|
|||
</ul>
|
||||
|
||||
<h4>Previous topic</h4>
|
||||
<p class="topless"><a href="../array/array/c_array.html"
|
||||
title="previous chapter">back</a></p>
|
||||
<p class="topless"><a href="../array/make_common_array.html"
|
||||
title="previous chapter">make_common_array</a></p>
|
||||
<h4>Next topic</h4>
|
||||
<p class="topless"><a href="all_of.html"
|
||||
title="next chapter">all_of</a></p>
|
||||
|
@ -355,7 +355,7 @@
|
|||
<a href="all_of.html" title="all_of"
|
||||
>next</a> |</li>
|
||||
<li class="right" >
|
||||
<a href="../array/array/c_array.html" title="back"
|
||||
<a href="../array/make_common_array.html" title="make_common_array"
|
||||
>previous</a> |</li>
|
||||
<li><a href="../../../index.html">Sprout v1.0 documentation</a> »</li>
|
||||
<li><a href="../../index.html" >Sprout C++ Libraries</a> »</li>
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
<script type="text/javascript" src="../../../../_static/doctools.js"></script>
|
||||
<link rel="top" title="Sprout v1.0 documentation" href="../../../../index.html" />
|
||||
<link rel="up" title="array" href="index.html" />
|
||||
<link rel="next" title="Sprout.Algorithm" href="../../algorithm/index.html" />
|
||||
<link rel="next" title="to_array" href="../to_array.html" />
|
||||
<link rel="prev" title="back" href="data.html" />
|
||||
</head>
|
||||
<body>
|
||||
|
@ -32,7 +32,7 @@
|
|||
<a href="../../../../genindex.html" title="General Index"
|
||||
accesskey="I">index</a></li>
|
||||
<li class="right" >
|
||||
<a href="../../algorithm/index.html" title="Sprout.Algorithm"
|
||||
<a href="../to_array.html" title="to_array"
|
||||
accesskey="N">next</a> |</li>
|
||||
<li class="right" >
|
||||
<a href="data.html" title="back"
|
||||
|
@ -62,8 +62,8 @@
|
|||
<p class="topless"><a href="data.html"
|
||||
title="previous chapter">back</a></p>
|
||||
<h4>Next topic</h4>
|
||||
<p class="topless"><a href="../../algorithm/index.html"
|
||||
title="next chapter">Sprout.Algorithm</a></p>
|
||||
<p class="topless"><a href="../to_array.html"
|
||||
title="next chapter">to_array</a></p>
|
||||
<h3>This Page</h3>
|
||||
<ul class="this-page-menu">
|
||||
<li><a href="../../../../_sources/libs/sprout/array/array/c_array.txt"
|
||||
|
@ -144,7 +144,7 @@
|
|||
<a href="../../../../genindex.html" title="General Index"
|
||||
>index</a></li>
|
||||
<li class="right" >
|
||||
<a href="../../algorithm/index.html" title="Sprout.Algorithm"
|
||||
<a href="../to_array.html" title="to_array"
|
||||
>next</a> |</li>
|
||||
<li class="right" >
|
||||
<a href="data.html" title="back"
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
<li><a class="reference external" href="#description">Description</a><ul>
|
||||
<li><a class="reference external" href="#classes">Classes</a></li>
|
||||
<li><a class="reference external" href="#non-member-functions">Non-member functions</a><ul>
|
||||
<li><a class="reference external" href="#generators">generators</a></li>
|
||||
<li><a class="reference external" href="#array-generators">array generators</a></li>
|
||||
<li><a class="reference external" href="#specialized-algorithms">specialized algorithms</a></li>
|
||||
<li><a class="reference external" href="#comparisons">comparisons</a></li>
|
||||
</ul>
|
||||
|
@ -121,8 +121,8 @@
|
|||
</div>
|
||||
<div class="section" id="non-member-functions">
|
||||
<h3>Non-member functions<a class="headerlink" href="#non-member-functions" title="Permalink to this headline">¶</a></h3>
|
||||
<div class="section" id="generators">
|
||||
<h4>generators<a class="headerlink" href="#generators" title="Permalink to this headline">¶</a></h4>
|
||||
<div class="section" id="array-generators">
|
||||
<h4>array generators<a class="headerlink" href="#array-generators" title="Permalink to this headline">¶</a></h4>
|
||||
<table border="1" class="docutils">
|
||||
<colgroup>
|
||||
<col width="43%" />
|
||||
|
@ -134,13 +134,13 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody valign="top">
|
||||
<tr><td><tt class="xref docutils literal"><span class="pre">to_array</span></tt></td>
|
||||
<tr><td><a class="reference external" href="to_array.html"><em>to_array</em></a></td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr><td><tt class="xref docutils literal"><span class="pre">make_array</span></tt></td>
|
||||
<tr><td><a class="reference external" href="make_array.html"><em>make_array</em></a></td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr><td><tt class="xref docutils literal"><span class="pre">make_common_array</span></tt></td>
|
||||
<tr><td><a class="reference external" href="make_common_array.html"><em>make_common_array</em></a></td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
|
168
docs/libs/sprout/array/make_array.html
Normal file
168
docs/libs/sprout/array/make_array.html
Normal file
|
@ -0,0 +1,168 @@
|
|||
<!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" />
|
||||
|
||||
<title>make_array — Sprout v1.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_MODINDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
<link rel="top" title="Sprout v1.0 documentation" href="../../../index.html" />
|
||||
<link rel="up" title="Sprout.Array" href="index.html" />
|
||||
<link rel="next" title="make_common_array" href="make_common_array.html" />
|
||||
<link rel="prev" title="to_array" href="to_array.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="make_common_array.html" title="make_common_array"
|
||||
accesskey="N">next</a> |</li>
|
||||
<li class="right" >
|
||||
<a href="to_array.html" title="to_array"
|
||||
accesskey="P">previous</a> |</li>
|
||||
<li><a href="../../../index.html">Sprout v1.0 documentation</a> »</li>
|
||||
<li><a href="../../index.html" >Sprout C++ Libraries</a> »</li>
|
||||
<li><a href="../../libraries.html" >Libraries</a> »</li>
|
||||
<li><a href="index.html" accesskey="U">Sprout.Array</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="sphinxsidebar">
|
||||
<div class="sphinxsidebarwrapper">
|
||||
<h3><a href="../../../index.html">Table Of Contents</a></h3>
|
||||
<ul>
|
||||
<li><a class="reference external" href="#">make_array</a><ul>
|
||||
<li><a class="reference external" href="#interface">Interface</a></li>
|
||||
<li><a class="reference external" href="#returns">Returns</a></li>
|
||||
<li><a class="reference external" href="#remarks">Remarks</a></li>
|
||||
<li><a class="reference external" href="#examples">Examples</a></li>
|
||||
<li><a class="reference external" href="#complexity">Complexity</a></li>
|
||||
<li><a class="reference external" href="#header">Header</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h4>Previous topic</h4>
|
||||
<p class="topless"><a href="to_array.html"
|
||||
title="previous chapter">to_array</a></p>
|
||||
<h4>Next topic</h4>
|
||||
<p class="topless"><a href="make_common_array.html"
|
||||
title="next chapter">make_common_array</a></p>
|
||||
<h3>This Page</h3>
|
||||
<ul class="this-page-menu">
|
||||
<li><a href="../../../_sources/libs/sprout/array/make_array.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" size="18" />
|
||||
<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="make-array">
|
||||
<h1>make_array<a class="headerlink" href="#make-array" 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">template</span><span class="o"><</span><span class="k">typename</span> <span class="n">T</span><span class="p">,</span> <span class="k">typename</span><span class="p">...</span> <span class="n">Types</span><span class="o">></span>
|
||||
<span class="kr">inline</span> <span class="n">SPROUT_CONSTEXPR</span> <span class="n">sprout</span><span class="o">::</span><span class="n">array</span><span class="o"><</span><span class="n">T</span><span class="p">,</span> <span class="k">sizeof</span><span class="p">...(</span><span class="n">Types</span><span class="p">)</span><span class="o">></span>
|
||||
<span class="n">make_array</span><span class="p">(</span><span class="n">Types</span><span class="o">&&</span><span class="p">...</span> <span class="n">args</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">Returns an array object initialized with the argument all elements.</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="remarks">
|
||||
<h2>Remarks<a class="headerlink" href="#remarks" title="Permalink to this headline">¶</a></h2>
|
||||
<div class="line-block">
|
||||
<div class="line">This function needs to be specified in the template parameters explicitly type T of the elements in the array.</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 <sprout/array.hpp></span>
|
||||
|
||||
<span class="n">SPROUT_STATIC_CONSTEXPR</span> <span class="k">auto</span> <span class="n">x</span> <span class="o">=</span> <span class="n">sprout</span><span class="o">::</span><span class="n">make_array</span><span class="o"><</span><span class="kt">int</span><span class="o">></span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">6</span><span class="p">,</span> <span class="mi">7</span><span class="p">,</span> <span class="mi">8</span><span class="p">,</span> <span class="mi">9</span><span class="p">,</span> <span class="mi">10</span><span class="p">);</span>
|
||||
<span class="n">static_assert</span><span class="p">(</span><span class="n">x</span><span class="p">.</span><span class="n">size</span><span class="p">()</span> <span class="o">==</span> <span class="mi">10</span><span class="p">,</span> <span class="s">"array x initialized with 10 elements."</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">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/array/make_array.hpp</span></tt></div>
|
||||
<div class="line">Convenience header: <tt class="docutils literal"><span class="pre">sprout/array.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="make_common_array.html" title="make_common_array"
|
||||
>next</a> |</li>
|
||||
<li class="right" >
|
||||
<a href="to_array.html" title="to_array"
|
||||
>previous</a> |</li>
|
||||
<li><a href="../../../index.html">Sprout v1.0 documentation</a> »</li>
|
||||
<li><a href="../../index.html" >Sprout C++ Libraries</a> »</li>
|
||||
<li><a href="../../libraries.html" >Libraries</a> »</li>
|
||||
<li><a href="index.html" >Sprout.Array</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="footer">
|
||||
© Copyright 2013, Bolero MURAKAMI.
|
||||
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.4.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
168
docs/libs/sprout/array/make_common_array.html
Normal file
168
docs/libs/sprout/array/make_common_array.html
Normal file
|
@ -0,0 +1,168 @@
|
|||
<!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" />
|
||||
|
||||
<title>make_common_array — Sprout v1.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_MODINDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
<link rel="top" title="Sprout v1.0 documentation" href="../../../index.html" />
|
||||
<link rel="up" title="Sprout.Array" href="index.html" />
|
||||
<link rel="next" title="Sprout.Algorithm" href="../algorithm/index.html" />
|
||||
<link rel="prev" title="make_array" href="make_array.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="../algorithm/index.html" title="Sprout.Algorithm"
|
||||
accesskey="N">next</a> |</li>
|
||||
<li class="right" >
|
||||
<a href="make_array.html" title="make_array"
|
||||
accesskey="P">previous</a> |</li>
|
||||
<li><a href="../../../index.html">Sprout v1.0 documentation</a> »</li>
|
||||
<li><a href="../../index.html" >Sprout C++ Libraries</a> »</li>
|
||||
<li><a href="../../libraries.html" >Libraries</a> »</li>
|
||||
<li><a href="index.html" accesskey="U">Sprout.Array</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="sphinxsidebar">
|
||||
<div class="sphinxsidebarwrapper">
|
||||
<h3><a href="../../../index.html">Table Of Contents</a></h3>
|
||||
<ul>
|
||||
<li><a class="reference external" href="#">make_common_array</a><ul>
|
||||
<li><a class="reference external" href="#interface">Interface</a></li>
|
||||
<li><a class="reference external" href="#returns">Returns</a></li>
|
||||
<li><a class="reference external" href="#remarks">Remarks</a></li>
|
||||
<li><a class="reference external" href="#examples">Examples</a></li>
|
||||
<li><a class="reference external" href="#complexity">Complexity</a></li>
|
||||
<li><a class="reference external" href="#header">Header</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h4>Previous topic</h4>
|
||||
<p class="topless"><a href="make_array.html"
|
||||
title="previous chapter">make_array</a></p>
|
||||
<h4>Next topic</h4>
|
||||
<p class="topless"><a href="../algorithm/index.html"
|
||||
title="next chapter">Sprout.Algorithm</a></p>
|
||||
<h3>This Page</h3>
|
||||
<ul class="this-page-menu">
|
||||
<li><a href="../../../_sources/libs/sprout/array/make_common_array.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" size="18" />
|
||||
<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="make-common-array">
|
||||
<h1>make_common_array<a class="headerlink" href="#make-common-array" 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">template</span><span class="o"><</span><span class="k">typename</span><span class="p">...</span> <span class="n">Types</span><span class="o">></span>
|
||||
<span class="kr">inline</span> <span class="n">SPROUT_CONSTEXPR</span> <span class="n">sprout</span><span class="o">::</span><span class="n">array</span><span class="o"><</span><span class="k">typename</span> <span class="n">sprout</span><span class="o">::</span><span class="n">common_decay</span><span class="o"><</span><span class="n">Types</span><span class="o">&&</span><span class="p">...</span><span class="o">>::</span><span class="n">type</span><span class="p">,</span> <span class="k">sizeof</span><span class="p">...(</span><span class="n">Types</span><span class="p">)</span><span class="o">></span>
|
||||
<span class="n">make_common_array</span><span class="p">(</span><span class="n">Types</span><span class="o">&&</span><span class="p">...</span> <span class="n">args</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">Returns an array object initialized with the argument all elements.</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="remarks">
|
||||
<h2>Remarks<a class="headerlink" href="#remarks" title="Permalink to this headline">¶</a></h2>
|
||||
<div class="line-block">
|
||||
<div class="line">Type of the elements in the array is a decayed common type of all arguments.</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 <sprout/array.hpp></span>
|
||||
|
||||
<span class="n">SPROUT_STATIC_CONSTEXPR</span> <span class="k">auto</span> <span class="n">x</span> <span class="o">=</span> <span class="n">sprout</span><span class="o">::</span><span class="n">make_common_array</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">6</span><span class="p">,</span> <span class="mi">7</span><span class="p">,</span> <span class="mi">8</span><span class="p">,</span> <span class="mi">9</span><span class="p">,</span> <span class="mi">10</span><span class="p">);</span>
|
||||
<span class="n">static_assert</span><span class="p">(</span><span class="n">x</span><span class="p">.</span><span class="n">size</span><span class="p">()</span> <span class="o">==</span> <span class="mi">10</span><span class="p">,</span> <span class="s">"array x initialized with 10 elements."</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">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/array/make_array.hpp</span></tt></div>
|
||||
<div class="line">Convenience header: <tt class="docutils literal"><span class="pre">sprout/array.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="../algorithm/index.html" title="Sprout.Algorithm"
|
||||
>next</a> |</li>
|
||||
<li class="right" >
|
||||
<a href="make_array.html" title="make_array"
|
||||
>previous</a> |</li>
|
||||
<li><a href="../../../index.html">Sprout v1.0 documentation</a> »</li>
|
||||
<li><a href="../../index.html" >Sprout C++ Libraries</a> »</li>
|
||||
<li><a href="../../libraries.html" >Libraries</a> »</li>
|
||||
<li><a href="index.html" >Sprout.Array</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="footer">
|
||||
© Copyright 2013, Bolero MURAKAMI.
|
||||
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.4.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
162
docs/libs/sprout/array/to_array.html
Normal file
162
docs/libs/sprout/array/to_array.html
Normal file
|
@ -0,0 +1,162 @@
|
|||
<!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" />
|
||||
|
||||
<title>to_array — Sprout v1.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_MODINDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="../../../_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../_static/doctools.js"></script>
|
||||
<link rel="top" title="Sprout v1.0 documentation" href="../../../index.html" />
|
||||
<link rel="up" title="Sprout.Array" href="index.html" />
|
||||
<link rel="next" title="make_array" href="make_array.html" />
|
||||
<link rel="prev" title="back" href="array/c_array.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="make_array.html" title="make_array"
|
||||
accesskey="N">next</a> |</li>
|
||||
<li class="right" >
|
||||
<a href="array/c_array.html" title="back"
|
||||
accesskey="P">previous</a> |</li>
|
||||
<li><a href="../../../index.html">Sprout v1.0 documentation</a> »</li>
|
||||
<li><a href="../../index.html" >Sprout C++ Libraries</a> »</li>
|
||||
<li><a href="../../libraries.html" >Libraries</a> »</li>
|
||||
<li><a href="index.html" accesskey="U">Sprout.Array</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="sphinxsidebar">
|
||||
<div class="sphinxsidebarwrapper">
|
||||
<h3><a href="../../../index.html">Table Of Contents</a></h3>
|
||||
<ul>
|
||||
<li><a class="reference external" href="#">to_array</a><ul>
|
||||
<li><a class="reference external" href="#interface">Interface</a></li>
|
||||
<li><a class="reference external" href="#returns">Returns</a></li>
|
||||
<li><a class="reference external" href="#examples">Examples</a></li>
|
||||
<li><a class="reference external" href="#complexity">Complexity</a></li>
|
||||
<li><a class="reference external" href="#header">Header</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h4>Previous topic</h4>
|
||||
<p class="topless"><a href="array/c_array.html"
|
||||
title="previous chapter">back</a></p>
|
||||
<h4>Next topic</h4>
|
||||
<p class="topless"><a href="make_array.html"
|
||||
title="next chapter">make_array</a></p>
|
||||
<h3>This Page</h3>
|
||||
<ul class="this-page-menu">
|
||||
<li><a href="../../../_sources/libs/sprout/array/to_array.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" size="18" />
|
||||
<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="to-array">
|
||||
<h1>to_array<a class="headerlink" href="#to-array" 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">template</span><span class="o"><</span><span class="k">typename</span> <span class="n">T</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="o">></span>
|
||||
<span class="kr">inline</span> <span class="n">SPROUT_CONSTEXPR</span> <span class="n">sprout</span><span class="o">::</span><span class="n">array</span><span class="o"><</span><span class="n">T</span><span class="p">,</span> <span class="n">N</span><span class="o">></span>
|
||||
<span class="n">to_array</span><span class="p">(</span><span class="n">T</span> <span class="k">const</span> <span class="p">(</span><span class="o">&</span> <span class="n">arr</span><span class="p">)[</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">Returns the array object copied all elements from the built-in array.</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 <sprout/array.hpp></span>
|
||||
|
||||
<span class="n">SPROUT_STATIC_CONSTEXPR</span> <span class="kt">int</span> <span class="n">x</span><span class="p">[</span><span class="mi">10</span><span class="p">]</span> <span class="o">=</span> <span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">6</span><span class="p">,</span> <span class="mi">7</span><span class="p">,</span> <span class="mi">8</span><span class="p">,</span> <span class="mi">9</span><span class="p">,</span> <span class="mi">10</span><span class="p">};</span>
|
||||
<span class="n">SPROUT_STATIC_CONSTEXPR</span> <span class="k">auto</span> <span class="n">y</span> <span class="o">=</span> <span class="n">sprout</span><span class="o">::</span><span class="n">to_array</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">y</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">==</span> <span class="n">x</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="s">"array y is same as built-in array x."</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">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/array/array.hpp</span></tt></div>
|
||||
<div class="line">Convenience header: <tt class="docutils literal"><span class="pre">sprout/array.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="make_array.html" title="make_array"
|
||||
>next</a> |</li>
|
||||
<li class="right" >
|
||||
<a href="array/c_array.html" title="back"
|
||||
>previous</a> |</li>
|
||||
<li><a href="../../../index.html">Sprout v1.0 documentation</a> »</li>
|
||||
<li><a href="../../index.html" >Sprout C++ Libraries</a> »</li>
|
||||
<li><a href="../../libraries.html" >Libraries</a> »</li>
|
||||
<li><a href="index.html" >Sprout.Array</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="footer">
|
||||
© Copyright 2013, Bolero MURAKAMI.
|
||||
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.4.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
File diff suppressed because one or more lines are too long
|
@ -7,6 +7,9 @@ Sprout.Array
|
|||
:hidden:
|
||||
|
||||
array/index
|
||||
to_array
|
||||
make_array
|
||||
make_common_array
|
||||
|
||||
Description
|
||||
========================================
|
||||
|
@ -23,7 +26,7 @@ class
|
|||
Non-member functions
|
||||
----------------------------------------
|
||||
|
||||
generators
|
||||
array generators
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
============================================================ ===============================================================================
|
||||
|
@ -40,7 +43,7 @@ specialized algorithms
|
|||
======================================== ===============================================================================
|
||||
function
|
||||
======================================== ===============================================================================
|
||||
:doc:`swap <./swap>`
|
||||
:doc:`swap <./array/swap-global>`
|
||||
======================================== ===============================================================================
|
||||
|
||||
comparisons
|
||||
|
@ -49,12 +52,12 @@ comparisons
|
|||
============================================================ ===============================================================================
|
||||
function
|
||||
============================================================ ===============================================================================
|
||||
:doc:`operator== <./operator-equal_to>`
|
||||
:doc:`operator!= <./operator-not_equal_to>`
|
||||
:doc:`operator< <./operator-less>`
|
||||
:doc:`operator> <./operator-greater>`
|
||||
:doc:`operator<= <./operator-less_equal>`
|
||||
:doc:`operator>= <./operator-greater_equal>`
|
||||
:doc:`operator== <./array/operator-equal_to>`
|
||||
:doc:`operator!= <./array/operator-not_equal_to>`
|
||||
:doc:`operator< <./array/operator-less>`
|
||||
:doc:`operator> <./array/operator-greater>`
|
||||
:doc:`operator<= <./array/operator-less_equal>`
|
||||
:doc:`operator>= <./array/operator-greater_equal>`
|
||||
============================================================ ===============================================================================
|
||||
|
||||
Tuple interface
|
||||
|
@ -63,14 +66,14 @@ Tuple interface
|
|||
============================================================ ===============================================================================
|
||||
matafunction
|
||||
============================================================ ===============================================================================
|
||||
:doc:`std::tuple_size <./std-tuple_size>`
|
||||
:doc:`std::tuple_element <./std-tuple_element>`
|
||||
:doc:`std::tuple_size <./array/std-tuple_size>`
|
||||
:doc:`std::tuple_element <./array/std-tuple_element>`
|
||||
============================================================ ===============================================================================
|
||||
|
||||
============================================================ ===============================================================================
|
||||
function
|
||||
============================================================ ===============================================================================
|
||||
:doc:`tuple_get <./tuple_get>`
|
||||
:doc:`tuple_get <./array/tuple_get>`
|
||||
============================================================ ===============================================================================
|
||||
|
||||
Hash support
|
||||
|
@ -79,7 +82,7 @@ Hash support
|
|||
======================================== ===============================================================================
|
||||
function
|
||||
======================================== ===============================================================================
|
||||
:doc:`hash_value <./hash_value>`
|
||||
:doc:`hash_value <./array/hash_value>`
|
||||
======================================== ===============================================================================
|
||||
|
||||
Header
|
||||
|
|
43
source/libs/sprout/array/make_array.rst
Normal file
43
source/libs/sprout/array/make_array.rst
Normal file
|
@ -0,0 +1,43 @@
|
|||
.. _sprout-array-make_array:
|
||||
###############################################################################
|
||||
make_array
|
||||
###############################################################################
|
||||
|
||||
Interface
|
||||
========================================
|
||||
.. sourcecode:: c++
|
||||
|
||||
template<typename T, typename... Types>
|
||||
inline SPROUT_CONSTEXPR sprout::array<T, sizeof...(Types)>
|
||||
make_array(Types&&... args);
|
||||
|
||||
Returns
|
||||
========================================
|
||||
|
||||
| Returns an array object initialized with the argument all elements.
|
||||
|
||||
Remarks
|
||||
========================================
|
||||
|
||||
| This function needs to be specified in the template parameters explicitly type T of the elements in the array.
|
||||
|
||||
Examples
|
||||
========================================
|
||||
.. sourcecode:: c++
|
||||
|
||||
#include <sprout/array.hpp>
|
||||
|
||||
SPROUT_STATIC_CONSTEXPR auto x = sprout::make_array<int>(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
|
||||
static_assert(x.size() == 10, "array x initialized with 10 elements.");
|
||||
|
||||
Complexity
|
||||
========================================
|
||||
|
||||
| Recursive function invocations in *O(1)* (constant) depth.
|
||||
|
||||
Header
|
||||
========================================
|
||||
|
||||
| ``sprout/array/make_array.hpp``
|
||||
| Convenience header: ``sprout/array.hpp``
|
||||
|
43
source/libs/sprout/array/make_common_array.rst
Normal file
43
source/libs/sprout/array/make_common_array.rst
Normal file
|
@ -0,0 +1,43 @@
|
|||
.. _sprout-array-make_common_array:
|
||||
###############################################################################
|
||||
make_common_array
|
||||
###############################################################################
|
||||
|
||||
Interface
|
||||
========================================
|
||||
.. sourcecode:: c++
|
||||
|
||||
template<typename... Types>
|
||||
inline SPROUT_CONSTEXPR sprout::array<typename sprout::common_decay<Types&&...>::type, sizeof...(Types)>
|
||||
make_common_array(Types&&... args);
|
||||
|
||||
Returns
|
||||
========================================
|
||||
|
||||
| Returns an array object initialized with the argument all elements.
|
||||
|
||||
Remarks
|
||||
========================================
|
||||
|
||||
| Type of the elements in the array is a decayed common type of all arguments.
|
||||
|
||||
Examples
|
||||
========================================
|
||||
.. sourcecode:: c++
|
||||
|
||||
#include <sprout/array.hpp>
|
||||
|
||||
SPROUT_STATIC_CONSTEXPR auto x = sprout::make_common_array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
|
||||
static_assert(x.size() == 10, "array x initialized with 10 elements.");
|
||||
|
||||
Complexity
|
||||
========================================
|
||||
|
||||
| Recursive function invocations in *O(1)* (constant) depth.
|
||||
|
||||
Header
|
||||
========================================
|
||||
|
||||
| ``sprout/array/make_array.hpp``
|
||||
| Convenience header: ``sprout/array.hpp``
|
||||
|
39
source/libs/sprout/array/to_array.rst
Normal file
39
source/libs/sprout/array/to_array.rst
Normal file
|
@ -0,0 +1,39 @@
|
|||
.. _sprout-array-to_array:
|
||||
###############################################################################
|
||||
to_array
|
||||
###############################################################################
|
||||
|
||||
Interface
|
||||
========================================
|
||||
.. sourcecode:: c++
|
||||
|
||||
template<typename T, std::size_t N>
|
||||
inline SPROUT_CONSTEXPR sprout::array<T, N>
|
||||
to_array(T const (& arr)[N]);
|
||||
|
||||
Returns
|
||||
========================================
|
||||
|
||||
| Returns the array object copied all elements from the built-in array.
|
||||
|
||||
Examples
|
||||
========================================
|
||||
.. sourcecode:: c++
|
||||
|
||||
#include <sprout/array.hpp>
|
||||
|
||||
SPROUT_STATIC_CONSTEXPR int x[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
|
||||
SPROUT_STATIC_CONSTEXPR auto y = sprout::to_array(x);
|
||||
static_assert(y[0] == x[0], "array y is same as built-in array x.");
|
||||
|
||||
Complexity
|
||||
========================================
|
||||
|
||||
| Recursive function invocations in *O(1)* (constant) depth.
|
||||
|
||||
Header
|
||||
========================================
|
||||
|
||||
| ``sprout/array/array.hpp``
|
||||
| Convenience header: ``sprout/array.hpp``
|
||||
|
Loading…
Add table
Reference in a new issue