This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [v3 PATCH] Implement P0504R0 (Revisiting in-place tag types for any/optional/variant).
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: Ville Voutilainen <ville dot voutilainen at gmail dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Sun, 13 Nov 2016 21:02:54 +0000
- Subject: Re: [v3 PATCH] Implement P0504R0 (Revisiting in-place tag types for any/optional/variant).
- Authentication-results: sourceware.org; auth=none
- References: <CAFk2RUYehjAUhYye_aEM1YFcfzmw+p-2Z=3ZYBaPiPBffNwCaQ@mail.gmail.com>
On 12/11/16 21:24 +0200, Ville Voutilainen wrote:
+ inline in_place_t in_place{};
+
+ template<typename _Tp> struct in_place_type_t
+ {
+ explicit in_place_type_t() = default;
+ };
+
+ template<typename _Tp>
+ in_place_type_t<_Tp> in_place_type{};
+
+ template<size_t _Idx> struct in_place_index_t
+ {
+ explicit in_place_index_t() = default;
+ };
+
+ template<size_t _Idx>
+ in_place_index_t<_Idx> in_place_index{};
I was told there's a Core issue that says these are not actually
inline variables unless they say "inline". Not sure which issue that
is, but G++ does the right thing and makes them globally unique,
rather than having internal linkage.
(At LWG's request P0504R0 marked them inline just to be safe.)
OK for trunk, thanks.