Extending temporary’s lifetime through rvalue data-member works with aggregate, but not with constructor, why?
TL;DR Aggregate initialization can be used to extend the life-time of a temporary, a user-defined constructor cannot do the same since it’s effectively a function call. Note: Both T const& and T&& apply in the case of aggregate-initalization and extending the life of temporaries bound to them. What is an Aggregate? struct S { // … Read more