[v3 PATCH] PR libstdc++/84601

Jonathan Wakely jwakely.gcc@gmail.com
Tue Mar 6 21:06:00 GMT 2018

On 28/02/18 15:12 +0200, Ville Voutilainen wrote:
>-  // Payload for constexpr optionals.
>+  // Payload for optionals with non-trivial destructor.
>   template <typename _Tp,
>           bool /*_HasTrivialDestructor*/ =
>-            is_trivially_destructible<_Tp>::value>
>+            is_trivially_destructible<_Tp>::value,
>+          bool /*_HasTrivialCopyAssignment*/ =
>+            is_trivially_copy_assignable<_Tp>::value,
>+          bool /*_HasTrivialMoveAssignment*/ =
>+            is_trivially_move_assignable<_Tp>::value>

I'm not sure these comments are very useful, as they just repeat the
info that the traits already give us. Also, you could use the _v
variable templates if you wanted (doesn't make much difference

But on the subject of redundant comments ...

>     struct _Optional_payload

It took me a minute to figure out which conditions the primary
template gets used for, to double-check the comment. Would it be
helpful to use a comment like:

     struct _Optional_payload // <false, _TrivialCopy, _TrivialMove>

or does that not really clarify anything?

I suppose it doesn't tell us any more than the "non-trivial
destructor" comment you already have.

So OK for trunk then.

More information about the Gcc-patches mailing list