How to set initial size for STL reference_wrapper container?
some reference type wrapped in
. Since I have to fill this container out of order, I am trying to set an initial size for the container:
vector<std::reference_wrapper<T>> v(5); v = .. v = .. v = .. v = .. v = ..
This won't compile with an error like:
error: no matching function for call to ‘std::reference_wrapper<int>::reference_wrapper()’
Is there a workaround for this work or do I need to use it
for this purpose?
source to share