[v3 PATCH] Implement P0504R0 (Revisiting in-place tag types for any/optional/variant).

Jonathan Wakely jwakely@redhat.com
Sun Nov 13 21:03:00 GMT 2016


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.



More information about the Libstdc++ mailing list