* [v3 PATCH] Implement P0032R3, Homogeneous interface for variant, any and optional, for the parts concerning any and optional.
@ 2016-07-13 23:14 Ville Voutilainen
2016-07-13 23:23 ` Ville Voutilainen
0 siblings, 1 reply; 4+ messages in thread
From: Ville Voutilainen @ 2016-07-13 23:14 UTC (permalink / raw)
To: gcc-patches, libstdc++
[-- Attachment #1: Type: text/plain, Size: 2615 bytes --]
Tested on Linux-x64.
2016-07-14 Ville Voutilainen <ville.voutilainen@gmail.com>
Implement P0032R3, Homogeneous interface for variant, any and optional,
for the parts concerning any and optional.
* include/std/any (_Storage()): Make constexpr and have it
initialize _M_ptr.
(any()): Make constexpr.
(any(const any&)): Adjust.
(any(any&&)): Likewise.
(__any_constructible_t): New.
(any(_ValueType&&)): Constrain.
(any(in_place_type_t<_Tp>, _Args&&...)): New.
(any(in_place_type_t<_Tp>, initializer_list<_Up>, _Args&&...)):
Likewise.
(~any()): Adjust.
(operator=(const any&)): Likewise.
(operator=(any&&)): Likewise.
(operator=(_ValueType&&)): Constrain.
(emplace(_Args&&...)): New.
(emplace(initializer_list<_Up>, _Args&&...)): Likewise.
(clear()): Remove.
(reset()): New.
(swap(any&)): Adjust.
(empty()): Remove.
(has_value()): New.
(type()): Adjust.
(_Manager_internal::_S_create(_Storage&, _Args&&...)): New.
(_Manager_external::_S_create(_Storage&, _Args&&...)): Likewise.
(make_any(_Args&&...)): Likewise.
(make_any(initializer_list<_Up>, _Args&&...)): Likewise.
* include/std/optional (in_place_t, in_place): Remove.
(bad_optional_access): Add a comment referring to LEWG 72.
(emplace(_Args&&...)): Constrain.
(has_value()): New.
(reset()): Likewise.
(make_optional(_Args&&...)): Likewise.
(make_optional(initializer_list<_Up>, _Args&&...)): Likewise.
* include/std/utility (in_place_tag): New.
(__in_place, __in_place_type, __in_place_index): Likewise.
(in_place_t, in_place_type_t, in_place_index_t): Likewise.
(in_place(__in_place*)): Likewise.
(in_place(__in_place_type<_Tp>*)): Likewise.
(in_place(__in_place_index<_Idx>*)): Likewise.
* testsuite/20_util/any/assign/1.cc: Adjust.
* testsuite/20_util/any/assign/emplace.cc: New.
* testsuite/20_util/any/assign/self.cc: Adjust.
* testsuite/20_util/any/cons/1.cc: Likewise.
* testsuite/20_util/any/cons/in_place.cc: New.
* testsuite/20_util/any/make_any.cc: Likewise.
* testsuite/20_util/any/misc/any_cast_neg.cc: Adjust.
* testsuite/20_util/any/misc/swap.cc: Likewise.
* testsuite/20_util/any/modifiers/1.cc: Likewise.
* testsuite/20_util/any/requirements.cc: New.
* testsuite/20_util/in_place/requirements.cc: Likewise.
* testsuite/20_util/optional/constexpr/in_place.cc: Adjust.
* testsuite/20_util/optional/in_place.cc: Likewise.
* testsuite/20_util/optional/make_optional.cc: Add tests for
the new overloads of make_optional.
[-- Attachment #2: P0032R3.diff.gz --]
[-- Type: application/x-gzip, Size: 5811 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [v3 PATCH] Implement P0032R3, Homogeneous interface for variant, any and optional, for the parts concerning any and optional.
2016-07-13 23:14 [v3 PATCH] Implement P0032R3, Homogeneous interface for variant, any and optional, for the parts concerning any and optional Ville Voutilainen
@ 2016-07-13 23:23 ` Ville Voutilainen
2016-07-13 23:59 ` Ville Voutilainen
0 siblings, 1 reply; 4+ messages in thread
From: Ville Voutilainen @ 2016-07-13 23:23 UTC (permalink / raw)
To: gcc-patches, libstdc++
[-- Attachment #1: Type: text/plain, Size: 249 bytes --]
On 14 July 2016 at 02:14, Ville Voutilainen <ville.voutilainen@gmail.com> wrote:
> * include/std/any (_Storage()): Make constexpr and have it
> initialize _M_ptr.
This bit had a stale left-over comment in it. Removed in the updated patch.
[-- Attachment #2: P0032R3_2.diff.gz --]
[-- Type: application/x-gzip, Size: 5845 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [v3 PATCH] Implement P0032R3, Homogeneous interface for variant, any and optional, for the parts concerning any and optional.
2016-07-13 23:23 ` Ville Voutilainen
@ 2016-07-13 23:59 ` Ville Voutilainen
2016-07-14 9:03 ` Jonathan Wakely
0 siblings, 1 reply; 4+ messages in thread
From: Ville Voutilainen @ 2016-07-13 23:59 UTC (permalink / raw)
To: gcc-patches, libstdc++
[-- Attachment #1: Type: text/plain, Size: 423 bytes --]
On 14 July 2016 at 02:23, Ville Voutilainen <ville.voutilainen@gmail.com> wrote:
> On 14 July 2016 at 02:14, Ville Voutilainen <ville.voutilainen@gmail.com> wrote:
>> * include/std/any (_Storage()): Make constexpr and have it
>> initialize _M_ptr.
>
>
> This bit had a stale left-over comment in it. Removed in the updated patch.
Also, the in_place(__in_place*) needs to be inline. Another updated
patch attached.
[-- Attachment #2: P0032R3_3.diff.gz --]
[-- Type: application/x-gzip, Size: 5848 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [v3 PATCH] Implement P0032R3, Homogeneous interface for variant, any and optional, for the parts concerning any and optional.
2016-07-13 23:59 ` Ville Voutilainen
@ 2016-07-14 9:03 ` Jonathan Wakely
0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Wakely @ 2016-07-14 9:03 UTC (permalink / raw)
To: Ville Voutilainen; +Cc: gcc-patches, libstdc++
This change replaced a Tab with 8 spaces, but the lines after it still
use Tabs:
@@ -641,12 +634,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
template<typename... _Args>
- void
+ enable_if_t<is_constructible<_Tp, _Args&&...>::value>
emplace(_Args&&... __args)
{
Might as well keep it consistent (and save 7 bytes! ;)
OK for trunk, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-07-14 9:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-13 23:14 [v3 PATCH] Implement P0032R3, Homogeneous interface for variant, any and optional, for the parts concerning any and optional Ville Voutilainen
2016-07-13 23:23 ` Ville Voutilainen
2016-07-13 23:59 ` Ville Voutilainen
2016-07-14 9:03 ` 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).