Motivated by What does the expression std::string {} = "..." mean?;
Does the left hand side of the std::string {} = "hi";
induce temporary materialization and if it does, which of the mentioned scenarios below does it fall within?
Temporary materialization occurs in the following situations:
- 1- when binding a reference to a prvalue;
- 2- when performing a member access on a class prvalue;
- 3- when performing an array-to-pointer conversion or subscripting on an array prvalue;
- 4- when initializing an object of type std::initializer_list from a braced-init-list;
- 5- when typeid is applied to a prvalue
- 6- when sizeof is applied to a prvalue
- 7- when a prvalue appears as a discarded-value expression.
I would expect that std::string {}
induces temporary materialization since we create an object that is temporary, but couldn't find which scenario would fit here.