Quantcast
Channel: Comments on: 7.7 — Default parameters
Viewing all articles
Browse latest Browse all 48

By: Alex

$
0
0
This is a pretty common question. There's some conversation about this topic <a href="https://stackoverflow.com/questions/1123725/why-should-default-parameters-be-added-last-in-c-functions" rel="nofollow">here</a>. I think the short is that they could have, but it would have made the language more complex, and they didn't feel that was worth the tradeoffs. I do wonder if you could work around this by using <a href="http://en.cppreference.com/w/cpp/utility/optional" rel="nofollow">std::optional</a>, which was introduced in C++17.

Viewing all articles
Browse latest Browse all 48

Trending Articles