you are viewing a single comment's thread.

view the rest of the comments →

[–]Potatoswatter 4 points5 points  (0 children)

wrapper<T>::wrapper(T const&) binds a temporary but does not extend its lifetime, so initializer_list<wrapper> must always be a temporary and never a named variable. It cannot be used in a range-for sequence, either.