logoalt Hacker News

tialaramexlast Monday at 12:44 PM1 replyview on HN

It's a foot gun. Why is the default target for this gun my foot? "You should be careful to choose the target properly" isn't an answer to that question.


Replies

gpderettalast Monday at 1:12 PM

In what way it is a footgun? auto x = ... ; does what I would expect. Copying is usually the default in C++ and that's what I would expect to happen here.

If auto deduced reference types transparently, it would actually be more dangerous.

show 2 replies