You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by GitBox <gi...@apache.org> on 2022/05/20 18:39:01 UTC

[GitHub] [trafficserver] ywkaras commented on pull request #8857: Add ts::overloaded as a type matching helper of std::visit

ywkaras commented on PR #8857:
URL: https://github.com/apache/trafficserver/pull/8857#issuecomment-1133201797

   I feel hesitant about heavy use of std::visit.  In many cases, you can use if-else-if instead:  https://godbolt.org/z/bsqhf1dq5 .  It's more straight-forward, and not significantly more verbose.  It looks like the one case where std::visit has a clear advantage is when one of the lambda functions uses an auto reference, and can handle multiple fields in the variant.
   
   In (out of date) gcc 8.3 (the version we use at Yahoo), the optimizer doesn't optimize std::visit well (gcc 12 does).  But I couldn't blame the ATS community if they don't have great sympathy for our self-inflicted wounds.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org