mirror of
https://github.com/boostorg/tuple.git
synced 2025-07-29 12:17:32 +02:00
Documented a new constructor for cons lists
[SVN r10926]
This commit is contained in:
@ -75,6 +75,19 @@ inline void set_to_zero(cons<H, T>& x) { x.get_head() = 0; set_to_zero
|
|||||||
</code></pre>
|
</code></pre>
|
||||||
<p>
|
<p>
|
||||||
|
|
||||||
|
<h4>Constructing cons lists</h4>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
A cons list can be constructed from its head and tail. The prototype of the constructor is:
|
||||||
|
<pre><code>cons(typename tuple_access_traits<head_type>::parameter_type h,
|
||||||
|
const tail_type& t)
|
||||||
|
</code></pre>
|
||||||
|
The traits template for the head parameter selects correct parameter types for different kinds of element types (for reference elements the parameter type equals the element type, for non-reference types the parameter type is a reference to const non-volatile element type).
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
For a one-element cons list the tail argument (<code>null_type</code>) can be omitted.
|
||||||
|
</p>
|
||||||
|
|
||||||
<h2>Traits classes for tuple element types</h2>
|
<h2>Traits classes for tuple element types</h2>
|
||||||
|
|
||||||
<h4><code>tuple_access_traits</code></h4>
|
<h4><code>tuple_access_traits</code></h4>
|
||||||
|
Reference in New Issue
Block a user