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]

Re: [v3 PATCH] PR libstdc++/84601


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
though).

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.


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