Commit 1b24fb4c by Jonathan Wakely Committed by Jonathan Wakely

Add tests and docs for LWG 2212 support

	* testsuite/20_util/pair/astuple/astuple.cc: Only include <utility>.
	* testsuite/23_containers/array/tuple_interface/tuple_element.cc:
	Only include <array>.
	* testsuite/23_containers/array/tuple_interface/tuple_size.cc:
	Likewise.
	* doc/xml/manual/intro.xml; Document LWG 2212 support.
	* doc/html*: Regenerate.

From-SVN: r238244
parent 17b31c05
2016-07-12 Jonathan Wakely <jwakely@redhat.com>
* testsuite/20_util/pair/astuple/astuple.cc: Only include <utility>.
* testsuite/23_containers/array/tuple_interface/tuple_element.cc:
Only include <array>.
* testsuite/23_containers/array/tuple_interface/tuple_size.cc:
Likewise.
* doc/xml/manual/intro.xml; Document LWG 2212 support.
* doc/html*: Regenerate.
* testsuite/23_containers/vector/modifiers/emplace/self_emplace.cc:
Add testcase from LWG 2164.
......
......@@ -408,6 +408,11 @@
</p></dd><dt><span class="term"><a class="link" href="../ext/lwg-defects.html#2196" target="_top">2196</a>:
<span class="emphasis"><em>Specification of <code class="code">is_*[copy/move]_[constructible/assignable]</code> unclear for non-referencable types</em></span>
</span></dt><dd><p>Use the referenceable type concept.
</p></dd><dt><span class="term"><a class="link" href="../ext/lwg-defects.html#2212" target="_top">2212</a>:
<span class="emphasis"><em><code class="code">tuple_size</code> for <code class="code">const pair</code> request <code class="code">&lt;tuple&gt;</code> header</em></span>
</span></dt><dd><p>The <code class="code">tuple_size</code> and <code class="code">tuple_element</code>
partial specializations are defined in <code class="code">&lt;utility&gt;</code> which
is included by <code class="code">&lt;array&gt;</code>.
</p></dd><dt><span class="term"><a class="link" href="../ext/lwg-defects.html#2313" target="_top">2313</a>:
<span class="emphasis"><em><code class="code">tuple_size</code> should always derive from <code class="code">integral_constant&lt;size_t, N&gt;</code></em></span>
</span></dt><dd><p>Update definitions of the partial specializations for const and volatile types.
......
......@@ -934,6 +934,14 @@ requirements of the license of GCC.
<listitem><para>Use the referenceable type concept.
</para></listitem></varlistentry>
<varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#2212">2212</link>:
<emphasis><code>tuple_size</code> for <code>const pair</code> request <code>&lt;tuple&gt;</code> header</emphasis>
</term>
<listitem><para>The <code>tuple_size</code> and <code>tuple_element</code>
partial specializations are defined in <code>&lt;utility&gt;</code> which
is included by <code>&lt;array&gt;</code>.
</para></listitem></varlistentry>
<varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#2313">2313</link>:
<emphasis><code>tuple_size</code> should always derive from <code>integral_constant&lt;size_t, N&gt;</code></emphasis>
</term>
......
......@@ -18,8 +18,10 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// NB: Don't include any other headers in this file.
// LWG 2212 requires <utility> to define tuple_size<cv T> and
// tuple_element<cv T> specializations.
#include <utility>
#include <type_traits>
typedef std::pair<int, long> test_type;
......@@ -32,6 +34,7 @@ static_assert( std::tuple_size<const volatile test_type>::value == 2,
template<std::size_t N, typename T>
using Tuple_elt = typename std::tuple_element<N, T>::type;
// This relies on the fact that <utility> includes <type_traits>:
using std::is_same;
static_assert( is_same<Tuple_elt<0, test_type>, test_type::first_type>::value,
......
......@@ -18,15 +18,18 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// NB: Don't include any other headers in this file.
// LWG 2212 requires <array> to define tuple_element<cv T> specializations.
#include <array>
#include <type_traits>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
using namespace std;
using std::array;
using std::tuple_element;
// This relies on the fact that <utility> includes <type_traits>:
using std::is_same;
const size_t len = 3;
typedef array<int, len> array_type;
......
......@@ -18,14 +18,18 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// NB: Don't include any other headers in this file.
// LWG 2212 requires <array> to define tuple_size<cv T> specializations.
#include <array>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
using namespace std;
using std::array;
using std::tuple_size;
// This relies on the fact that <utility> includes <type_traits>:
using std::is_same;
{
const size_t len = 5;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment