Can std::initializer_list contain reference types (both rvalue and lvalue)? Or do you need to use pointers or a reference wrapper (e.g. std::ref )?
EDIT:
More clarification may be required:
I have a member variable, ::std::vector<std::function<void()> > , into which I would like to forward the lambda object. This is usually done using emplace_back , but I wanted to do this in the constructor initialization list. Alas, as I read, this would make shipping impossible.
c ++ c ++ 11 initializer-list
user1095108
source share