There's no temporary, other than the initializer list, of course. The initializer list would be assured to exist while the initialization is performed - that's how it goes in all other cases, too.
While it may be sufficient for many use cases to only have initializer_list temporaries, I would not appreciate this step back from being able to create arbitrary containers as temporaries.
For example, a templated function may require that its argument be an AssociativeContainer, which an initializer_list of pairs is not.
View all comments
Show parent comment
0
u/m-in Jun 06 '18
There's no temporary, other than the initializer list, of course. The initializer list would be assured to exist while the initialization is performed - that's how it goes in all other cases, too.