This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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] Implement LWG 2857, {variant,optional,any}::emplace should return the constructed value.


Tested on Linux-x64.

2017-03-16  Ville Voutilainen  <ville.voutilainen@gmail.com>

    Implement LWG 2857, {variant,optional,any}::emplace should
    return the constructed value.
    * include/std/any (any_cast(any*)): Forward-declare.
    (emplace(_Args&&...)): Change the return type and
    return a reference to the constructed value.
    (emplace(initializer_list<_Up>, _Args&&...)): Likewise.
    * include/std/optional (emplace(_Args&&...)): Likewise.
    (emplace(initializer_list<_Up>, _Args&&...)): Likewise.
    * include/std/variant (emplace<_Tp>(_Args&&...)): Likewise.
    (emplace<_Tp>(initializer_list<_Up>, _Args&&...)): Likewise.
    (emplace<_Np>(_Args&&...)): Likewise.
    (emplace<_Np>(initializer_list<_Up>, _Args&&...)): Likewise.
    * testsuite/20_util/any/assign/emplace.cc: Add tests for
    checking the return value of emplace.
    * testsuite/20_util/any/misc/any_cast_neg.cc: Adjust.
    * testsuite/20_util/optional/assignment/6.cc: Add tests for
    checking the return value of emplace.
    * testsuite/20_util/variant/run.cc: Likewise.

Attachment: lwg2857.diff
Description: Text document


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