public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [v3 PATCH] Implement N4387 and LWG 2367
@ 2015-06-07  6:53 Ville Voutilainen
  2015-06-07  8:13 ` Marc Glisse
  2015-06-08 15:41 ` Martin Sebor
  0 siblings, 2 replies; 11+ messages in thread
From: Ville Voutilainen @ 2015-06-07  6:53 UTC (permalink / raw)
  To: libstdc++, gcc-patches

[-- 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 --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-06-30 13:27 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-07  6:53 [v3 PATCH] Implement N4387 and LWG 2367 Ville Voutilainen
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

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).