This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[v3 PATCH] Make the default constructors of tuple and pair conditionally explicit.


In the last meeting, while processing LWG 2510, LWG's guidance
was to make the default constructors of pair and tuple conditionally
explicit. This patch implements a new trait and uses it in pair and tuple.

Paolo, Jonathan is traveling and somewhat unlikely to be able to review
this for quite some time, could you please review this patch?

Tested on Linux-PPC64.

2015-11-01  Ville Voutilainen  <ville.voutilainen@gmail.com>

    Make the default constructors of tuple and pair conditionally explicit.
    * include/std/type_traits (
    __do_is_implicitly_default_constructible_impl
    __is_implicitly_default_constructible_impl,
    __is_implicitly_default_constructible_safe,
    __is_implicitly_default_constructible): New.
    * include/bits/stl_pair.h (pair::pair()): Use it.
    * include/std/tuple (tuple<_T1, _T2>::tuple): Use it.
    * include/std/tuple (ImplicitlyDefaultConstructibleTuple): New.
    * include/std/tuple (tuple<_Types...>::tuple()): Use it.
    * testsuite/20_util/declval/requirements/1_neg.cc: Adjust.
    * testsuite/20_util/is_implicitly_default_constructible/requirements/explicit_instantiation.cc:
New.
    * testsuite/20_util/is_implicitly_default_constructible/requirements/typedefs.cc:
Likewise.
    * testsuite/20_util/is_implicitly_default_constructible/value.cc: Likewise.
    * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Adjust.
    * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Likewise.
    * testsuite/20_util/pair/cons/explicit_construct.cc: Likewise.
    * testsuite/20_util/tuple/cons/explicit_construct.cc: Likewise.

Attachment: conditional-explicit-default-ctors-pair-tuple2.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]