Quick Q: Why does moving std::optional not reset state?

Save to:
Instapaper Pocket Readability

Quick A: performance.

Recently on SO:

Why does moving std::optional not reset state?

In a word: Performance.

One of the chief motivating reasons for move semantics to exist in the first place is performance. So the special operations move construction and move assignment should be as fast as possible for all types...

Add a Comment

Comments are closed.

Comments (0)

There are currently no comments on this entry.