@malwareminigun Ah, I missed that detail.
Well, that's a tradeoff to consider, of course.
asperamanca@mastodon.social
@asperamanca@mastodon.social
Posts
-
"Bill why do you hate optional<T&> so much?" Bill: -
"Bill why do you hate optional<T&> so much?" Bill:@malwareminigun Playing on compiler explorer with GCC trunk, consider
https://compiler-explorer.com/z/hTb9dT8zqWhen you disable the lines returning ptr, and instead enable the lines returning optRef, the assemly is the same for me.
And I tried to prevent the optimizer from being too smart with some random number generation.
What am I missing?
-
"Bill why do you hate optional<T&> so much?" Bill:@malwareminigun @horenmar Did I miss a time warp, or which optional<T&> are you talking about?
Wouldn't this be something compilers will optimize for, once they officially "know" about it?