public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ville Voutilainen <ville.voutilainen@gmail.com>
To: libstdc++@gcc.gnu.org,
	"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: [v3 PATCH] Implement N4387 and LWG 2367
Date: Sun, 07 Jun 2015 06:53:00 -0000	[thread overview]
Message-ID: <CAFk2RUZEEUFNeNdOpLdvGAcYZTk2+5B4HTRz5rfTaZHSBJBxJw@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 2180 bytes --]

This patch implements the so-called conditionally-explicit constructors
for tuple and pair, and also constrains the default constructors of tuple and
pair. The patch does not try to implement the part in N4387 that allows
constructing tuples from shorter packs than the tuple's element count,
I suggest we look at that separately. The constraints involve fair amounts
of evil black magic, but they do the job. Chances are they can be simplified,
but I again suggest we look at that separately.

Tested on Linux-PPC64.

Patch gzipped since it's 50kB otherwise. :)

2015-06-07  Ville Voutilainen  <ville.voutilainen@gmail.com>
    Implement N4387, "improving pair and tuple" and
    LWG 2367, "pair and tuple are not correctly implemented for
    is_constructible with no args".
    * include/bits/stl_pair.h (_ConstructiblePair,
    _ImplicitlyConvertiblePair, _MoveConstructiblePair,
    _ImplicitlyMoveConvertiblePair): New.
    * include/bits/stl_pair.h (pair()): Constrain it.
    * include/bits/stl_pair.h (pair(const _T1&, const _T2&),
    pair(const pair<_U1, _U2>&), pair(_U1&&, const _T2&),
    pair(const _T1&, _U2&&), pair(_U1&&, _U2&&),
    pair(pair<_U1, _U2>&&)): Make conditionally explicit.
    * include/std/tuple (_TC, _TC2): New.
    * include/std/tuple (tuple()): Constrain it.
    * include/std/tuple (tuple(const _UElements&...),
    tuple(_UElements&&...), tuple(const tuple<_UElements...>&),
    tuple(tuple<_UElements...>&&),
    tuple(allocator_arg_t, const _Alloc&, const _UElements&...),
    tuple(allocator_arg_t, const _Alloc&, _UElements&&...),
    tuple(allocator_arg_t, const _Alloc&, const tuple<_UElements...>&),
    tuple(allocator_arg_t, const _Alloc&, tuple<_UElements...>&&),
    tuple(const pair<_U1, _U2>&),
    tuple(pair<_U1, _U2>&&),
    tuple(allocator_arg_t, const _Alloc&, const pair<_U1, _U2>&),
    tuple(allocator_arg_t, const _Alloc&, pair<_U1, _U2>&&)): Make
    conditionally explicit.
    * testsuite/20_util/pair/cons/explicit_construct.cc: New.
    * testsuite/20_util/pair/requirements/dr2367.cc: New.
    * testsuite/20_util/tuple/cons/explicit_construct.cc: New.
    * testsuite/20_util/tuple/requirements/dr2367.cc: New.

[-- Attachment #2: explicit-tuple-pair.diff.gz --]
[-- Type: application/x-gzip, Size: 5569 bytes --]

             reply	other threads:[~2015-06-07  1:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-07  6:53 Ville Voutilainen [this message]
2015-06-07  8:13 ` Marc Glisse
2015-06-07  8:33   ` Ville Voutilainen
2015-06-07  8:49     ` Ville Voutilainen
2015-06-07  8:50       ` Ville Voutilainen
2015-06-07 11:37       ` Marc Glisse
2015-06-08 15:41 ` Martin Sebor
2015-06-08 15:56   ` Ville Voutilainen
2015-06-08 16:16     ` Ville Voutilainen
2015-06-14  7:07       ` Ville Voutilainen
2015-06-30 13:28         ` Jonathan Wakely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFk2RUZEEUFNeNdOpLdvGAcYZTk2+5B4HTRz5rfTaZHSBJBxJw@mail.gmail.com \
    --to=ville.voutilainen@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).